Remote Debugging

  • I tried to do some remote debugging with CDT but it doesn't work.


    The executable is copied over ssh to the target, but after that the program doesn't start.
    After some time I get the message: Connection timed out.


    Is it correct that normally the executable is called like this:
    gdbserver /tmp/myprogram .......


    As I can see, there is no gdbserver executable on the target system.

  • Ok,


    I found the gdbserver bin in /usr/local/arm/fs...*/debug-root/usr/bin/.
    After establishing a connection, the debugger stops at main() entry. But eclipse
    points to a completely different line in a header file. If I press continue and afterwards
    press the suspend button the debugger stops at the function pause() but says that the
    function is also in the same header at the same position as "main".


    The GDB shell says:
    No line 48 in file "../src/Base/svtimer.cpp".
    No line 729 in file "../src/Appl/telemaxmc.cpp".
    No line 615 in file "../src/Appl/telemaxmc.cpp".


    After asking google I got this:
    http://stackoverflow.com/quest…ough-the-file-has-the-lin


    I also checked that optimization is off and that debug symbols are generated -g.
    Any ideas?

  • Hello,


    what platform you are talking about?


    With multiplatform-linux-f+s-V2.0 (PicoMOD7A, NetDCU14 and armStoneA8) we provide Buildroot based RFS with gdbserver included.
    In MultiPlatform-Linux-FirstSteps.pdf document you will find information how to debug in chapter 13+14.

    F&S Elektronik Systeme GmbH
    As this is an international forum, please try to post in English.
    Da dies ein internationales Forum ist, bitten wir darum, Beiträge möglichst in Englisch zu verfassen.

  • I use a NetDCU14 with multiplatform-linux-f+s-V2.0.

    Quote

    I found the gdbserver bin in /usr/local/arm/fs...*/debug-root/usr/bin/.


    I also read the mentioned chapter 13+14.
    In chapter 14.6 there is is not described which gdb (on the local machine) should be used.
    I used the arm-linux-gdb from your toolchain directory....


    I also tried to debug directly on the target, but every function entry points to a line in a header file
    which doesn't make sense.

  • Hi,


    I wrote a small "Hello World" program to test if the debugger works correctly.
    Everything is fine and the program can be debugged over ethernet.
    Then I switched back to my project which is much bigger, but without success.


    I checked google and found some information about a buggy gdb (the version you use).


    I used you buildroot environment to generate my own toolchain with the newer version of
    GDB (7.4.1) and gcc (4.7.1). After recompiling the kernel, rootfs and installing it on the netdcu14
    I recompiled my application.
    And.... tadaaaa everything works as expected. Maybe you should update your toolchain to a newer gdb
    but I also know, no software is bug free.

  • What version of glibc do you use? When we made our toolchain, it was not possible to use a newer glibc, or busybox would not have compiled. In general it was a rather big effort of trial and fail, despite fact that we used crosstool-ng. So if you have a working combination, could you give us the settings, i.e. the versions of all participating packages (crosstool-ng, binutils, gcc, glibc, gdb, linux-headers, gmp, mpfr, ppl, CLooG/ppl, mpc) and the compile options? Thanks a lot.

    F&S Elektronik Systeme GmbH
    As this is an international forum, please try to post in English.
    Da dies ein internationales Forum ist, bitten wir darum, Beiträge möglichst in Englisch zu verfassen.

  • I didn't use crosstool-ng because I have no experience with that "tool". I switched to the buildroot toolchain which only supports uclibc. I don't need the big glibc for my
    project and for now no compatibility between different uclibc versions. I don't know if that meets your requirements but I attach the .config file of my buildroot (buildroot-2012.08-f+s-V2.0)
    it is based on your netdcu14_min_defconfig.


    [Update] No file upload support?

  • I can confirm problems while debugging with the delivered toolchain.


    The GDB shell says:
    No line 48 in file "xxxx.cpp".
    ...


    It's not possible to set breakpoints in the source code because the line information in the executable seems to be completely wrong. Also the first stop that should be at "main" is somewhere in the code.


    I have turned off all optimisations and tried different debug infos (-g2 -g ...).


    I tried gdb 6.8a and 7.4.1 provided by buildroot. The problem stays the same - so maybe it's a problem of the compiler/linker.

  • We have built a new toolchain, based on gcc-4.7.2. Please see here for the announcement. This toolchain can be combined with gdb-7.4.1, so debugging should work now.


    Your F&S Support Team

    F&S Elektronik Systeme GmbH
    As this is an international forum, please try to post in English.
    Da dies ein internationales Forum ist, bitten wir darum, Beiträge möglichst in Englisch zu verfassen.