Skip to content

Commit

Permalink
fixup! fixup! fixup! Add LLDB Python test for macOS and Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
tmcgilchrist committed Jul 2, 2024
1 parent 2f9dda1 commit e4c282a
Showing 1 changed file with 93 additions and 39 deletions.
132 changes: 93 additions & 39 deletions testsuite/tests/native-debugger/macos-lldb-amd64.reference
Original file line number Diff line number Diff line change
Expand Up @@ -3,52 +3,106 @@ Current executable set to 'XXXX' ($ARCH).
(lldb) command source -s 0 'XXXX'
Executing commands in 'XXXX'.
(lldb) command script import ./lldb_test.py
(lldb) create camlFib.main_*
Breakpoint created for regex camlFib.main_*.
(lldb) create camlFib.fib_*
Breakpoint created for regex camlFib.fib_*.
(lldb) create caml_start_program
Breakpoint created for regex caml_start_program.
(lldb) create caml_program
Breakpoint created for regex caml_program.
(lldb) create camlMeander.c_to_ocaml*
Breakpoint created for regex camlMeander.c_to_ocaml*.
(lldb) create ocaml_to_c
Breakpoint created for regex ocaml_to_c.
(lldb) run
Process XXXX stopped
* thread #1, queue = 'XXXX', stop reason = breakpoint 1.1
frame #0: 0x00000000000000 fib`camlFib.main_272
fib`camlFib.main_272:
-> 0x00000000000000 <+0>: leaq -0x150(%rsp), %r10
0x00000000000000 <+8>: cmpq 0x28(%r14), %r10
0x00000000000000 <+12>: jb 0x00000000000000 ; <+101>
0x00000000000000 <+14>: subq $0x10, %rsp
Target 0: (fib) stopped.
frame #0: 0x00000000000000 meander`caml_start_program
meander`caml_start_program:
-> 0x00000000000000 <+XX>: pushq %rbx
0x00000000000000 <+XX>: pushq %rbp
0x00000000000000 <+XX>: pushq %r12
0x00000000000000 <+XX>: pushq %r13
Target 0: (meander) stopped.
Process XXXX launched: 'XXXX' ($ARCH)
(lldb) backtrace
frame 0: fib`camlFib.main_272
frame 1: fib`camlFib.entry
frame 2: fib`caml_program
frame 3: fib`caml_start_program
frame 4: fib`caml_startup_common
frame 5: fib`caml_startup_exn
frame 6: fib`caml_startup
frame 7: fib`caml_main
frame 8: fib`main
frame 9: dyld`start
frame 0: meander`caml_start_program
frame 1: meander`caml_startup_common
frame 2: meander`caml_startup_exn
frame 3: meander`caml_startup
frame 4: meander`caml_main
frame 5: meander`main
frame 6: dyld`start
(lldb) continue
Process XXXX resuming
Process XXXX stopped
* thread #1, queue = 'XXXX', stop reason = breakpoint 2.1
frame #0: 0x00000000000000 fib`camlFib.fib_270
fib`camlFib.fib_270:
-> 0x00000000000000 <+0>: leaq -0x150(%rsp), %r10
0x00000000000000 <+8>: cmpq 0x28(%r14), %r10
0x00000000000000 <+12>: jb 0x00000000000000 ; <+99>
0x00000000000000 <+14>: subq $0x10, %rsp
Target 0: (fib) stopped.
frame #0: 0x00000000000000 meander`caml_program
meander`caml_program:
-> 0x00000000000000 <+XX>: leaq -0x140(%rsp), %r10
0x00000000000000 <+XX>: cmpq 0x28(%r14), %r10
0x00000000000000 <+XX>: jb 0x00000000000000 ; <+XX>
0x00000000000000 <+XX>: callq 0x00000000000000 ;
Target 0: (meander) stopped.
(lldb) backtrace
frame 0: fib`camlFib.fib_270
frame 1: fib`camlFib.main_272
frame 2: fib`camlFib.entry
frame 3: fib`caml_program
frame 4: fib`caml_start_program
frame 5: fib`caml_startup_common
frame 6: fib`caml_startup_exn
frame 7: fib`caml_startup
frame 8: fib`caml_main
frame 9: fib`main
frame 10: dyld`start
frame 0: meander`caml_program
frame 1: meander`caml_start_program
frame 2: meander`caml_startup_common
frame 3: meander`caml_startup_exn
frame 4: meander`caml_startup
frame 5: meander`caml_main
frame 6: meander`main
frame 7: dyld`start
(lldb) continue
warning: meander was compiled with optimization - stepping may behave oddly;
Process XXXX resuming
Process XXXX stopped
* thread #1, queue = 'XXXX', stop reason = breakpoint 4.1
frame #0: 0x00000000000000 meander`ocaml_to_c(unit=1) at meander_c.c:5:20 [opt]
2 #include <caml/callback.h>
3
4 value ocaml_to_c (value unit) {
-> 5 caml_callback(*caml_named_value
^
6 ("c_to_ocaml"), Val_unit);
7 return Val_int(0);
8 }
Target 0: (meander) stopped.
(lldb) backtrace
frame 0: meander`ocaml_to_c
frame 1: meander`caml_c_call
frame 2: meander`camlMeander.omain_278
frame 3: meander`camlMeander.entry
frame 4: meander`caml_program
frame 5: meander`caml_start_program
frame 6: meander`caml_startup_common
frame 7: meander`caml_startup_exn
frame 8: meander`caml_startup
frame 9: meander`caml_main
frame 10: meander`main
frame 11: dyld`start
(lldb) continue
Process XXXX resuming
Process XXXX stopped
* thread #1, queue = 'XXXX', stop reason = breakpoint 3.1
frame #0: 0x00000000000000 meander`camlMeander.c_to_ocaml_273
meander`camlMeander.c_to_ocaml_273:
-> 0x00000000000000 <+XX>: leaq 0x00000000000000(%rip), %rax ;
0x00000000000000 <+XX>: movq (%rax), %rax
0x00000000000000 <+XX>: callq 0x00000000000000 ;
0x00000000000000 <+XX>: nop
Target 0: (meander) stopped.
(lldb) backtrace
frame 0: meander`camlMeander.c_to_ocaml_273
frame 1: meander`caml_start_program
frame 2: meander`caml_callback_exn
frame 3: meander`caml_callback
frame 4: meander`ocaml_to_c
frame 5: meander`caml_c_call
frame 6: meander`camlMeander.omain_278
frame 7: meander`camlMeander.entry
frame 8: meander`caml_program
frame 9: meander`caml_start_program
frame 10: meander`caml_startup_common
frame 11: meander`caml_startup_exn
frame 12: meander`caml_startup
frame 13: meander`caml_main
frame 14: meander`main
frame 15: dyld`start

0 comments on commit e4c282a

Please sign in to comment.