| 1 | #exe { |
| 2 | --name link_object |
| 3 | -Mroot=main.zig |
| 4 | #} |
| 5 | |
| 6 | #write main.zig { |
| 7 | extern fn fabsf(f32) f32; |
| 8 | pub fn main() void { |
| 9 | var x: f32 = -1234.5; |
| 10 | x = fabsf(x); |
| 11 | _ = &x; |
| 12 | } |
| 13 | #} |
| 14 | #update |
| 15 | #check lldb { |
| 16 | (lldb) breakpoint set --file main.zig --source-pattern-regexp 'x = fabsf\(x\);' |
| 17 | Breakpoint 1: where = link_object`main.main + #... at main.zig:4:14, address = 0x#... |
| 18 | (lldb) process launch |
| 19 | Process #... launched: '#.../link_object' (#...) |
| 20 | Process #... stopped |
| 21 | * thread #1, name = 'link_object', stop reason = breakpoint 1.1 |
| 22 | frame #0: link_object`main.main at main.zig:4:14 |
| 23 | (lldb) frame variable --show-all-children -- x |
| 24 | (f32) x = -1234.5 |
| 25 | (lldb) breakpoint delete --force 1 |
| 26 | 1 breakpoints deleted; 0 breakpoint locations disabled. |
| 27 | (lldb) #--- |
| 28 | (lldb) breakpoint set --file main.zig --source-pattern-regexp '_ = &x;' |
| 29 | Breakpoint 2: where = link_object`main.main + #... at main.zig:5:5, address = 0x#... |
| 30 | (lldb) process continue |
| 31 | Process #... resuming |
| 32 | Process #... stopped |
| 33 | * thread #1, name = 'link_object', stop reason = breakpoint 2.1 |
| 34 | frame #0: link_object`main.main at main.zig:5:5 |
| 35 | (lldb) frame variable --show-all-children -- x |
| 36 | (f32) x = 1234.5 |
| 37 | (lldb) breakpoint delete --force 2 |
| 38 | 1 breakpoints deleted; 0 breakpoint locations disabled. |
| 39 | #} |