31i73 / atom-dbg-gdb

An Atom package - A GDB debugger
https://atom.io/packages/dbg-gdb
MIT License
16 stars 10 forks source link

atom-dbg-gdb silently ignores all breakpoints #12

Closed nekromant closed 7 years ago

nekromant commented 7 years ago

On my setup (latest atom from ppa) and latest version of the plugin the gdb silently skips all breakpoints which is very annoying.

0 ✓ necromant @ invyl ~/Dev/software/aura2/build $ gdb --version
GNU gdb (Debian 7.7.1+dfsg-5) 7.7.1

Here's what I get from developer console:

dbg-gdb >  file-exec-and-symbols /home/necromant/Dev/software/aura2/build/test-xUSB-usb
dbg-gdb <  = thread-group-added Object {id: "i1"}
dbg-gdb <  = cmd-param-changed Object {param: "auto-load safe-path", value: "/"}
dbg-gdb <  ^ done Object {}
dbg-gdb >  file-exec-and-symbols /home/necromant/Dev/software/aura2/build/test-xUSB-usb
dbg-gdb <  = thread-group-added Object {id: "i1"}
dbg-gdb <  = cmd-param-changed Object {param: "auto-load safe-path", value: "/"}
dbg-gdb <  ^ done Object {}
dbg-gdb >  gdb-set mi-async on
dbg-gdb <  ^ error Object {msg: "No symbol "mi" in current context."}
dbg-gdb >  gdb-set target-async on
dbg-gdb <  ^ done Object {}
dbg-gdb >  break-insert /home/necromant/Dev/software/aura2/src/transports/transport-usb.c:586
dbg-gdb <  ^ error Object {msg: "No source file named /home/necromant/Dev/software/aura2/src/transports/transport-usb.c."}msg: "No source file named /home/necromant/Dev/software/aura2/src/transports/transport-usb.c."__proto__: Object
dbg-gdb >  exec-arguments 
dbg-gdb <  ^ done Object {}
dbg-gdb >  exec-run
dbg-gdb <  = thread-group-started Object {id: "i1", pid: "28149"}
dbg-gdb <  = thread-created Object {id: "1", group-id: "i1"}
dbg-gdb <  ^ running Object {}
dbg-gdb <  * running Object {thread-id: "all"}
dbg-gdb <  = library-loaded Object {id: "/lib64/ld-linux-x86-64.so.2", target-name: "/lib64/ld-linux-x86-64.so.2", host-name: "/lib64/ld-linux-x86-64.so.2", symbols-loaded: "0", thread-group: "i1"}
dbg-gdb <  = library-loaded Object {id: "linux-vdso.so.1", target-name: "linux-vdso.so.1", host-name: "linux-vdso.so.1", symbols-loaded: "0", thread-group: "i1"}
dbg-gdb <  = library-loaded Object {id: "/home/necromant/Dev/software/aura2/build/libaura.so.0.1.3", target-name: "/home/necromant/Dev/software/aura2/build/libaura.so.0.1.3", host-name: "/home/necromant/Dev/software/aura2/build/libaura.so.0.1.3", symbols-loaded: "0", thread-group: "i1"}
dbg-gdb <  = library-loaded Object {id: "/usr/lib/x86_64-linux-gnu/liblua5.2.so.0", target-name: "/usr/lib/x86_64-linux-gnu/liblua5.2.so.0", host-name: "/usr/lib/x86_64-linux-gnu/liblua5.2.so.0", symbols-loaded: "0", thread-group: "i1"}
dbg-gdb <  = library-loaded Object {id: "/lib/x86_64-linux-gnu/libusb-1.0.so.0", target-name: "/lib/x86_64-linux-gnu/libusb-1.0.so.0", host-name: "/lib/x86_64-linux-gnu/libusb-1.0.so.0", symbols-loaded: "0", thread-group: "i1"}
dbg-gdb <  = library-loaded Object {id: "/usr/lib/x86_64-linux-gnu/libevent-2.0.so.5", target-name: "/usr/lib/x86_64-linux-gnu/libevent-2.0.so.5", host-name: "/usr/lib/x86_64-linux-gnu/libevent-2.0.so.5", symbols-loaded: "0", thread-group: "i1"}
dbg-gdb <  = library-loaded Object {id: "/usr/lib/x86_64-linux-gnu/libstlink.so.1", target-name: "/usr/lib/x86_64-linux-gnu/libstlink.so.1", host-name: "/usr/lib/x86_64-linux-gnu/libstlink.so.1", symbols-loaded: "0", thread-group: "i1"}
dbg-gdb <  = library-loaded Object {id: "/lib/x86_64-linux-gnu/librt.so.1", target-name: "/lib/x86_64-linux-gnu/librt.so.1", host-name: "/lib/x86_64-linux-gnu/librt.so.1", symbols-loaded: "0", thread-group: "i1"}
dbg-gdb <  = library-loaded Object {id: "/lib/x86_64-linux-gnu/libm.so.6", target-name: "/lib/x86_64-linux-gnu/libm.so.6", host-name: "/lib/x86_64-linux-gnu/libm.so.6", symbols-loaded: "0", thread-group: "i1"}
dbg-gdb <  = library-loaded Object {id: "/lib/x86_64-linux-gnu/libpthread.so.0", target-name: "/lib/x86_64-linux-gnu/libpthread.so.0", host-name: "/lib/x86_64-linux-gnu/libpthread.so.0", symbols-loaded: "0", thread-group: "i1"}
dbg-gdb <  = library-loaded Object {id: "/lib/x86_64-linux-gnu/libc.so.6", target-name: "/lib/x86_64-linux-gnu/libc.so.6", host-name: "/lib/x86_64-linux-gnu/libc.so.6", symbols-loaded: "0", thread-group: "i1"}
dbg-gdb <  = library-loaded Object {id: "/lib/x86_64-linux-gnu/libdl.so.2", target-name: "/lib/x86_64-linux-gnu/libdl.so.2", host-name: "/lib/x86_64-linux-gnu/libdl.so.2", symbols-loaded: "0", thread-group: "i1"}
dbg-gdb <  = library-loaded Object {id: "/lib/x86_64-linux-gnu/libudev.so.1", target-name: "/lib/x86_64-linux-gnu/libudev.so.1", host-name: "/lib/x86_64-linux-gnu/libudev.so.1", symbols-loaded: "0", thread-group: "i1"}
dbg-gdb <  = thread-created Object {id: "2", group-id: "i1"}
dbg-gdb <  * running Object {thread-id: "all"}

It looks that for some reason it can't find the source file, although the path to the source file is absolutely correct.

ProPuke commented 7 years ago

Hi nekromant

This error from gdb indicates there isn't any debug info that references that file path inside the executable you're debugging. This could be because paths were changed after the executable was built, or this file was part of a separate statically built library or complication step, which did not include debug info for that path.

Check you're compiling every file with debug info (-g) included

ProPuke commented 7 years ago

Info like this should definitely be communicated back to the user in some way: "btw, these breakpoints you've added aren't found inside the current executable!"

I've not decided the best way of doing this yet. I could show a notification outlining this, but these messages would be redundant if you have multiple debuggable executables within the same project - You wouldn't want an error showing your server/foo breakpoints not being valid, if you're currently debugging the client executable in the current project, and not the server one. It could often be intentional that some breakpoints aren't available, depending on what the user is debugging.

nekromant commented 7 years ago

@ProPuke Yep, you're right. I had a problem with my .atom-build not having the correct BUILD_TYPE and being in a terrible rush. Sorry for bothering. Still, think an optional popup window with a warning if no breakpoints were registered would be nice. Thanks for your hard work!