Skip to content

Instantly share code, notes, and snippets.

@waTeim
Last active October 14, 2019 17:49
Show Gist options
  • Save waTeim/d42dd9a7ec18b39f7a6e to your computer and use it in GitHub Desktop.
Save waTeim/d42dd9a7ec18b39f7a6e to your computer and use it in GitHub Desktop.
A julia GDB session example
jeffw@dub1:~$ ps auxww | grep julia
jeffw 5646 1.5 11.3 8587092 85668 pts/0 S+ 19:53 0:03 julia-debug
jeffw 5886 0.0 0.1 9392 896 pts/1 S+ 19:57 0:00 grep --color=auto julia
jeffw@dub1:~$ gdb -p 5646
GNU gdb (GDB) 7.5-ubuntu
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Attaching to process 5646
Reading symbols from /usr/local/julia-6a3c173633/bin/julia-debug...done.
Reading symbols from /usr/local/julia-6a3c173633/bin/../lib/julia/libjulia-debug.so...done.
Loaded symbols for /usr/local/julia-6a3c173633/bin/../lib/julia/libjulia-debug.so
Reading symbols from /lib/x86_64-linux-gnu/libpthread.so.0...(no debugging symbols found)...done.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Loaded symbols for /lib/x86_64-linux-gnu/libpthread.so.0
Reading symbols from /lib/x86_64-linux-gnu/libc.so.6...(no debugging symbols found)...done.
Loaded symbols for /lib/x86_64-linux-gnu/libc.so.6
Reading symbols from /lib/x86_64-linux-gnu/librt.so.1...(no debugging symbols found)...done.
Loaded symbols for /lib/x86_64-linux-gnu/librt.so.1
Reading symbols from /lib/x86_64-linux-gnu/libdl.so.2...(no debugging symbols found)...done.
Loaded symbols for /lib/x86_64-linux-gnu/libdl.so.2
Reading symbols from /lib/x86_64-linux-gnu/libz.so.1...(no debugging symbols found)...done.
Loaded symbols for /lib/x86_64-linux-gnu/libz.so.1
Reading symbols from /lib/x86_64-linux-gnu/libm.so.6...(no debugging symbols found)...done.
Loaded symbols for /lib/x86_64-linux-gnu/libm.so.6
Reading symbols from /usr/lib/x86_64-linux-gnu/libstdc++.so.6...(no debugging symbols found)...done.
Loaded symbols for /usr/lib/x86_64-linux-gnu/libstdc++.so.6
Reading symbols from /lib/x86_64-linux-gnu/libgcc_s.so.1...(no debugging symbols found)...done.
Loaded symbols for /lib/x86_64-linux-gnu/libgcc_s.so.1
Reading symbols from /lib64/ld-linux-x86-64.so.2...(no debugging symbols found)...done.
Loaded symbols for /lib64/ld-linux-x86-64.so.2
Reading symbols from /usr/local/julia-6a3c173633/lib/julia/sys.so...done.
Loaded symbols for /usr/local/julia-6a3c173633/lib/julia/sys.so
Reading symbols from /usr/local/julia-6a3c173633/bin/../lib/julia/libpcre2-8.so...done.
Loaded symbols for /usr/local/julia-6a3c173633/bin/../lib/julia/libpcre2-8.so
Reading symbols from /usr/local/julia-6a3c173633/bin/../lib/julia/libgmp.so...(no debugging symbols found)...done.
Loaded symbols for /usr/local/julia-6a3c173633/bin/../lib/julia/libgmp.so
Reading symbols from /usr/local/julia-6a3c173633/bin/../lib/julia/libmpfr.so...done.
Loaded symbols for /usr/local/julia-6a3c173633/bin/../lib/julia/libmpfr.so
Reading symbols from /usr/local/julia-6a3c173633/bin/../lib/julia/libdSFMT.so...(no debugging symbols found)...done.
Loaded symbols for /usr/local/julia-6a3c173633/bin/../lib/julia/libdSFMT.so
Reading symbols from /usr/local/julia-6a3c173633/bin/../lib/julia/libopenblas.so...done.
Loaded symbols for /usr/local/julia-6a3c173633/bin/../lib/julia/libopenblas.so
Reading symbols from /usr/lib/x86_64-linux-gnu/libgfortran.so.3...(no debugging symbols found)...done.
Loaded symbols for /usr/lib/x86_64-linux-gnu/libgfortran.so.3
Reading symbols from /usr/lib/x86_64-linux-gnu/libquadmath.so.0...(no debugging symbols found)...done.
Loaded symbols for /usr/lib/x86_64-linux-gnu/libquadmath.so.0
Reading symbols from /usr/local/julia-6a3c173633/bin/../lib/julia/libcholmod.so...(no debugging symbols found)...done.
Loaded symbols for /usr/local/julia-6a3c173633/bin/../lib/julia/libcholmod.so
Reading symbols from /usr/local/julia-6a3c173633/bin/../lib/julia/libcolamd.so...(no debugging symbols found)...done.
Loaded symbols for /usr/local/julia-6a3c173633/bin/../lib/julia/libcolamd.so
Reading symbols from /usr/local/julia-6a3c173633/bin/../lib/julia/libamd.so...(no debugging symbols found)...done.
Loaded symbols for /usr/local/julia-6a3c173633/bin/../lib/julia/libamd.so
Reading symbols from /usr/local/julia-6a3c173633/bin/../lib/julia/libcamd.so...(no debugging symbols found)...done.
Loaded symbols for /usr/local/julia-6a3c173633/bin/../lib/julia/libcamd.so
Reading symbols from /usr/local/julia-6a3c173633/bin/../lib/julia/libccolamd.so...(no debugging symbols found)...done.
Loaded symbols for /usr/local/julia-6a3c173633/bin/../lib/julia/libccolamd.so
Reading symbols from /usr/local/julia-6a3c173633/bin/../lib/julia/libsuitesparseconfig.so...(no debugging symbols found)...done.
Loaded symbols for /usr/local/julia-6a3c173633/bin/../lib/julia/libsuitesparseconfig.so
Reading symbols from /usr/local/julia-6a3c173633/bin/../lib/julia/libsuitesparse_wrapper.so...(no debugging symbols found)...done.
Loaded symbols for /usr/local/julia-6a3c173633/bin/../lib/julia/libsuitesparse_wrapper.so
0x00007f1e86f32619 in syscall () from /lib/x86_64-linux-gnu/libc.so.6
(gdb) where
#0 0x00007f1e86f32619 in syscall () from /lib/x86_64-linux-gnu/libc.so.6
#1 0x00007f1e875f5eea in uv__epoll_wait (epfd=<optimized out>, events=events@entry=0x7fff5f9bcfd0, nevents=nevents@entry=1024, timeout=timeout@entry=-1)
at src/unix/linux-syscalls.c:312
#2 0x00007f1e875f45d6 in uv__io_poll (loop=loop@entry=0x7f1e88551600 <default_loop_struct>, timeout=-1) at src/unix/linux-core.c:202
#3 0x00007f1e875e7ea7 in uv_run (loop=0x7f1e88551600 <default_loop_struct>, mode=UV_RUN_ONCE) at src/unix/core.c:294
#4 0x00007f1e875b2d90 in jl_run_once (loop=0x7f1e88551600 <default_loop_struct>) at jl_uv.c:103
#5 0x00007f1e85a06da9 in julia_process_events_17837 () at stream.jl:640
#6 0x00007f1e85a06a7a in julia_wait_17835 () at task.jl:298
#7 0x00007f1e85a0ceea in julia_wait_18013 () at task.jl:225
#8 0x00007f1e85a0c7f3 in julia_wait_readnb_18003 () at stream.jl:360
#9 0x00007f1e85a0c69d in julia_eof_18002 () at stream.jl:56
#10 0x00007f1e85a0c565 in julia_match_input_18001 () at LineEdit.jl:751
#11 0x00007f1e8750239d in jl_apply (f=0x7f1c8408ae30, args=0x7fff5f9c0600, nargs=5) at julia.h:1298
#12 0x00007f1e87506446 in jl_trampoline (F=0x7f1c8408ae30, args=0x7fff5f9c0600, nargs=5) at builtins.c:964
#13 0x00007f1e874f63e7 in jl_apply (f=0x7f1c8408ae30, args=0x7fff5f9c0600, nargs=5) at julia.h:1298
#14 0x00007f1e874fc127 in jl_apply_generic (F=0x7f1c8408abb0, args=0x7fff5f9c0600, nargs=5) at gf.c:1625
#15 0x00007f1e85a0c30d in julia_match_input_17996 () at LineEdit.jl:751
#16 0x00007f1e8750239d in jl_apply (f=0x7f1c8408adf0, args=0x7fff5f9c0a08, nargs=2) at julia.h:1298
#17 0x00007f1e87506446 in jl_trampoline (F=0x7f1c8408adf0, args=0x7fff5f9c0a08, nargs=2) at builtins.c:964
#18 0x00007f1e874f63e7 in jl_apply (f=0x7f1c8408adf0, args=0x7fff5f9c0a08, nargs=2) at julia.h:1298
#19 0x00007f1e874fc127 in jl_apply_generic (F=0x7f1c8408abb0, args=0x7fff5f9c0a08, nargs=2) at gf.c:1625
#20 0x00007f1e85a0e39d in julia_prompt!_18045 () at LineEdit.jl:1587
#21 0x00007f1e85a0fe10 in julia_run_interface_18080 () at LineEdit.jl:1561
#22 0x00007f1e85a0ffa0 in jlcall_run_interface_18080 () from /usr/local/julia-6a3c173633/lib/julia/sys.so
#23 0x00007f1e8750239d in jl_apply (f=0x7f1c8408a850, args=0x7fff5f9c0ca8, nargs=2) at julia.h:1298
#24 0x00007f1e87506446 in jl_trampoline (F=0x7f1c8408a850, args=0x7fff5f9c0ca8, nargs=2) at builtins.c:964
#25 0x00007f1e874f63e7 in jl_apply (f=0x7f1c8408a850, args=0x7fff5f9c0ca8, nargs=2) at julia.h:1298
#26 0x00007f1e874fc127 in jl_apply_generic (F=0x7f1c8408a770, args=0x7fff5f9c0ca8, nargs=2) at gf.c:1625
#27 0x00007f1e85a18fd9 in julia_run_frontend_18360 () at REPL.jl:841
#28 0x00007f1e85a17c82 in julia_run_repl_18331 () at REPL.jl:165
#29 0x00007f1e8750239d in jl_apply (f=0x7f1c83e8fc10, args=0x7fff5f9c1080, nargs=1) at julia.h:1298
#30 0x00007f1e87506446 in jl_trampoline (F=0x7f1c83e8fc10, args=0x7fff5f9c1080, nargs=1) at builtins.c:964
#31 0x00007f1e874f63e7 in jl_apply (f=0x7f1c83e8fc10, args=0x7fff5f9c1080, nargs=1) at julia.h:1298
#32 0x00007f1e874fc127 in jl_apply_generic (F=0x7f1c83e8fb50, args=0x7fff5f9c1080, nargs=1) at gf.c:1625
#33 0x00007f1e85a2b016 in julia__start_18860 () at client.jl:446
#34 0x00007f1e85a2b2c9 in jlcall__start_18860 () from /usr/local/julia-6a3c173633/lib/julia/sys.so
#35 0x00007f1e8750239d in jl_apply (f=0x7f1c84957090, args=0x0, nargs=0) at julia.h:1298
#36 0x00007f1e87506446 in jl_trampoline (F=0x7f1c84957090, args=0x0, nargs=0) at builtins.c:964
#37 0x00007f1e874f63e7 in jl_apply (f=0x7f1c84957090, args=0x0, nargs=0) at julia.h:1298
#38 0x00007f1e874fc127 in jl_apply_generic (F=0x7f1c84957030, args=0x0, nargs=0) at gf.c:1625
#39 0x0000000000401801 in jl_apply (f=0x7f1c84957030, args=0x0, nargs=0) at ../src/julia.h:1298
#40 0x00000000004027e4 in true_main (argc=0, argv=0x7fff5f9c14d0) at repl.c:454
#41 0x0000000000402b87 in main (argc=0, argv=0x7fff5f9c14d0) at repl.c:559
(gdb) up
#1 0x00007f1e875f5eea in uv__epoll_wait (epfd=<optimized out>, events=events@entry=0x7fff5f9bcfd0, nevents=nevents@entry=1024, timeout=timeout@entry=-1)
at src/unix/linux-syscalls.c:312
312 return syscall(__NR_epoll_wait, epfd, events, nevents, timeout);
(gdb) up
#2 0x00007f1e875f45d6 in uv__io_poll (loop=loop@entry=0x7f1e88551600 <default_loop_struct>, timeout=-1) at src/unix/linux-core.c:202
202 nfds = uv__epoll_wait(loop->backend_fd,
(gdb) up
#3 0x00007f1e875e7ea7 in uv_run (loop=0x7f1e88551600 <default_loop_struct>, mode=UV_RUN_ONCE) at src/unix/core.c:294
294 uv__io_poll(loop, timeout);
(gdb) up
#4 0x00007f1e875b2d90 in jl_run_once (loop=0x7f1e88551600 <default_loop_struct>) at jl_uv.c:103
103 return uv_run(loop,UV_RUN_ONCE);
(gdb) up
#5 0x00007f1e85a06da9 in julia_process_events_17837 () at stream.jl:640
640 stream.jl: No such file or directory.
(gdb) directory ~/src/julia/src
Source directories searched: /home/jeffw/src/julia/src:$cdir:$cwd
(gdb) list
635 stream.jl: No such file or directory.
(gdb) directory ~/src/julia/base
Source directories searched: /home/jeffw/src/julia/base:/home/jeffw/src/julia/src:$cdir:$cwd
(gdb) list
635 ccall(:jl_run_event_loop,Void,(Ptr{Void},),eventloop())
636 end
637 function process_events(block::Bool)
638 loop = eventloop()
639 if block
640 ccall(:jl_run_once,Int32,(Ptr{Void},),loop)
641 else
642 ccall(:jl_process_events,Int32,(Ptr{Void},),loop)
643 end
644 end
(gdb)
(gdb) cont
Continuing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment