gdb.ml debug difference in output
Closed this issue · 1 comments
Sudha247 commented
Following the steps described in the tutorial yields the following output:
(gdb) break caml_resume
Breakpoint 1 at 0x911f4
(gdb) break caml_perform
Breakpoint 2 at 0x91140
(gdb) r
Starting program: /home/sudha/dir/ocaml-effects-tutorial/sources/gdb.native
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Breakpoint 2, 0x00005555555e5140 in caml_perform ()
(gdb) bt
#0 0x00005555555e5140 in caml_perform ()
#1 0x0000555555599b64 in camlGdb__a_1004 () at gdb.ml:4
#2 0x0000555555599bd7 in camlGdb__b_1006 () at gdb.ml:5
#3 0x0000555555599c47 in camlGdb__c_1008 () at gdb.ml:6
#4 <signal handler called>
#5 0x0000555555599cd5 in camlGdb__d_1010 () at gdb.ml:10
#6 <signal handler called>
#7 0x0000555555599d75 in camlGdb__e_1015 () at gdb.ml:16
#8 0x0000555555599f46 in camlGdb__entry () at gdb.ml:23
#9 0x00005555555966eb in caml_program ()
#10 <signal handler called>
#11 caml_startup_common (argv=0x7fffffffddc8, pooling=<optimized out>, pooling@entry=0) at startup.c:137
#12 0x00005555555e5518 in caml_startup_exn (argv=<optimized out>) at startup.c:141
#13 caml_main (argv=<optimized out>) at startup.c:146
#14 0x000055555559646c in main (argc=<optimized out>, argv=<optimized out>) at main.c:44
(gdb) c
Continuing.
Raised by primitive operation at file "gdb.ml", line 4, characters 14-26
Called from file "gdb.ml", line 5, characters 14-17
Called from file "gdb.ml", line 6, characters 14-17
Called from file "gdb.ml", line 10, characters 2-62
Breakpoint 1, 0x00005555555e51f4 in caml_resume ()
(gdb) bt
#0 0x00005555555e51f4 in caml_resume ()
#1 0x0000555555599d75 in camlGdb__e_1015 () at gdb.ml:16
#2 0x0000555555599f46 in camlGdb__entry () at gdb.ml:23
#3 0x00005555555966eb in caml_program ()
#4 <signal handler called>
#5 caml_startup_common (argv=0x7fffffffddc8, pooling=<optimized out>, pooling@entry=0) at startup.c:137
#6 0x00005555555e5518 in caml_startup_exn (argv=<optimized out>) at startup.c:141
#7 caml_main (argv=<optimized out>) at startup.c:146
#8 0x000055555559646c in main (argc=<optimized out>, argv=<optimized out>) at main.c:44
(gdb) c
Continuing.
333
[Inferior 1 (process 7902) exited normally]
Not sure if the order of execution is same as described in the tutorial, there's a difference in order of hitting the breakpoints and the number of times breakpoints are encountered (lesser in this case). I shall try to gain more understanding on this and raise a PR.