microsoft / microsoft/vscode-cpptools

[Debugger] Breakpoints won't be hit

Aperta
#8,040 12 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

debugger more info needed
Lingua principale
TypeScript
Stelle
6.2k
Fork
1.7k
Merge medio
14h 46m
PR unite (30g)
61

Descrizione

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.

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia con il dbg.log allegato e la richiesta setBreakpoints per src/ray/rpc/test/grpc_server_test.cc:20, quindi confronta le posizioni dei breakpoint e i percorsi dei sorgenti registrati con la configurazione remota macOS/Linux segnalata. Il lavoro è completato quando viene identificato il motivo per cui il breakpoint non è utilizzabile in questo progetto e viene verificata una correzione con lo scenario fornito.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
cpp, vscode
Ambito
devtools
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
25/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.