Due to some faulty logic, if you ran "memory region --all" twice, the second time lldb would try to repeat the command. There's nothing to repeat, so it failed with an error. It should treat each "--all" use as starting from scratch. The logic here was written in a confusing way, so I've refactored it to first look at how many arguments there are (aka how many address expressions there are) and then validate based on that. For reasons unknown, I could not reproduce this issue using the API test TestMemoryRegion.py. So I have added a shell test that I confirmed does fail without this fix.
11 lines
452 B
Plaintext
11 lines
452 B
Plaintext
## --all should be able to be used many times in a row. As it is not
|
|
## repeatable and starts fresh each time.
|
|
|
|
# RUN: %clang_host -g -O0 %S/Inputs/main.c -o %t.out
|
|
# RUN: %lldb %t.out -b -o 'b main' -o 'run' -o 'memory region --all' \
|
|
# RUN: -o 'memory region --all' | FileCheck %s
|
|
# CHECK-LABEL: memory region --all
|
|
# CHECK-NEXT: [0x{{[0-9a-f]+}}-0x{{[0-9a-f]+}})
|
|
# CHECK-LABEL: memory region --all
|
|
# CHECK-NEXT: [0x{{[0-9a-f]+}}-0x{{[0-9a-f]+}})
|