Files
llvm-project/lldb/test/Shell/Commands/command-memory-region.test
David Spickett e1a23f7152 [lldb] Fix error when running "memory region --all" repeatedly (#177176)
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.
2026-01-26 09:43:04 +00:00

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]+}})