microsoft / microsoft/vscode-cpptools

expression breakpoint not working as expected

Open
#9,503 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

debugger more info needed
Dominant language
TypeScript
Stars
6.2k
Forks
1.7k
Avg merge
14h 46m
Merged PRs (30d)
61

Description

Environment
  • OS and version: Ubuntu 20.04.4 LTS
  • VS Code: 1.68.0
  • C/C++ extension: 1.10.7
  • OS and version of remote machine (if applicable): both on local linux and remote to linux(from mac or win),but local mac and win is working as expected
  • GDB / LLDB version:9.2
Bug Summary and Steps to Reproduce

Bug Summary:
If I use expression breakpoint and expression contains strcmp, when this breakpoint is hit, gdb will crash unexpectedly
image

Steps to reproduce:

  1. Only on Linux environment(both local and remote to it via remote-ssh), it works well on local windows environment
  2. Just a demo project will reproduce this issue

Besides, if I don't use strcmp and just set very simple expression like 1==1, breakpoint will be hit successfully and there's no error.

Sorry to let you guys work on this, looking forward to your reply.

Debugger Configurations
{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "C++ Launch",
            "type": "cppdbg",
            "request": "launch",
            "program": "${workspaceFolder}/${fileBasenameNoExtension}.exe",
            "stopAtEntry": false,
            "cwd": ".",
            "launchCompleteCommand": "exec-run",
            "linux": {
                "MIMode": "gdb",
                "miDebuggerPath": "/usr/bin/gdb"
            },
            "preLaunchTask": "default compile",
            "externalConsole": false
        }
    ]
}
Debugger Logs
Loaded '/lib64/ld-linux-x86-64.so.2'. Symbols loaded.

Breakpoint 1, main () at /home/eric/Dev/c-test/test.c:5
5	{
Loaded '/lib/x86_64-linux-gnu/libc.so.6'. Symbols loaded.
ERROR: GDB exited unexpectedly. Debugging will now abort.
The program '/home/eric/Dev/c-test/test.exe' has exited with code -1 (0xffffffff).
Other Extensions

Other extensions have been disabled when I test on this

Additional Information

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the failure from test.c with the supplied launch configuration on Linux using GDB 9.2, comparing an expression containing strcmp with 1==1. Use the debugger log to determine why GDB exits unexpectedly; done means the failing expression breakpoint no longer aborts debugging and the behavior is covered by a regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, vscode
Domain
devtools, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.