In case I was not verbose enough pkgsrc is stripping debug symbols. disable this with INSTALL_UNSTRIPPED=yes, or debug the binaries in your work directory.
On Wed, Mar 30, 2016 at 10:44:45PM +0300, Andreas Gustafsson wrote: > Hi all, > > I'm trying to run Firefox under gdb on NetBSD 7.0/amd64, but I'm not > having much luck. > > I found a set of instructions at > > https://wiki.netbsd.org/tutorials/pkgsrc/debugging_firefox/ > > but when I follow them, gdb behaves stranegly, like being unable to > set a breakpoint in main(), and getting SIGTRAPs seemingly at random: > > $ /usr/pkgsrc/www/firefox/work/build/dist/bin $ ./run-mozilla.sh -g > ./firefox > [...] > (gdb) break main > Breakpoint 1 at 0x11be0: file > /usr/pkgsrc/www/firefox/work/firefox-45.0.1/browser/app/nsBrowserApp.cpp, > line 287. > (gdb) run > Starting program: /usr/pkgsrc/www/firefox/work/build/dist/bin/firefox > Error in re-setting breakpoint 1: Cannot access memory at address 0x11be0 > Error in re-setting breakpoint 1: Cannot access memory at address 0x11be0 > > Program received signal SIGTRAP, Trace/breakpoint trap. > 0x00007f7ff683c3ea in ?? () > (gdb) where > #0 0x00007f7ff683c3ea in ?? () > #1 0x00007f7ff78070f7 in ?? () > #2 0x0000000100000246 in ?? () > #3 0x00007f7ff7b8c400 in ?? () > #4 0x00007f7fdebfec70 in ?? () > #5 0x00007f7fee031a32 in ?? () > #6 0x00000001ffffffff in ?? () > #7 0x00007f7ff7b4a400 in ?? () > #8 0x0001000100000012 in ?? () > #9 0x0000000000000000 in ?? () > > And if I try to attach gdb to a running Firefox process, gdb seems to > think I'm trying to debug ld.elf_so: > > (gdb) attach 25976 > Attaching to program: /usr/pkg/bin/firefox, process 25976 > Reading symbols from /usr/libexec/ld.elf_so...(no debugging symbols > found)...done. > Loaded symbols for /usr/libexec/ld.elf_so > 0x00007f7ff689f65a in .rtld_start () from /usr/libexec/ld.elf_so > (gdb) where > #0 0x00007f7ff689f65a in .rtld_start () from /usr/libexec/ld.elf_so > #1 0x00007f7ff7808f2b in ?? () > #2 0x00007f7fc76ffb60 in ?? () > #3 0x00007f7fcd847a48 in ?? () > #4 0x00007f7fc76ffb40 in ?? () > #5 0x00007f7ff1d9a324 in ?? () > #6 0x0000000200000000 in ?? () > #7 0x00007f7ff5f8b4d8 in ?? () > #8 0x00000000c76ffbf0 in ?? () > #9 0x00007f7fcbd09360 in ?? () > #10 0x00007f7fc76ffba0 in ?? () > #11 0x00007f7fcc4bf7a0 in ?? () > #12 0x00007f7ffffeb118 in ?? () > #13 0x0000000000000000 in ?? () > > Any hints? > -- > Andreas Gustafsson, g...@gson.org --