microsoft / microsoft/vscode-cpptools
Breakpoints are disabled on gdb attach and unable to pause on a running application
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 6.2k
- Forks
- 1.7k
- Avg merge
- 14h 46m
- Merged PRs (30d)
- 61
Description
Environment:
Running vscode on Mac
Linux in virtual machine
Launch.json
{
"type": "cppdbg",
"request": "attach",
"name": "engine - Attach",
"program": "${workspaceFolder}/install/bin/engine",
"processId": "${command:pickProcess}",
"logging": { "engineLogging": true, "traceResponse": true },
"sourceFileMap": { "${workspaceRoot}" : "${workspaceRoot}" },
},
Issue 1 : Breakpoints are disabled on gdb attach, Failure to add break points
When adding breakpoint after attach these messages are logged
Thread
--> E (output): {"type":"event","event":"output","body":{"category":"stdout","output":"1 \"engine\" received signal SIGTRAP, Trace/breakpoint trap.\n"},"seq":839}
1 "engine" received signal SIGTRAP, Trace/breakpoint trap.
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (231607) ->~\"0x00007f9bb1237c61 in __GI___clock_nanosleep (clock_id=clock_id@entry=0, flags=flags@entry=0, req=0x564c1ddf2010 <queue_get_sleep_time>, rem=0x0) at ../sysdeps/unix/sysv/linux/clock_nanosleep.c:48\\n\"\n"},"seq":841}
1: (231607) ->~"0x00007f9bb1237c61 in __GI___clock_nanosleep (clock_id=clock_id@entry=0, flags=flags@entry=0, req=0x564c1ddf2010 <queue_get_sleep_time>, rem=0x0) at ../sysdeps/unix/sysv/linux/clock_nanosleep.c:48\n"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (231607) ->~\"48\\tin ../sysdeps/unix/sysv/linux/clock_nanosleep.c\\n\"\n"},"seq":843}
1: (231607) ->~"48\tin ../sysdeps/unix/sysv/linux/clock_nanosleep.c\n"
--> E (output): {"type":"event","event":"output","body":{"category":"stdout","output":"0x00007f9bb1237c61 in __GI___clock_nanosleep (clock_id=clock_id@entry=0, flags=flags@entry=0, req=0x564c1ddf2010 <queue_get_sleep_time>, rem=0x0) at ../sysdeps/unix/sysv/linux/clock_nanosleep.c:48\n"},"seq":845}
0x00007f9bb1237c61 in __GI___clock_nanosleep (clock_id=clock_id@entry=0, flags=flags@entry=0, req=0x564c1ddf2010 <queue_get_sleep_time>, rem=0x0) at ../sysdeps/unix/sysv/linux/clock_nanosleep.c:48
--> E (output): {"type":"event","event":"output","body":{"category":"stdout","output":"48\tin ../sysdeps/unix/sysv/linux/clock_nanosleep.c\n"},"seq":847}
48 in ../sysdeps/unix/sysv/linux/clock_nanosleep.c
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (231607) ->*stopped,reason=\"signal-received\",signal-name=\"SIGTRAP\",signal-meaning=\"Trace/breakpoint trap\",frame={addr=\"0x00007f9bb1237c61\",func=\"__GI___clock_nanosleep\",args=[{name=\"clock_id\",value=\"0\"},{name=\"clock_id@entry\",value=\"0\"},{name=\"flags\",value=\"0\"},{name=\"flags@entry\",value=\"0\"},{name=\"req\",value=\"0x564c1ddf2010 <queue_get_sleep_time>\"},{name=\"rem\",value=\"0x0\"}],file=\"../sysdeps/unix/sysv/linux/clock_nanosleep.c\",fullname=\"./time/../sysdeps/unix/sysv/linux/clock_nanosleep.c\",line=\"48\",arch=\"i386:x86-64\"},thread-id=\"1\",stopped-threads=\"all\",core=\"1\"\n"},"seq":849}
1: (231607) ->*stopped,reason="signal-received",signal-name="SIGTRAP",signal-meaning="Trace/breakpoint trap",frame={addr="0x00007f9bb1237c61",func="__GI___clock_nanosleep",args=[{name="clock_id",value="0"},{name="clock_id@entry",value="0"},{name="flags",value="0"},{name="flags@entry",value="0"},{name="req",value="0x564c1ddf2010 <queue_get_sleep_time>"},{name="rem",value="0x0"}],file="../sysdeps/unix/sysv/linux/clock_nanosleep.c",fullname="./time/../sysdeps/unix/sysv/linux/clock_nanosleep.c",line="48",arch="i386:x86-64"},thread-id="1",stopped-threads="all",core="1"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (231607) <-1039-break-insert -f /home/usr1/src/app/validates.cc:1960\n"},"seq":851}
1: (231607) <-1039-break-insert -f /home/usr1/src/app/validates.cc:1960
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (231626) ->&\"No source file named /home/usr1/src/app/validates.cc.\\n\"\n"},"seq":853}
1: (231626) ->&"No source file named /home/usr1/src/app/validates.cc.\n"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (231626) ->1039^done,bkpt={number=\"13\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"<PENDING>\",pending=\"/home/usr1/src/app/validates.cc:1960\",times=\"0\",original-location=\"/home/usr1/src/app/validates.cc:1960\"}\n"},"seq":855}
1: (231626) ->1039^done,bkpt={number="13",type="breakpoint",disp="keep",enabled="y",addr="<PENDING>",pending="/home/usr1/src/app/validates.cc:1960",times="0",original-location="/home/usr1/src/app/validates.cc:1960"}
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (231626) ->(gdb)\n"},"seq":857}
1: (231626) ->(gdb)
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (231626) 1039: elapsed time 18\n"},"seq":859}
1: (231626) 1039: elapsed time 18
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (231627) Send Event AD7BreakpointErrorEvent\n"},"seq":861}
1: (231627) Send Event AD7BreakpointErrorEvent
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (231627) <--exec-continue\n"},"seq":863}
1: (231627) <--exec-continue
--> R (setBreakpoints-15): {"type":"response","request_seq":15,"success":true,"command":"setBreakpoints","body":{"breakpoints":[{"id":13,"verified":true,"line":1960,"BoundBreakpoints":[]},{"id":2,"verified":false,"message":"Module containing this breakpoint has not yet loaded or the breakpoint address could not be obtained.","line":1980,"BoundBreakpoints":[]}]},"seq":865}
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (231627) ->^running\n"},"seq":867}
1: (231627) ->^running
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (231627) ->*running,thread-id=\"all\"\n"},"seq":870}
1: (231627) ->*running,thread-id="all"
--> E (breakpoint): {"type":"event","event":"breakpoint","body":{"reason":"changed","breakpoint":{"id":13,"verified":false,"message":"Module containing this breakpoint has not yet loaded or the breakpoint address could not be obtained.","line":1960,"BoundBreakpoints":[]}},"seq":869}
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (231628) ->(gdb)\n"},"seq":873}
1: (231628) ->(gdb)
Issue 2 : unable to pause on a running application
On trying to pause I see this message
Could not load source './time/../sysdeps/unix/sysv/linux/clock_nanosleep.c': 'SourceRequest' not supported..
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the gdb attach scenario from the launch.json configuration and review the logged setBreakpoints, SIGTRAP, and pause behavior. Trace the handling of pending breakpoints and the SourceRequest error; done means breakpoints can be added after attach and a running application can be paused without the reported source-loading failure.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript, vscode
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100