microsoft / microsoft/vscode-cpptools

[Debugger] Breakpoints won't be hit

Open
#8,040 12 comments 0 reactions 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

Bug type: Debugger

Environment
I'm using vscode in remote mode. The client is macOS and the server is Linux.

  • OS and Version: Client: macOS big sur 11.5.1 (20G80), Server: Linux 3.10
  • VS Code Version: Version: 1.59.1, Commit: 3866c3553be8b268c8a7f8c0482c0c0177aa8bfa
  • C/C++ Extension Version: v1.6.0-insiders3

Description

I can set breakpoints in vscode UI, but when I launch a program to debug, the breakpoint is not activated and won't be hit.

I'm sure it's vscode's problem because the same breakpoint works well when I use the pure gdb command.

Since I only met this problem in my complicated huge project, and I can't reproduce it in simple projects. The only thing I can provide is the full trace log of the debugger.

In my case the breakpoint to be set is src/ray/rpc/test/grpc_server_test.cc:20, I've greped src/ray/rpc/test/grpc_server_test from the log, it is:

--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (1247) ->1011^done,bkpt={number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"0x0000000000047b58\",func=\"main(int, char**)\",file=\"src/ray/rpc/test/grpc_server_test.cc\",fullname=\"/proc/self/cwd/src/ray/rpc/test/grpc_server_test.cc\",line=\"157\",thread-groups=[\"i1\"],times=\"0\",original-location=\"main\"}\n"},"seq":118}
1: (1247) ->1011^done,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x0000000000047b58",func="main(int, char**)",file="src/ray/rpc/test/grpc_server_test.cc",fullname="/proc/self/cwd/src/ray/rpc/test/grpc_server_test.cc",line="157",thread-groups=["i1"],times="0",original-location="main"}
<--   C (setBreakpoints-4): {"command":"setBreakpoints","arguments":{"source":{"name":"grpc_server_test.cc","path":"/home/admin/lianxin.wlx/ray/src/ray/rpc/test/grpc_server_test.cc"},"lines":[],"breakpoints":[],"sourceModified":false},"type":"request","seq":4}
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (15148) ->=breakpoint-modified,bkpt={number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"<MULTIPLE>\",times=\"0\",original-location=\"main\"},{number=\"1.1\",enabled=\"y\",addr=\"0x000055555559bb58\",func=\"main(int, char**)\",file=\"src/ray/rpc/test/grpc_server_test.cc\",fullname=\"/proc/self/cwd/src/ray/rpc/test/grpc_server_test.cc\",line=\"157\",thread-groups=[\"i1\"]},{number=\"1.2\",enabled=\"y\",addr=\"0x00007ffff7dfca6f\",func=\"main(int, char**)\",file=\"external/com_google_googletest/googlemock/src/gmock_main.cc\",fullname=\"/proc/self/cwd/external/com_google_googletest/googlemock/src/gmock_main.cc\",line=\"48\",thread-groups=[\"i1\"]}\n"},"seq":598}
1: (15148) ->=breakpoint-modified,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="<MULTIPLE>",times="0",original-location="main"},{number="1.1",enabled="y",addr="0x000055555559bb58",func="main(int, char**)",file="src/ray/rpc/test/grpc_server_test.cc",fullname="/proc/self/cwd/src/ray/rpc/test/grpc_server_test.cc",line="157",thread-groups=["i1"]},{number="1.2",enabled="y",addr="0x00007ffff7dfca6f",func="main(int, char**)",file="external/com_google_googletest/googlemock/src/gmock_main.cc",fullname="/proc/self/cwd/external/com_google_googletest/googlemock/src/gmock_main.cc",line="48",thread-groups=["i1"]}
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (15172) ->=breakpoint-modified,bkpt={number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"<MULTIPLE>\",times=\"1\",original-location=\"main\"},{number=\"1.1\",enabled=\"y\",addr=\"0x000055555559bb58\",func=\"main(int, char**)\",file=\"src/ray/rpc/test/grpc_server_test.cc\",fullname=\"/proc/self/cwd/src/ray/rpc/test/grpc_server_test.cc\",line=\"157\",thread-groups=[\"i1\"]},{number=\"1.2\",enabled=\"y\",addr=\"0x00007ffff7dfca6f\",func=\"main(int, char**)\",file=\"external/com_google_googletest/googlemock/src/gmock_main.cc\",fullname=\"/proc/self/cwd/external/com_google_googletest/googlemock/src/gmock_main.cc\",line=\"48\",thread-groups=[\"i1\"]}\n"},"seq":600}
1: (15172) ->=breakpoint-modified,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="<MULTIPLE>",times="1",original-location="main"},{number="1.1",enabled="y",addr="0x000055555559bb58",func="main(int, char**)",file="src/ray/rpc/test/grpc_server_test.cc",fullname="/proc/self/cwd/src/ray/rpc/test/grpc_server_test.cc",line="157",thread-groups=["i1"]},{number="1.2",enabled="y",addr="0x00007ffff7dfca6f",func="main(int, char**)",file="external/com_google_googletest/googlemock/src/gmock_main.cc",fullname="/proc/self/cwd/external/com_google_googletest/googlemock/src/gmock_main.cc",line="48",thread-groups=["i1"]}
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (15236) ->~\"Breakpoint 1, main (argc=2, argv=0x7fffffffd098) at src/ray/rpc/test/grpc_server_test.cc:157\\n\"\n"},"seq":606}
1: (15236) ->~"Breakpoint 1, main (argc=2, argv=0x7fffffffd098) at src/ray/rpc/test/grpc_server_test.cc:157\n"
--> E (output): {"type":"event","event":"output","body":{"category":"stdout","output":"Breakpoint 1, main (argc=2, argv=0x7fffffffd098) at src/ray/rpc/test/grpc_server_test.cc:157\n"},"seq":608}
Breakpoint 1, main (argc=2, argv=0x7fffffffd098) at src/ray/rpc/test/grpc_server_test.cc:157
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (15236) ->&\"157\\tsrc/ray/rpc/test/grpc_server_test.cc: No such file or directory.\\n\"\n"},"seq":610}
1: (15236) ->&"157\tsrc/ray/rpc/test/grpc_server_test.cc: No such file or directory.\n"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (15236) ->*stopped,reason=\"breakpoint-hit\",disp=\"keep\",bkptno=\"1\",frame={addr=\"0x000055555559bb58\",func=\"main\",args=[{name=\"argc\",value=\"2\"},{name=\"argv\",value=\"0x7fffffffd098\"}],file=\"src/ray/rpc/test/grpc_server_test.cc\",fullname=\"/proc/self/cwd/src/ray/rpc/test/grpc_server_test.cc\",line=\"157\"},thread-id=\"1\",stopped-threads=\"all\",core=\"3\"\n"},"seq":612}
1: (15236) ->*stopped,reason="breakpoint-hit",disp="keep",bkptno="1",frame={addr="0x000055555559bb58",func="main",args=[{name="argc",value="2"},{name="argv",value="0x7fffffffd098"}],file="src/ray/rpc/test/grpc_server_test.cc",fullname="/proc/self/cwd/src/ray/rpc/test/grpc_server_test.cc",line="157"},thread-id="1",stopped-threads="all",core="3"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (15282) ->1017^done,threads=[{id=\"1\",target-id=\"Thread 0x7ffff30a9d40 (LWP 108917)\",name=\"grpc_server_tes\",frame={level=\"0\",addr=\"0x000055555559bb58\",func=\"main\",args=[{name=\"argc\",value=\"2\"},{name=\"argv\",value=\"0x7fffffffd098\"}],file=\"src/ray/rpc/test/grpc_server_test.cc\",fullname=\"/proc/self/cwd/src/ray/rpc/test/grpc_server_test.cc\",line=\"157\"},state=\"stopped\",core=\"3\"}],current-thread-id=\"1\"\n"},"seq":616}
1: (15282) ->1017^done,threads=[{id="1",target-id="Thread 0x7ffff30a9d40 (LWP 108917)",name="grpc_server_tes",frame={level="0",addr="0x000055555559bb58",func="main",args=[{name="argc",value="2"},{name="argv",value="0x7fffffffd098"}],file="src/ray/rpc/test/grpc_server_test.cc",fullname="/proc/self/cwd/src/ray/rpc/test/grpc_server_test.cc",line="157"},state="stopped",core="3"}],current-thread-id="1"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (15437) ->1019^done,stack=[frame={level=\"0\",addr=\"0x000055555559bb58\",func=\"main\",file=\"src/ray/rpc/test/grpc_server_test.cc\",fullname=\"/proc/self/cwd/src/ray/rpc/test/grpc_server_test.cc\",line=\"157\"}]\n"},"seq":2044}
1: (15437) ->1019^done,stack=[frame={level="0",addr="0x000055555559bb58",func="main",file="src/ray/rpc/test/grpc_server_test.cc",fullname="/proc/self/cwd/src/ray/rpc/test/grpc_server_test.cc",line="157"}]

The full log is :
dbg.log

To Reproduce
I'm sorry but I can't reproduce it in a simple project so I can't offer an example now. If you can't address this issue via logs. Please tell me, I'll try to provide my full project to you.

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 with the attached dbg.log and the setBreakpoints request for src/ray/rpc/test/grpc_server_test.cc:20, then compare the logged breakpoint locations and source paths with the reported remote macOS/Linux setup. Done means identifying why the breakpoint is not usable in this project and verifying a fix against the supplied scenario.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, vscode
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.