[SOLVED] Thread Awareness for JLinkGDBServer

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • Hi,

    Thread awareness for GDB Server is on our todo, but there is currently no fixed schedule for this.
    The Thread awareness in GDB Server will somehow be plugable, so you can provide the required RTOS information via a file.

    Best regards
    Johannes
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • Hi,

    In general, GDB is rather dumb as it has no information of the target system when remote debugging.

    OpenOCD and GDB Server are similar, they are the remote server GDB connects to.
    And GDB requests the thread information from them.
    In detail it is a bit more complex, but that's on another topic.

    Regards
    Johannes
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • The new beta of JLinkGDBServer just got released with the support for Thread Awareness:

    - GDBServer: Implemented support for thread debugging
    with RTOS by using a plug-in

    The manual says there is a plugin needed:
    RTOS plug-ins for embOS and FreeRTOS are available from our website: segger.com/jlink-software.html.
    my problem: I cant't find the plugin on the stated website.

    where to get it ?

    thank you very much!
  • Hi,

    sorry for the delay in response.
    Unfortunately, the manual is incorrect about this at the moment.
    The plugins are not available on the website, but will be included in the next version of the J-Link software,
    which is scheduled for release tomorrow evening or Monday.

    Best regards,
    Niklas
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • I've installed the latest beta and my command line to load the FreeRTOS plugin. Are there any modifications for FreeRTOS that need to be made to enable support? I see in my console out that the dll was loaded properly, but when I pause execution, I only see the one thread.
  • Most probably the plugin does not find all the required symbols.
    There was a change in FreeRTOS, that eliminated a mandatory symbol.

    In this case, you should see something like this in your console:

    Source Code

    1. Received symbol: pxCurrentTCB (1FFF6E0C)
    2. Received symbol: pxReadyTasksLists (1FFF6E10)
    3. Received symbol: xDelayedTaskList1 (1FFF6E88)
    4. Received symbol: xDelayedTaskList2 (1FFF6E9C)
    5. Received symbol: pxDelayedTaskList (1FFF6EB0)
    6. Received symbol: pxOverflowDelayedTaskList (1FFF6EB4)
    7. Received symbol: xPendingReadyList (1FFF6EB8)
    8. Received symbol: xTasksWaitingTermination (00000000)
    9. Received symbol: xSuspendedTaskList (1FFF6ECC)
    10. Received symbol: uxCurrentNumberOfTasks (1FFF6EE4)
    11. Received symbol: uxTopUsedPriority (00000000)
    12. ERROR: Received mandatory symbol not found.
    Display All


    You can use the same patch as for OpenOCD to reintroduce the missing symbol:

    github.com/gnuarmeclipse/openo…elpers/FreeRTOS-openocd.c
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • could you please print what symbol the rtos plugin is missing?

    edit:
    I'm using the FreeRTOS plugin, but embOS symbols are requested:


    C Source Code

    1. Received symbol: OS_Global (00000000)
    2. ERROR: Received mandatory symbol not found.


    these are the parameters to run JLinkGDBServer:

    C Source Code

    1. ./JLinkGDBServer -if swd -device STM32F429VG -endian little -speed 1000 -port 2331 -swoport 2332 -telnetport 2333 -vd -ir -localhostonly 1 -strict -timeout 0 -nogui -rtos GDBServer/RTOSPlugin_FreeRTOS.so

    The post was edited 1 time, last by pruesch ().

  • Hi,

    it is the last received symbol "uxTopUsedPriority", return value NULL means it is not found.
    I already have changed the error message in the console to a more informative one.

    If your console output (starting with the first "Received symbol") is different, please post it here.

    Best regards
    Arne
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • Hi Arne,

    please see my edited post above

    BR

    strings like "pxCurrentTCB" and other symbols are not part of the RTOSPlugin_FreeRTOS.so but contained in the windows dll.
    maybe there is something missing :)

    The post was edited 1 time, last by pruesch ().

  • Hi,

    there was a problem within the build process causing both plug-ins to be identical in the linux and OSX builds.
    This will be fixed in the next release.

    I assume, you are using linux, right?
    Please find attached the correctly build plug-in.

    Best regards,
    Arne
    Files
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • yes, we are using Linux (more specific CentOS 6.7)

    thank you very much for your super fast reply and the patched library! the plugin works now!


    I 'm back to the usual eclipse trouble when it comes to displaying the call stacks of various threads :(

    The post was edited 1 time, last by pruesch ().

  • Hi,

    good to hear that is working now.

    I have also experienced lots of trouble with building the call stack in eclipse while developing the plug-ins.

    Unfortunately there is nothing I can do, because this is completely done inside eclipse and the GDB server only sees some "read memory" instructions while eclipse is building the call stack.

    Best regards,
    Arne
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • yes, eclipse, even the mars.2 release, is far from perfect.

    I noticed that the full call stacks appear again if you switch the perspective to c/c++ and back to debug.
    what issues did you experience? were you able to find workarounds for some of them?



    I'm really happy that you decided to implement thread awareness into your gdb server. It's also very nice that you support OSX and Linux! Your competitors don't seem to understand that need :)
    This confirms our conviction to have made the right decision to use segger tools now and in the future :thumbup:
  • Hi,

    there were many different issues. Missing/empty lines in the call stack, registers disappeared from the registers pane up to complete crash of eclipse.

    You could try another IDE as a workaround, for example our own IDE Embedded Studio. It is available free of charge for non-profit educational purposes, supports Windows, Linux and Mac OSX and has an interface for viewing threads, too.

    Best regards,
    Arne
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • SEGGER - Arne wrote:

    Most probably the plugin does not find all the required symbols.
    There was a change in FreeRTOS, that eliminated a mandatory symbol.

    In this case, you should see something like this in your console:

    Source Code

    1. Received symbol: pxCurrentTCB (1FFF6E0C)
    2. Received symbol: pxReadyTasksLists (1FFF6E10)
    3. Received symbol: xDelayedTaskList1 (1FFF6E88)
    4. Received symbol: xDelayedTaskList2 (1FFF6E9C)
    5. Received symbol: pxDelayedTaskList (1FFF6EB0)
    6. Received symbol: pxOverflowDelayedTaskList (1FFF6EB4)
    7. Received symbol: xPendingReadyList (1FFF6EB8)
    8. Received symbol: xTasksWaitingTermination (00000000)
    9. Received symbol: xSuspendedTaskList (1FFF6ECC)
    10. Received symbol: uxCurrentNumberOfTasks (1FFF6EE4)
    11. Received symbol: uxTopUsedPriority (00000000)
    12. ERROR: Received mandatory symbol not found.
    Display All


    You can use the same patch as for OpenOCD to reintroduce the missing symbol:

    github.com/gnuarmeclipse/openo…elpers/FreeRTOS-openocd.c
    This worked! Thanks for the help!