Debugging xDot with Eclipse (GDB/openOCD)

Home Forums mDot/xDot Debugging xDot with Eclipse (GDB/openOCD)

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #16158
    Matt Briggs
    Participant

    I have been trying to configure a workable toolchain on windows for debugging xDot programs. I have had spotty success and need help filling in the gaps.

    Tutorials followed:
    https://developer.mbed.org/teams/MultiTech/wiki/Using-Eclipse-and-mbed-5-for-MTS-Devices
    https://developer.mbed.org/teams/MultiTech/wiki/debugging-mDot-MTQ-via-command-line#introduction
    ===
    importing Dot-Examples:
    Building, Uploading, and Viewing debug serial output but not debugging (e.g. stepping through code).
    Using Dot-Examples with libxDot-mbed5

    Project setup:
    mbed import https://developer.mbed.org/teams/MultiTech/code/Dot-Examples/
    mbed add https://developer.mbed.org/teams/MultiTech/code/libxDot-mbed5/

    Observations:
    –profile option does not work with mbed-os 5.1 trying to use -o debug-info to get symbols (Suspect this is where the problem is).
    ===
    Creating new mbed porject:
    Initially started this way since it best followed eclipse tutorial.

    Project setup:
    mbed new testProj
    cd testProj
    # Manually copy selected code
    mbed add https://developer.mbed.org/teams/MultiTech/code/libxDot-dev-mbed5/

    Observations:
    Everything compiles and debugs fine using –profile with mbed-os 5.2. Just hesitant to use the -dev- library for the product I am using. If I use the stable version of the library I get a hard fault with any call to dot class methods such as getInstance().
    ===
    I would like to have a project which I can use the stable version of the xDot’s libraries but be able debug the software using a eclipse toolchain.

    #16159
    Mike Fiore
    Blocked

    Matt,

    Please note that libxDot-mbed5 and libxDot-dev-mbed5 are not generated with debug symbols, so you won’t be able to step through any calls into the library.

    For mbes-os-5.1.x, you’ll use the “-o debug-info” option to generate debug symbols instead of the “–profile …” option. If you’re going to use the production build of libxDot, you’ll need to use the version of mbed-os that matches the comments in the libxDot-mbed5 commit message. For revision 7 (the latest ATM), you’d use mbed-os-5.1.5. Using other versions of mbed-os might cause problems.

    Does that configuration work for you?

    One thing you can do to make sure Eclipse configuration isn’t the problem is to build and debug from the command line instead of through Eclipse. Once you have that working, then go back and get it working in Eclipse.

    Cheers,

    Mike

    #16169
    Matt Briggs
    Participant

    Hey Mike,

    I took me a while to get gdb working from command line but I was able to get the xdot stable libraries to build/debug. Importing the Dot-Examples project via the mbed-cli does I believe get the correct mbed-os version 5.1.5. The only version I could find within the library was a macro “#define MBED_LIBRARY_VERSION 127”.

    For other’s reference what worked for me was removing the command below in eclipse after that debugging does appear to work fine with stable versions of xDot libraries.

    
    "set mem inaccessible-by-default off" remove from GDB command in eclipse
    

    Thanks for help,

    • This reply was modified 7 years, 4 months ago by Matt Briggs.
Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.