1 # RUN: %clang_host %p/Inputs/stop-hook.c -g -o %t
2 # Test setting stop-hook per-function
3 # RUN: %lldb -b -s %p/Inputs/stop-hook-1.lldbinit -s %s -f %t \
4 # RUN: | FileCheck --check-prefix=CHECK --check-prefix=CHECK-FUNC %s
5 # Test setting stop-hook per-line range
6 # RUN: %lldb -b -s %p/Inputs/stop-hook-2.lldbinit -s %s -f %t | FileCheck %s
7 # Test setting stop-hook with multi-line expression
8 # RUN: %lldb -b -s %p/Inputs/stop-hook-3.lldbinit -s %s -f %t | FileCheck %s
9 # This test is not "unsupported" on Windows, but it fails because "expr ptr"
10 # does not evaluate correctly. However, the error message contains the expected
11 # string, so the test "passes" despite the fact that the commands failed
13 # UNSUPPORTED: system-windows
15 break set -f stop-hook.c -p "// Set breakpoint here to test target stop-hook"
16 break set -f stop-hook.c -p "// Another breakpoint which is outside of the stop-hook range"
20 # CHECK-NEXT: State: enabled
21 # CHECK-NEXT: Specifier:
22 # CHECK-FUNC-NEXT: Function: b.
23 # CHECK-NEXT: Commands:
24 # CHECK-NEXT: expr ptr
26 target stop-hook disable
30 # CHECK-NEXT: State: disabled
31 # CHECK-NEXT: Specifier:
32 # CHECK-FUNC-NEXT: Function: b.
33 # CHECK-NEXT: Commands:
34 # CHECK-NEXT: expr ptr
36 target stop-hook enable
40 # CHECK-NEXT: State: enabled
41 # CHECK-NEXT: Specifier:
42 # CHECK-FUNC-NEXT: Function: b.
43 # CHECK-NEXT: Commands:
44 # CHECK-NEXT: expr ptr
47 # Stopping inside of the stop hook range
49 # CHECK-NEXT: (void *) ${{.*}} = 0x
52 # Stepping inside of the stop hook range
53 # CHECK: (lldb) thread step-over
54 # CHECK-NEXT: (void *) ${{.*}} = 0x
55 # CHECK: ->{{.*}} // We should stop here after stepping.
58 # Stopping outside of the stop hook range
59 # CHECK: (lldb) process continue
61 # CHECK: ->{{.*}} // Another breakpoint which is outside of the stop-hook range.
64 # Stepping inside of the stop hook range
65 # CHECK: (lldb) thread step-over
68 settings set auto-confirm true
69 target stop-hook delete
72 # CHECK: (lldb) target stop-hook list
74 # CHECK: No stop hooks