From: Laszlo Papp <lpapp@kde.org>
To: gdb@sourceware.org
Subject: Debugging issue with gdbserver and a daemon on the target
Date: Tue, 19 Aug 2014 15:44:00 -0000 [thread overview]
Message-ID: <CAOMwXhPxtfv7f=akjpuTh+HNCGDeEm0vxen1Kp3pPco++gvuLg@mail.gmail.com> (raw)
Hi,
I am having a bit of difficult time to get a breakpoint hit on my
daemon. My setup is as follows:
== Target ==
gdbserver --attach 192.168.0.32:2345 pid-of-my-daemon
== Host ==
./tmp/sysroots/x86_64-linux/usr/bin/armv5te-foo-linux-gnueabi/cgdb -d
./tmp/sysroots/x86_64-linux/usr/bin/armv5te-foo-linux-gnueabi/arm-foo-linux-gnueabi-gdb
-s ./tmp/work/foo-foo-linux-gnueabi/foo-core-image-dbg/1.0-r0/rootfs/usr/bin/.debug/foo
-e ./tmp/work/foo-foo-linux-gnueabi/foo-core-image-dbg/1.0-r0/rootfs/usr/bin/foo
-q -ex set sysroot
./tmp/work/foo-foo-linux-gnueabi/foo-core-image-dbg/1.0-r0/rootfs -ex
tar rem192.168.0.1:2345
Reading symbols from
/home/lpapp/Projects/Yocto/poky-dylan-9.0.1/build/tmp/work/foo-foo-linux-gnueabi/foo-core-image-dbg/1.0-r0/rootfs/usr/bin/.debug/foo...done.
Remote debugging using 192.168.0.1:2345
Reading symbols from
./tmp/work/foo-foo-linux-gnueabi/foo-core-image-dbg/1.0-r0/rootfs/lib/librt.so.1...Reading
symbols from /home/lpapp/Projects/Yocto/poky-dylan-9.0.1/build/tmp/work/foo-foo-linux-gnueabi/foo-core-image-dbg/1.0-r0/root
fs/lib/.debug/librt-2.17.so...done.
done.
Loaded symbols for
./tmp/work/foo-foo-linux-gnueabi/foo-core-image-dbg/1.0-r0/rootfs/lib/librt.so.1
Reading symbols from
./tmp/work/foo-foo-linux-gnueabi/foo-core-image-dbg/1.0-r0/rootfs/lib/libpthread.so.0...Reading
symbols from /home/lpapp/Projects/Yocto/poky-dylan-9.0.1/build/tmp/work/foo-foo-linux-gnueabi/foo-core-image-dbg/1.0-r0
/rootfs/lib/.debug/libpthread-2.17.so...done.
done.
Loaded symbols for
./tmp/work/foo-foo-linux-gnueabi/foo-core-image-dbg/1.0-r0/rootfs/lib/libpthread.so.0
Reading symbols from
./tmp/work/foo-foo-linux-gnueabi/foo-core-image-dbg/1.0-r0/rootfs/lib/libgcc_s.so.1...Reading
symbols from /home/lpapp/Projects/Yocto/poky-dylan-9.0.1/build/tmp/work/foo-foo-linux-gnueabi/foo-core-image-dbg/1.0-r0/r
ootfs/lib/.debug/libgcc_s.so.1...done.
done.
Loaded symbols for
./tmp/work/foo-foo-linux-gnueabi/foo-core-image-dbg/1.0-r0/rootfs/lib/libgcc_s.so.1
Reading symbols from
./tmp/work/foo-foo-linux-gnueabi/foo-core-image-dbg/1.0-r0/rootfs/lib/libc.so.6...Reading
symbols from /home/lpapp/Projects/Yocto/poky-dylan-9.0.1/build/tmp/work/foo-foo-linux-gnueabi/foo-core-image-dbg/1.0-r0/rootf
s/lib/.debug/libc-2.17.so...done.
done.
Loaded symbols for
./tmp/work/foo-foo-linux-gnueabi/foo-core-image-dbg/1.0-r0/rootfs/lib/libc.so.6
Reading symbols from
./tmp/work/foo-foo-linux-gnueabi/foo-core-image-dbg/1.0-r0/rootfs/lib/ld-linux.so.3...Reading
symbols from /home/lpapp/Projects/Yocto/poky-dylan-9.0.1/build/tmp/work/foo-foo-linux-gnueabi/foo-core-image-dbg/1.0-r0/r
ootfs/lib/.debug/ld-2.17.so...done.
done.
Loaded symbols for
./tmp/work/foo-foo-linux-gnueabi/foo-core-image-dbg/1.0-r0/rootfs/lib/ld-linux.so.3
Reading symbols from
./tmp/work/foo-foo-linux-gnueabi/foo-core-image-dbg/1.0-r0/rootfs/lib/libnss_compat.so.2...Reading
symbols from /home/lpapp/Projects/Yocto/poky-dylan-9.0.1/build/tmp/work/foo-foo-linux-gnueabi/foo-core-image-dbg/1.0
-r0/rootfs/lib/.debug/libnss_compat-2.17.so...done.
done.
Loaded symbols for
./tmp/work/foo-foo-linux-gnueabi/foo-core-image-dbg/1.0-r0/rootfs/lib/libnss_compat.so.2
Reading symbols from
./tmp/work/foo-foo-linux-gnueabi/foo-core-image-dbg/1.0-r0/rootfs/lib/libnsl.so.1...Reading
symbols from /home/lpapp/Projects/Yocto/poky-dylan-9.0.1/build/tmp/work/foo-foo-linux-gnueabi/foo-core-image-dbg/1.0-r0/roo
tfs/lib/.debug/libnsl-2.17.so...done.
done.
Loaded symbols for
./tmp/work/foo-foo-linux-gnueabi/foo-core-image-dbg/1.0-r0/rootfs/lib/libnsl.so.1
0x44ad26ec in select () at ../sysdeps/unix/syscall-template.S:81
81 ../sysdeps/unix/syscall-template.S: No such file or directory.
(gdb) set debug remote 1
(gdb) b foo
Sending packet: $maa1c,4#23...Packet received: 030052e1
Sending packet: $maa1c,4#23...Packet received: 030052e1
Sending packet: $maa1c,4#23...Packet received: 030052e1
Breakpoint 1 at 0xaa1c: file foo.c, line 99.
Sending packet: $qTStatus#49...Packet received:
(gdb) c
Continuing.
Sending packet: $qTStatus#49...Packet received:
Sending packet: $Z0,aa1c,4#6c...Packet received:
Packet Z0 (software-breakpoint) is NOT supported
Sending packet: $maa1c,4#23...Packet received: 030052e1
Sending packet: $Xaa1c,0:#44...Packet received: OK
binary downloading supported by target
Sending packet: $Xaa1c,4:\001#10...Packet received: OK
Sending packet: $m449e80c8,4#d6...Packet received: 1eff2fe1
Sending packet: $X449e80c8,4:\001#c3...Packet received: OK
Sending packet:
$QPassSignals:e;10;14;17;1a;1b;1c;21;24;25;2c;4c;#5f...Packet
received: OK
Sending packet: $vCont?#49...Packet received: vCont;c;C;s;S;t
Packet vCont (verbose-resume) is supported
Program received signal SIGINT, Interrupt.
0x44ad26ec in select () at ../sysdeps/unix/syscall-template.S:81
81 in ../sysdeps/unix/syscall-template.S
(gdb) bt
#0 0x44ad26ec in select () at ../sysdeps/unix/syscall-template.S:81
#1 0x0002ac08 in bar (timeout=10, name=0x42f30 <yy_ec+56> "foo") at
src/socket.c:906
#2 0x0003284c in main (argc=0, argv=0x0) at src/bar.c:679
(gdb)
... And then I do some communication with the daemon where the foo
function is executed based on the logs, but the breakpoint is not hit.
I wished to try hardware breakpoints, but they are not presented on my
hardware.
Furthermore, if I use the same workflow on a binary that is
"one-shot", i.e. not running continuously as a daemon, the debugging
workflow for stopping at main works with exactly the aforementioned
software breakpoint issue.
I am completely clueless at this point. Do you know how I can debug a
daemon with gdbserver?
Cheers, L.
next reply other threads:[~2014-08-19 15:44 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-19 15:44 Laszlo Papp [this message]
2014-08-19 15:59 ` Pedro Alves
2014-08-19 16:02 ` Laszlo Papp
2014-08-19 16:12 ` Pedro Alves
2014-08-19 18:01 ` Laszlo Papp
2014-08-20 8:17 ` Pedro Alves
2014-08-20 8:25 ` Laszlo Papp
2014-08-20 8:36 ` Laszlo Papp
2014-08-20 8:39 ` Laszlo Papp
2014-08-20 9:10 ` Laszlo Papp
2014-08-20 9:11 ` Pedro Alves
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAOMwXhPxtfv7f=akjpuTh+HNCGDeEm0vxen1Kp3pPco++gvuLg@mail.gmail.com' \
--to=lpapp@kde.org \
--cc=gdb@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox