Skip to content

debugServerPath is not used in 1.1.0-insiders3 if miDebuggerServerAddress is not specified #6411

Description

I have similar (or same) situation with exception that it all worked with C/C++ Extension Version v1.0.1 and stop working in v1.1.0-insiders3.

With launch.json below, this is (valid) behavior that I observe with v1.0.1 (in windows):

  • jlinkgdbserverstart.bat is executed (debugServerPath) and I can see jlink server instance running in windows
  • arm-none-eabi-gdb.exe (miDebuggerPath) attach (connect) to jlink debug server
  • setupCommands are sent to target device
  • debug working in vscode
  • gdb link with jlink server is disconnected on debug stop

With v1.1.0-insiders3:

  • jlinkgdbserverstart.bat is not executed (debugServerPath)
    If I add "miDebuggerServerAddress": "localhost:2331" then debugServerPath is executed but then miDebuggerPath is not used.

It seams like behavior change is introduced in MIEngine with microsoft/MIEngine#1056 (It's just a guess based on not to deep digging).

{
    "version": "0.2.0", 
    "configurations": [
        {
            "name": "[MCU/GDB] Debug/JLink", 
            "type": "cppdbg", 
            "request": "launch", 
            "program": "${workspaceRoot}/build/${workspaceFolderBasename}.elf", 
            "windows": {
                "miDebuggerPath": "C://toolchain//gnu//arm-none-eabi-gdb.exe", 
                "debugServerPath": "${workspaceRoot}/jlinkgdbserverstart.bat", 
                "externalConsole": true
            }, 
            "linux": {
                "miDebuggerPath": "/usr/local/gcc-arm-none-eabi/bin/arm-none-eabi-gdb", 
                "debugServerPath": "${workspaceRoot}/jlinkgdbserverstart.sh", 
                "externalConsole": false
            }, 
            "stopAtEntry": true, 
            "cwd": "${workspaceRoot}", 
            "environment": [], 
            "MIMode": "gdb", 
            "miDebuggerArgs": "--cd=${workspaceRoot}", 
            "setupCommands": [
                ... my specific gdb commands to load firmware to arm target etc...
            ],
            "preLaunchTask": "[Misc][Debug] Create JLink GDB server script"
        }
    ]
}

jlinkgdbserverstart.bat -> this is generated with preLaunchTask [Misc][Debug] Create JLink GDB server script. Example of content is:
JLinkGDBServerCL -singlerun -select USB=440150122 -device EFM32GG380F512 -endian little -if SWD -speed 4000 -i


Originally from Luka234

Activity

  1. WardenGnaw commented on Oct 29, 2020

    @WardenGnaw
    MemberAuthor

    Luka234 Thank you for reporting this and using insiders.

    There seems to be a bug that in json that it checks to see if launchOptions.MiDebuggerServerAddress for debugServerPath configuraiton.

    https://github.com/microsoft/MIEngine/blob/728f403c563c2c50c46542e9b44271a7f8d5895b/src/MICore/LaunchOptions.cs#L447

  2. WardenGnaw commented on Oct 29, 2020

    @WardenGnaw
    MemberAuthor
  3. changed the title [-]debugServerPath is not used in 1.1.0-insiders3[/-] [+]debugServerPath is not used in 1.1.0-insiders3 if miDebuggerServerAddress is not specified[/+] on Oct 29, 2020
  4. added
    fixedCheck the Milestone for the release in which the fix is or will be available.
    on Oct 30, 2020
  5. andrewleech commented on Nov 4, 2020

    @andrewleech

    I had this same issue in 1.1.0-insiders3 and can confirm that it's resolved for me in 1.1.0-insiders4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugdebuggerfixedCheck the Milestone for the release in which the fix is or will be available.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions