[ABANDONED] GDB Server closes connection while watching a string_view

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

  • [ABANDONED] GDB Server closes connection while watching a string_view

    Hi together!

    I came across with a supposedly GDB server problem while watching string_view`s in VSCode for windows.

    Conditions for this issue:
    • Windows 10
    • VSCode
    • JLink Base 10.1
    • Cortex A5


    Problem description ?(
    Debugging works fine until i stop at an code area where string_views are used. Do i stop at an string_view related area the debugging is stopped by the GDB Server. There are no exceptions at all and the code runs fine without debugging. The last message of GDB Server is just a common close message "GDB Server closed connection".

    No issues with Linux :thumbsup:
    I double checked with almost the same conditions under Linux Mint with same VSCode launch settings, same Debugger and everything worked fine.

    My colleagues and me are working with Linux and Windows and i am trying to find a solution for my windows mates :)

    Maybe some one got an idea, would be nice.

    Thank you :)
  • Hi,

    Pretty sure that if you generate a log file:
    wiki.segger.com/Enable_J-Link_log_file#J-Link_GDB_Server
    you will see that GDB Server shutdowns gracefully but gets a close request from GDB before.
    This indicates that GDB Server shutdowns gracefully and not crashes but it only shutdowns because GDB asked it to do it, by disconnecting from it (which indicates the end of a debug session)

    There are 3 major components involved here:
    1) VSCode
    2) GDB (part of the GCC toolchain you are using to compile + debug)
    3) GDB Server (from SEGGER)

    My guess:
    GDB either exists or crashes when trying to evaluate the "string_view".
    What happens is:
    VSCode wants to visualize the variable view etc. and asks GDB for information about the variable (type, current value, address, ...)
    GDB passes a "read from address" command to GDB Server to get the current value of the variable.
    This is done by SEGGER GDB Server and then it is out. The rest is up to GDB + VSCode here.

    Why you are not seeing this under Linux:
    Maybe you use a different version of the GCC toolchain?
    Maybe a new one that does not experience the crash / GDB internal problem when resolving the variable info.
    Hard to say.

    Long story short:
    Does not look like a GDB Server / J-Link problem to me.
    But we can confirm if you can provide a log file.


    BR
    Alex
    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.