From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5900 invoked by alias); 19 Aug 2014 15:44:50 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 5890 invoked by uid 89); 19 Aug 2014 15:44:49 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.1 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 X-HELO: mail-pd0-f180.google.com Received: from mail-pd0-f180.google.com (HELO mail-pd0-f180.google.com) (209.85.192.180) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Tue, 19 Aug 2014 15:44:47 +0000 Received: by mail-pd0-f180.google.com with SMTP id v10so9762440pde.25 for ; Tue, 19 Aug 2014 08:44:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:date:message-id:subject:from :to:content-type; bh=6xWRsXHflmlD1rZsHBHxCgdSP786oCLB/4lAoKKnbQc=; b=SNkFvMw8o2JV7H3JH+pkA51Y/baR9PHJXGb6LJB9ihZVUwkbPPRcJQq/NeEDhl7kOD wNdqVYtoWI5Y4ztWL3PDAaCDBFQrISgIpO3q9g4KG5YReyzVvsT5MmrgOcKjyFT0xgVf TYCWjphHjAPkbZNeIQeZkFjrEN6rXtAd8m1p8CEQrd0iC028OUQrB2DNoaosE8K2gYr6 qCLuhZkRhtpJU3yrbswwBWoPj+jdRQfoFZewAcfEa3KHDFT822SUTDgOozBac8F8VNMh QfKKLjfL3ReOnm7w90IQuyrzvp3ftffPRIPwFAqImKEFnAuR6oVeF6WayHWJN+b37uf9 cGqg== X-Gm-Message-State: ALoCoQlOqdqw/ZDx478SGEfs/XZi+UsIKdNXHH9fui9UkcE4M7oYh4XkC5+8N4YpHOdQNWyf80hZ MIME-Version: 1.0 X-Received: by 10.70.30.132 with SMTP id s4mr24406668pdh.96.1408463084346; Tue, 19 Aug 2014 08:44:44 -0700 (PDT) Received: by 10.70.57.136 with HTTP; Tue, 19 Aug 2014 08:44:44 -0700 (PDT) Date: Tue, 19 Aug 2014 15:44:00 -0000 Message-ID: Subject: Debugging issue with gdbserver and a daemon on the target From: Laszlo Papp To: gdb@sourceware.org Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2014-08/txt/msg00077.txt.bz2 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 "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.