llvm-project/lldb/test/Shell/ExecControl/StopHook/stop-hook-list-format.test
Julian Lettner 25da15f9b1
[lldb] Fix indentation when printing stop hooks (#165945)
This commit aggregates the following changes:
1. Fix the format (i.e., indentation) when printing stop hooks via `target
   stop-hook list`.
2. Add `IndentScope Stream::MakeIndentScope()` to make managing (and restoring!)
   of the indentation level on `Stream` instances more ergonomic and less error
   prone.
3. Simplify printing of stop hooks using the new `IndentScope`.
2025-11-03 13:29:34 -08:00

37 lines
1.0 KiB
Plaintext

# Test format (e.g., indentation) when printing the list of stop hooks.
#
# RUN: %lldb -b -s %s | FileCheck %s --match-full-lines --strict-whitespace
# Create some stop hooks
target stop-hook add -o 'print "Hello"' --auto-continue true --at-initial-stop true
target stop-hook add -o 'print "world,"' -o 'print "nice"' --file 'my_file'
target stop-hook add -o 'print "weather!"' --classname 'MyClass' --thread-name 'my_thread'
# Print hooks
target stop-hook list
# CHECK:(lldb) target stop-hook list
# CHECK:Hook: 1
# CHECK: State: enabled
# CHECK: AutoContinue on
# CHECK: Commands:
# CHECK: print "Hello"
# CHECK-EMPTY:
# CHECK:Hook: 2
# CHECK: State: enabled
# CHECK: Specifier:
# CHECK: File: my_file.
# CHECK: Commands:
# CHECK: print "world,"
# CHECK: print "nice"
# CHECK-EMPTY:
# CHECK:Hook: 3
# CHECK: State: enabled
# CHECK: Specifier:
# CHECK: Class name: MyClass.
# CHECK: Thread:
# CHECK: thread name: "my_thread"
# CHECK: Commands:
# CHECK: print "weather!"
# CHECK-EMPTY: