microsoft / vscode-cpptools

Official repository for the Microsoft C/C++ extension for VS Code.
Other
5.45k stars 1.53k forks source link

GDB remote breakpoint not behaving as expected since 0.18.0 #2538

Open bewster opened 5 years ago

bewster commented 5 years ago

Type: Debugger

Describe the bug

After updating to the latest extension I am unable to use the debugger. The breakpoint is hit; but the UI doesn't do anything. "Continue" has no effect. Can "stop" debugging.

If I set stopAtEntry to false. App runs but "Pause" has no effect.

To Reproduce Steps to reproduce the behavior:

  1. Build and deploy application.
  2. Start gdbserver on remote host.
  3. Start Debugging.

Additional context The debugee is an embedded arm device running Debian Wheezy and "GNU gdbserver (GDB) 7.4.1-debian".

The cross-compiler and gdb is also "old".

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "",
            "type": "cppdbg",
            "request": "launch",
            "program": "${workspaceRoot}/app",
            "miDebuggerServerAddress": "device:9091",
            "args": [],
            "stopAtEntry": true,
            "cwd": "${workspaceRoot}",
            "environment": [],
            "externalConsole": true,
            "linux": {
                "MiMode": "gdb",
                "miDebuggerPath": "/opt/arm-fsl-linux-gnueabi/bin/arm-fsl-linux-gnueabi-gdb"
                "logging": {
                    "engineLogging": true
                }
            }
        }
    ]
}

If I revert to any previous 0.17.x version of the extension breakpoints work.

My initial pass over the engine logging the only difference I see, prior to the breakpoint-hit is the addition of -f when setting the breakpoint.

-break-insert -f main

WardenGnaw commented 5 years ago

Can you share your engineLogging the includes hititng continue?

AmeyaVS commented 3 years ago

I have similar issue, it seems the cpp debug interface automatically configures the main function as a breakpoint. How can I disable the main function from being added to the debugger by default? Basically I want to remove the default breakpoint being added to the debugger: Here is a snapshot from the debug console. -break-insert -f main Getting the following error message from GDB:

ERROR: Unable to start debugging. Unexpected GDB output from command "-exec-run". Warning:
Cannot insert breakpoint 1.
Cannot access memory at address <0x30c0>.

I even have the launch.json configured as below:

...
"stopAtEntry": false
...

But I still see the: -break-insert -f main breakpoint to function being configured in GDB in the Debug Console.