Type: Debugger
i want to debug child process created by fork() and i use "-exec set follow-fork-mode child" before the fork() is called, but i found it doesn't work at all, it can't hit any break point in child process. Then i use the simple program in #511 to test, not work too.The answer in #511 doesn't work too.( "setupCommands": [
{"text": "-gdb-set follow-fork-mode child"}
])
simple program that i use to test(see #511):
int main()
{
pid_t pid = fork();
if (pid != 0) {
printf("Main process\n");
} else {
printf("Forked process\n");
}
return 0;
}
launch.json:
{
"version": "0.2.0",
"configurations": [
{
"name": "(gdb) Launch",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/a.out",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": true,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
}
]
}
build task:
{
"version": "2.0.0",
"tasks": [
{
"label": "forktest compile task",
"type": "shell",
"command": "gcc -g forktest.c",
"group": {
"kind": "build",
"isDefault": true
}
}
],
}
here is debug console output:
=thread-group-added,id="i1"
GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-110.el7
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
For bug reporting instructions, please see:
http://www.gnu.org/software/gdb/bugs/.
Warning: Debuggee TargetArchitecture not detected, assuming x86_64.
=cmd-param-changed,param="pagination",value="off"
Loaded '/lib64/ld-linux-x86-64.so.2'. Symbols loaded.
Loaded '/lib64/libc.so.6'. Symbols loaded.
Execute debugger commands using "-exec
-exec set follow-fork-mode child
=cmd-param-changed,param="follow-fork-mode",value="child"
=thread-group-added,id="i2"
[New process 24823]
[Switching to process 24823]
Yes, actually the breakpoint is hit in my case (according to DEBUG CONSOLE), but VSCode UI is not reacting on attaching and detaching of child process with actual breakpoint.
@msvaillant I can confirm I get the same result too, breakpoint is hit (and thus execution is stopped) but the UI does not react.
I have tested on 1.32.0-insider (2e4d4a6bb16a65303b460795fa4ac734f9aea43e) and 1.31.1 (1b8e8302e405050205e69b59abb3559592bb9e60)
I have attached a full engine log below:
--> E (output): {"event":"output","body":{"category":"console","output":"1: (140) LaunchOptions<LocalLaunchOptions xmlns='http://schemas.microsoft.com/vstudio/MDDDebuggerOptions/2014'\n"},"seq":2,"type":"event"}
1: (140) LaunchOptions<LocalLaunchOptions xmlns='http://schemas.microsoft.com/vstudio/MDDDebuggerOptions/2014'
--> E (output): {"event":"output","body":{"category":"console","output":"1: (149) LaunchOptions ExePath='/home/stje/test/testdbg/a.out'\n"},"seq":4,"type":"event"}
1: (149) LaunchOptions ExePath='/home/stje/test/testdbg/a.out'
--> E (output): {"event":"output","body":{"category":"console","output":"1: (149) LaunchOptions WorkingDirectory='/home/stje/test/testdbg'\n"},"seq":6,"type":"event"}
1: (149) LaunchOptions WorkingDirectory='/home/stje/test/testdbg'
--> E (output): {"event":"output","body":{"category":"console","output":"1: (150) LaunchOptions ExeArguments=''\n"},"seq":8,"type":"event"}
1: (150) LaunchOptions ExeArguments=''
--> E (output): {"event":"output","body":{"category":"console","output":"1: (150) LaunchOptions MIMode='gdb'\n"},"seq":10,"type":"event"}
1: (150) LaunchOptions MIMode='gdb'
--> E (output): {"event":"output","body":{"category":"console","output":"1: (150) LaunchOptions MIDebuggerPath=''\n"},"seq":12,"type":"event"}
1: (150) LaunchOptions MIDebuggerPath=''
--> E (output): {"event":"output","body":{"category":"console","output":"1: (150) LaunchOptions WaitDynamicLibLoad='false'\n"},"seq":14,"type":"event"}
1: (150) LaunchOptions WaitDynamicLibLoad='false'
--> E (output): {"event":"output","body":{"category":"console","output":"1: (151) LaunchOptions>\n"},"seq":16,"type":"event"}
1: (151) LaunchOptions>
--> E (output): {"event":"output","body":{"category":"console","output":"1: (151) LaunchOptions <SetupCommands>\n"},"seq":18,"type":"event"}
1: (151) LaunchOptions <SetupCommands>
--> E (output): {"event":"output","body":{"category":"console","output":"1: (151) LaunchOptions <Command IgnoreFailures='true' Description='Enable pretty-printing for gdb'>-gdb-set follow-fork-mode child -enable-pretty-printing</Command>\n"},"seq":20,"type":"event"}
1: (151) LaunchOptions <Command IgnoreFailures='true' Description='Enable pretty-printing for gdb'>-gdb-set follow-fork-mode child -enable-pretty-printing</Command>
--> E (output): {"event":"output","body":{"category":"console","output":"1: (151) LaunchOptions </SetupCommands>\n"},"seq":22,"type":"event"}
1: (151) LaunchOptions </SetupCommands>
--> E (output): {"event":"output","body":{"category":"console","output":"1: (152) LaunchOptions</LocalLaunchOptions>\n"},"seq":24,"type":"event"}
1: (152) LaunchOptions</LocalLaunchOptions>
--> E (output): {"event":"output","body":{"category":"console","output":"1: (280) DbgCmd:echo $$ > /tmp/Microsoft-MIEngine-Pid-v3ibdhhu.kta ; cd /home/stje/test/testdbg ; DbgTerm=`tty` ; set -o monitor ; trap 'rm /tmp/Microsoft-MIEngine-In-mr3deg86.ggy /tmp/Microsoft-MIEngine-Out-1d6onlix.n0h /tmp/Microsoft-MIEngine-Pid-v3ibdhhu.kta /tmp/Microsoft-MIEngine-Cmd-t2l6z02w.eio' EXIT ; /usr/bin/gdb --interpreter=mi --tty=$DbgTerm < /tmp/Microsoft-MIEngine-In-mr3deg86.ggy > /tmp/Microsoft-MIEngine-Out-1d6onlix.n0h & clear; pid=$! ; echo $pid > /tmp/Microsoft-MIEngine-Pid-v3ibdhhu.kta ; wait $pid; \n"},"seq":26,"type":"event"}
1: (280) DbgCmd:echo $$ > /tmp/Microsoft-MIEngine-Pid-v3ibdhhu.kta ; cd /home/stje/test/testdbg ; DbgTerm=`tty` ; set -o monitor ; trap 'rm /tmp/Microsoft-MIEngine-In-mr3deg86.ggy /tmp/Microsoft-MIEngine-Out-1d6onlix.n0h /tmp/Microsoft-MIEngine-Pid-v3ibdhhu.kta /tmp/Microsoft-MIEngine-Cmd-t2l6z02w.eio' EXIT ; /usr/bin/gdb --interpreter=mi --tty=$DbgTerm < /tmp/Microsoft-MIEngine-In-mr3deg86.ggy > /tmp/Microsoft-MIEngine-Out-1d6onlix.n0h & clear; pid=$! ; echo $pid > /tmp/Microsoft-MIEngine-Pid-v3ibdhhu.kta ; wait $pid;
--> C (runInTerminal-28): {"command":"runInTerminal","arguments":{"kind":"integrated","title":"cppdbg: a.out","cwd":"","args":["sh","/tmp/Microsoft-MIEngine-Cmd-t2l6z02w.eio"],"env":{}},"seq":28,"type":"request"}
--> E (output): {"event":"output","body":{"category":"console","output":"1: (293) Wait for connection completion.\n"},"seq":30,"type":"event"}
1: (293) Wait for connection completion.
--> E (output): {"event":"output","body":{"category":"console","output":"1: (377) ->=thread-group-added,id=\"i1\"\n"},"seq":32,"type":"event"}
1: (377) ->=thread-group-added,id="i1"
--> E (output): {"event":"output","body":{"category":"console","output":"1: (378) ->~\"GNU gdb (Ubuntu 8.1-0ubuntu3) 8.1.0.20180409-git\\n\"\n"},"seq":34,"type":"event"}
1: (378) ->~"GNU gdb (Ubuntu 8.1-0ubuntu3) 8.1.0.20180409-git\n"
--> E (output): {"event":"output","body":{"category":"console","output":"1: (379) ->~\"Copyright (C) 2018 Free Software Foundation, Inc.\\n\"\n"},"seq":36,"type":"event"}
1: (379) ->~"Copyright (C) 2018 Free Software Foundation, Inc.\n"
--> E (output): {"event":"output","body":{"category":"console","output":"1: (379) ->~\"License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\\nThis is free software: you are free to change and redistribute it.\\nThere is NO WARRANTY, to the extent permitted by law. Type \\\"show copying\\\"\\nand \\\"show warranty\\\" for details.\\n\"\n"},"seq":38,"type":"event"}
1: (379) ->~"License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law. Type \"show copying\"\nand \"show warranty\" for details.\n"
--> E (output): {"event":"output","body":{"category":"console","output":"1: (380) ->~\"This GDB was configured as \\\"x86_64-linux-gnu\\\".\\nType \\\"show configuration\\\" for configuration details.\"\n"},"seq":40,"type":"event"}
1: (380) ->~"This GDB was configured as \"x86_64-linux-gnu\".\nType \"show configuration\" for configuration details."
--> E (output): {"event":"output","body":{"category":"console","output":"1: (380) ->~\"\\nFor bug reporting instructions, please see:\\n\"\n"},"seq":42,"type":"event"}
1: (380) ->~"\nFor bug reporting instructions, please see:\n"
--> E (output): {"event":"output","body":{"category":"console","output":"1: (381) ->~\"<http://www.gnu.org/software/gdb/bugs/>.\\n\"\n"},"seq":44,"type":"event"}
1: (381) ->~"<http://www.gnu.org/software/gdb/bugs/>.\n"
--> E (output): {"event":"output","body":{"category":"console","output":"1: (381) ->~\"Find the GDB manual and other documentation resources online at:\\n<http://www.gnu.org/software/gdb/documentation/>.\\n\"\n"},"seq":46,"type":"event"}
1: (381) ->~"Find the GDB manual and other documentation resources online at:\n<http://www.gnu.org/software/gdb/documentation/>.\n"
--> E (output): {"event":"output","body":{"category":"console","output":"1: (381) ->~\"For help, type \\\"help\\\".\\n\"\n"},"seq":48,"type":"event"}
1: (381) ->~"For help, type \"help\".\n"
--> E (output): {"event":"output","body":{"category":"console","output":"1: (381) ->~\"Type \\\"apropos word\\\" to search for commands related to \\\"word\\\".\\n\"\n"},"seq":50,"type":"event"}
1: (381) ->~"Type \"apropos word\" to search for commands related to \"word\".\n"
--> E (output): {"event":"output","body":{"category":"console","output":"1: (382) ->(gdb)\n"},"seq":52,"type":"event"}
1: (382) ->(gdb)
--> E (output): {"event":"output","body":{"category":"console","output":"1: (386) <-1001-gdb-set target-async on\n"},"seq":54,"type":"event"}
1: (386) <-1001-gdb-set target-async on
--> E (output): {"event":"output","body":{"category":"console","output":"1: (387) ->1001^done\n"},"seq":56,"type":"event"}
1: (387) ->1001^done
--> E (output): {"event":"output","body":{"category":"console","output":"1: (387) ->(gdb)\n"},"seq":58,"type":"event"}
1: (387) ->(gdb)
--> E (output): {"event":"output","body":{"category":"console","output":"1: (388) 1001: elapsed time 3\n"},"seq":60,"type":"event"}
1: (388) 1001: elapsed time 3
--> E (output): {"event":"output","body":{"category":"console","output":"1: (396) <-1002-gdb-set follow-fork-mode child -enable-pretty-printing\n"},"seq":62,"type":"event"}
1: (396) <-1002-gdb-set follow-fork-mode child -enable-pretty-printing
--> E (output): {"event":"output","body":{"category":"console","output":"1: (397) ->1002^done\n"},"seq":64,"type":"event"}
1: (397) ->1002^done
--> E (output): {"event":"output","body":{"category":"console","output":"1: (397) ->(gdb)\n"},"seq":66,"type":"event"}
1: (397) ->(gdb)
--> E (output): {"event":"output","body":{"category":"console","output":"1: (397) 1002: elapsed time 0\n"},"seq":68,"type":"event"}
1: (397) 1002: elapsed time 0
--> E (output): {"event":"output","body":{"category":"console","output":"1: (398) <-1003-interpreter-exec console \"set pagination off\"\n"},"seq":70,"type":"event"}
1: (398) <-1003-interpreter-exec console "set pagination off"
--> E (output): {"event":"output","body":{"category":"console","output":"1: (398) ->=cmd-param-changed,param=\"pagination\",value=\"off\"\n"},"seq":72,"type":"event"}
1: (398) ->=cmd-param-changed,param="pagination",value="off"
--> E (output): {"event":"output","body":{"category":"console","output":"1: (398) ->1003^done\n"},"seq":74,"type":"event"}
1: (398) ->1003^done
--> E (output): {"event":"output","body":{"category":"console","output":"1: (399) ->(gdb)\n"},"seq":76,"type":"event"}
1: (399) ->(gdb)
--> E (output): {"event":"output","body":{"category":"console","output":"1: (399) 1003: elapsed time 1\n"},"seq":78,"type":"event"}
1: (399) 1003: elapsed time 1
--> E (output): {"event":"output","body":{"category":"console","output":"1: (399) <-1004-gdb-set auto-solib-add on\n"},"seq":80,"type":"event"}
1: (399) <-1004-gdb-set auto-solib-add on
--> E (output): {"event":"output","body":{"category":"console","output":"1: (400) ->1004^done\n"},"seq":82,"type":"event"}
1: (400) ->1004^done
--> E (output): {"event":"output","body":{"category":"console","output":"1: (400) ->(gdb)\n"},"seq":84,"type":"event"}
1: (400) ->(gdb)
--> E (output): {"event":"output","body":{"category":"console","output":"1: (400) 1004: elapsed time 0\n"},"seq":86,"type":"event"}
1: (400) 1004: elapsed time 0
--> E (output): {"event":"output","body":{"category":"console","output":"1: (400) <-1005-gdb-set solib-search-path /home/stje/test/testdbg:\n"},"seq":88,"type":"event"}
1: (400) <-1005-gdb-set solib-search-path /home/stje/test/testdbg:
--> E (output): {"event":"output","body":{"category":"console","output":"1: (401) ->1005^done\n"},"seq":90,"type":"event"}
1: (401) ->1005^done
--> E (output): {"event":"output","body":{"category":"console","output":"1: (401) ->(gdb)\n"},"seq":92,"type":"event"}
1: (401) ->(gdb)
--> E (output): {"event":"output","body":{"category":"console","output":"1: (401) 1005: elapsed time 0\n"},"seq":94,"type":"event"}
1: (401) 1005: elapsed time 0
--> E (output): {"event":"output","body":{"category":"console","output":"1: (402) <-1006-gdb-set stop-on-solib-events 1\n"},"seq":96,"type":"event"}
1: (402) <-1006-gdb-set stop-on-solib-events 1
--> E (output): {"event":"output","body":{"category":"console","output":"1: (403) ->1006^done\n"},"seq":98,"type":"event"}
1: (403) ->1006^done
--> E (output): {"event":"output","body":{"category":"console","output":"1: (404) ->(gdb)\n"},"seq":100,"type":"event"}
1: (404) ->(gdb)
--> E (output): {"event":"output","body":{"category":"console","output":"1: (404) 1006: elapsed time 1\n"},"seq":102,"type":"event"}
1: (404) 1006: elapsed time 1
--> E (output): {"event":"output","body":{"category":"console","output":"1: (405) <-1007-environment-cd /home/stje/test/testdbg\n"},"seq":104,"type":"event"}
1: (405) <-1007-environment-cd /home/stje/test/testdbg
--> E (output): {"event":"output","body":{"category":"console","output":"1: (406) ->1007^done\n"},"seq":106,"type":"event"}
1: (406) ->1007^done
--> E (output): {"event":"output","body":{"category":"console","output":"1: (406) ->(gdb)\n"},"seq":108,"type":"event"}
1: (406) ->(gdb)
--> E (output): {"event":"output","body":{"category":"console","output":"1: (406) 1007: elapsed time 0\n"},"seq":110,"type":"event"}
1: (406) 1007: elapsed time 0
--> E (output): {"event":"output","body":{"category":"console","output":"1: (407) <-1008-file-exec-and-symbols /home/stje/test/testdbg/a.out\n"},"seq":112,"type":"event"}
1: (407) <-1008-file-exec-and-symbols /home/stje/test/testdbg/a.out
--> E (output): {"event":"output","body":{"category":"console","output":"1: (408) ->1008^done\n"},"seq":114,"type":"event"}
1: (408) ->1008^done
--> E (output): {"event":"output","body":{"category":"console","output":"1: (408) ->(gdb)\n"},"seq":116,"type":"event"}
1: (408) ->(gdb)
--> E (output): {"event":"output","body":{"category":"console","output":"1: (408) 1008: elapsed time 1\n"},"seq":118,"type":"event"}
1: (408) 1008: elapsed time 1
--> E (output): {"event":"output","body":{"category":"console","output":"1: (411) <-1009-interpreter-exec console \"show architecture\"\n"},"seq":120,"type":"event"}
1: (411) <-1009-interpreter-exec console "show architecture"
--> E (output): {"event":"output","body":{"category":"console","output":"1: (411) ->~\"The target architecture is set automatically (currently i386:x86-64)\\n\"\n"},"seq":122,"type":"event"}
1: (411) ->~"The target architecture is set automatically (currently i386:x86-64)\n"
--> E (output): {"event":"output","body":{"category":"console","output":"1: (412) ->1009^done\n"},"seq":124,"type":"event"}
1: (412) ->1009^done
--> E (output): {"event":"output","body":{"category":"console","output":"1: (412) ->(gdb)\n"},"seq":126,"type":"event"}
1: (412) ->(gdb)
--> E (output): {"event":"output","body":{"category":"console","output":"1: (412) 1009: elapsed time 1\n"},"seq":128,"type":"event"}
1: (412) 1009: elapsed time 1
--> E (output): {"event":"output","body":{"category":"console","output":"1: (414) <-1010-break-insert -f main\n"},"seq":130,"type":"event"}
1: (414) <-1010-break-insert -f main
--> E (output): {"event":"output","body":{"category":"console","output":"1: (414) ->1010^done,bkpt={number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"0x0000000000000692\",func=\"main\",file=\"forktest.c\",fullname=\"/home/stje/test/testdbg/forktest.c\",line=\"7\",thread-groups=[\"i1\"],times=\"0\",original-location=\"main\"}\n"},"seq":132,"type":"event"}
1: (414) ->1010^done,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x0000000000000692",func="main",file="forktest.c",fullname="/home/stje/test/testdbg/forktest.c",line="7",thread-groups=["i1"],times="0",original-location="main"}
--> E (output): {"event":"output","body":{"category":"console","output":"1: (414) ->(gdb)\n"},"seq":134,"type":"event"}
1: (414) ->(gdb)
--> E (output): {"event":"output","body":{"category":"console","output":"1: (419) 1010: elapsed time 5\n"},"seq":136,"type":"event"}
1: (419) 1010: elapsed time 5
--> E (output): {"event":"output","body":{"category":"console","output":"1: (426) Send Event AD7EngineCreateEvent\n"},"seq":138,"type":"event"}
1: (426) Send Event AD7EngineCreateEvent
--> E (output): {"event":"output","body":{"category":"console","output":"1: (429) Send Event AD7ProgramCreateEvent\n"},"seq":140,"type":"event"}
1: (429) Send Event AD7ProgramCreateEvent
--> E (output): {"event":"output","body":{"category":"telemetry","output":"VS/Diagnostics/Debugger/Launch","data":{"VS.Diagnostics.Debugger.ImplementationName":"Microsoft.MIDebugEngine","VS.Diagnostics.Debugger.EngineVersion":"14.0.60206.1","VS.Diagnostics.Debugger.HostVersion":"14.0.60206.1","VS.Diagnostics.Debugger.AdapterId":"cppdbg","VS.Diagnostics.Debugger.Launch.Duration":347,"VS.Diagnostics.Debugger.Launch.IsCoreDump":false,"VS.Diagnostics.Debugger.VisualizerFileUsed":false,"VS.Diagnostics.Debugger.SourceFileMappings":0}},"seq":142,"type":"event"}
--> R (launch-2): {"request_seq":2,"success":true,"command":"launch","body":{},"seq":144,"type":"response"}
--> E (initialized): {"event":"initialized","body":{},"seq":146,"type":"event"}
<-- R (runInTerminal-28) [156 ms]: {"type":"response","seq":3,"command":"runInTerminal","request_seq":28,"success":true,"body":{"shellProcessId":3936}}
--> E (output): {"event":"output","body":{"category":"console","output":"1: (472) ShellPid=4119\n"},"seq":149,"type":"event"}
1: (472) ShellPid=4119
--> E (output): {"event":"output","body":{"category":"console","output":"1: (472) DebuggerPid=4121\n"},"seq":151,"type":"event"}
1: (472) DebuggerPid=4121
<-- C (setBreakpoints-4): {"command":"setBreakpoints","arguments":{"source":{"name":"forktest.c","path":"/home/stje/test/testdbg/forktest.c"},"lines":[14],"breakpoints":[{"line":14}],"sourceModified":false},"type":"request","seq":4}
--> E (output): {"event":"output","body":{"category":"console","output":"1: (515) <-1011-break-insert -f forktest.c:14\n"},"seq":154,"type":"event"}
1: (515) <-1011-break-insert -f forktest.c:14
--> E (output): {"event":"output","body":{"category":"console","output":"1: (515) ->1011^done,bkpt={number=\"2\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"0x00000000000006ae\",func=\"main\",file=\"forktest.c\",fullname=\"/home/stje/test/testdbg/forktest.c\",line=\"14\",thread-groups=[\"i1\"],times=\"0\",original-location=\"forktest.c:14\"}\n"},"seq":156,"type":"event"}
1: (515) ->1011^done,bkpt={number="2",type="breakpoint",disp="keep",enabled="y",addr="0x00000000000006ae",func="main",file="forktest.c",fullname="/home/stje/test/testdbg/forktest.c",line="14",thread-groups=["i1"],times="0",original-location="forktest.c:14"}
--> E (output): {"event":"output","body":{"category":"console","output":"1: (515) ->(gdb)\n"},"seq":158,"type":"event"}
1: (515) ->(gdb)
--> E (output): {"event":"output","body":{"category":"console","output":"1: (516) 1011: elapsed time 1\n"},"seq":160,"type":"event"}
1: (516) 1011: elapsed time 1
--> E (output): {"event":"output","body":{"category":"console","output":"1: (524) <-1012-symbol-list-lines /home/stje/test/testdbg/forktest.c\n"},"seq":162,"type":"event"}
1: (524) <-1012-symbol-list-lines /home/stje/test/testdbg/forktest.c
--> E (output): {"event":"output","body":{"category":"console","output":"1: (525) ->1012^done,lines=[{pc=\"0x000000000000068a\",line=\"6\"},{pc=\"0x0000000000000692\",line=\"7\"},{pc=\"0x000000000000069a\",line=\"8\"},{pc=\"0x00000000000006a0\",line=\"10\"},{pc=\"0x00000000000006ae\",line=\"14\"},{pc=\"0x00000000000006ba\",line=\"16\"},{pc=\"0x00000000000006bf\",line=\"17\"},{pc=\"0x00000000000006c1\",line=\"0\"}]\n"},"seq":164,"type":"event"}
1: (525) ->1012^done,lines=[{pc="0x000000000000068a",line="6"},{pc="0x0000000000000692",line="7"},{pc="0x000000000000069a",line="8"},{pc="0x00000000000006a0",line="10"},{pc="0x00000000000006ae",line="14"},{pc="0x00000000000006ba",line="16"},{pc="0x00000000000006bf",line="17"},{pc="0x00000000000006c1",line="0"}]
--> E (output): {"event":"output","body":{"category":"console","output":"1: (525) ->(gdb)\n"},"seq":166,"type":"event"}
1: (525) ->(gdb)
--> E (output): {"event":"output","body":{"category":"console","output":"1: (526) 1012: elapsed time 2\n"},"seq":168,"type":"event"}
1: (526) 1012: elapsed time 2
--> E (output): {"event":"output","body":{"category":"console","output":"1: (531) Send Event AD7BreakpointBoundEvent\n"},"seq":170,"type":"event"}
1: (531) Send Event AD7BreakpointBoundEvent
--> R (setBreakpoints-4): {"request_seq":4,"success":true,"command":"setBreakpoints","body":{"breakpoints":[{"id":1,"verified":true,"line":14}]},"seq":172,"type":"response"}
--> E (breakpoint): {"event":"breakpoint","body":{"reason":"changed","breakpoint":{"id":1,"verified":true,"line":14}},"seq":174,"type":"event"}
<-- C (setFunctionBreakpoints-5): {"command":"setFunctionBreakpoints","arguments":{"breakpoints":[]},"type":"request","seq":5}
--> R (setFunctionBreakpoints-5): {"request_seq":5,"success":true,"command":"setFunctionBreakpoints","body":{"breakpoints":[]},"seq":177,"type":"response"}
<-- C (setExceptionBreakpoints-6): {"command":"setExceptionBreakpoints","arguments":{"filters":[]},"type":"request","seq":6}
--> R (setExceptionBreakpoints-6): {"request_seq":6,"success":true,"command":"setExceptionBreakpoints","body":{},"seq":180,"type":"response"}
<-- C (configurationDone-7): {"command":"configurationDone","type":"request","seq":7}
--> R (configurationDone-7): {"request_seq":7,"success":true,"command":"configurationDone","body":{},"seq":183,"type":"response"}
--> E (output): {"event":"output","body":{"category":"console","output":"1: (558) Send Event AD7LoadCompleteEvent\n"},"seq":185,"type":"event"}
1: (558) Send Event AD7LoadCompleteEvent
<-- C (threads-8): {"command":"threads","type":"request","seq":8}
--> E (output): {"event":"output","body":{"category":"stdout","output":"=thread-group-added,id=\"i1\"\nGNU gdb (Ubuntu 8.1-0ubuntu3) 8.1.0.20180409-git\nCopyright (C) 2018 Free Software Foundation, Inc.\nLicense GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law. Type \"show copying\"\nand \"show warranty\" for details.\nThis GDB was configured as \"x86_64-linux-gnu\".\nType \"show configuration\" for configuration details.\nFor bug reporting instructions, please see:\n<http://www.gnu.org/software/gdb/bugs/>.\nFind the GDB manual and other documentation resources online at:\n<http://www.gnu.org/software/gdb/documentation/>.\nFor help, type \"help\".\nType \"apropos word\" to search for commands related to \"word\".\nWarning: Debuggee TargetArchitecture not detected, assuming x86_64.\n=cmd-param-changed,param=\"pagination\",value=\"off\"\n"},"seq":188,"type":"event"}
=thread-group-added,id="i1"
GNU gdb (Ubuntu 8.1-0ubuntu3) 8.1.0.20180409-git
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word".
Warning: Debuggee TargetArchitecture not detected, assuming x86_64.
=cmd-param-changed,param="pagination",value="off"
--> E (output): {"event":"output","body":{"category":"console","output":"1: (562) <-1013-exec-run\n"},"seq":191,"type":"event"}
1: (562) <-1013-exec-run
--> E (output): {"event":"output","body":{"category":"console","output":"1: (563) ->=thread-group-started,id=\"i1\",pid=\"4127\"\n"},"seq":193,"type":"event"}
1: (563) ->=thread-group-started,id="i1",pid="4127"
--> E (output): {"event":"output","body":{"category":"console","output":"1: (564) ->=thread-created,id=\"1\",group-id=\"i1\"\n"},"seq":195,"type":"event"}
1: (564) ->=thread-created,id="1",group-id="i1"
--> R (threads-8): {"request_seq":8,"success":true,"command":"threads","body":{"threads":[]},"seq":190,"type":"response"}
--> E (output): {"event":"output","body":{"category":"console","output":"1: (567) ->=breakpoint-modified,bkpt={number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"0x0000555555554692\",func=\"main\",file=\"forktest.c\",fullname=\"/home/stje/test/testdbg/forktest.c\",line=\"7\",thread-groups=[\"i1\"],times=\"0\",original-location=\"main\"}\n"},"seq":198,"type":"event"}
1: (567) ->=breakpoint-modified,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x0000555555554692",func="main",file="forktest.c",fullname="/home/stje/test/testdbg/forktest.c",line="7",thread-groups=["i1"],times="0",original-location="main"}
--> E (output): {"event":"output","body":{"category":"console","output":"1: (568) ->=breakpoint-modified,bkpt={number=\"2\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"0x00005555555546ae\",func=\"main\",file=\"forktest.c\",fullname=\"/home/stje/test/testdbg/forktest.c\",line=\"14\",thread-groups=[\"i1\"],times=\"0\",original-location=\"forktest.c:14\"}\n"},"seq":200,"type":"event"}
1: (568) ->=breakpoint-modified,bkpt={number="2",type="breakpoint",disp="keep",enabled="y",addr="0x00005555555546ae",func="main",file="forktest.c",fullname="/home/stje/test/testdbg/forktest.c",line="14",thread-groups=["i1"],times="0",original-location="forktest.c:14"}
--> E (output): {"event":"output","body":{"category":"console","output":"1: (568) ->=library-loaded,id=\"/lib64/ld-linux-x86-64.so.2\",target-name=\"/lib64/ld-linux-x86-64.so.2\",host-name=\"/lib64/ld-linux-x86-64.so.2\",symbols-loaded=\"0\",thread-group=\"i1\",ranges=[{from=\"0x00007ffff7dd5f10\",to=\"0x00007ffff7df4b20\"}]\n"},"seq":202,"type":"event"}
1: (568) ->=library-loaded,id="/lib64/ld-linux-x86-64.so.2",target-name="/lib64/ld-linux-x86-64.so.2",host-name="/lib64/ld-linux-x86-64.so.2",symbols-loaded="0",thread-group="i1",ranges=[{from="0x00007ffff7dd5f10",to="0x00007ffff7df4b20"}]
--> E (output): {"event":"output","body":{"category":"console","output":"1: (569) <-1014-thread-info 1\n"},"seq":204,"type":"event"}
1: (569) <-1014-thread-info 1
--> E (output): {"event":"output","body":{"category":"console","output":"1: (574) <-1015-symbol-list-lines /home/stje/test/testdbg/forktest.c\n"},"seq":206,"type":"event"}
1: (574) <-1015-symbol-list-lines /home/stje/test/testdbg/forktest.c
--> E (output): {"event":"output","body":{"category":"console","output":"1: (581) ->1013^running\n"},"seq":208,"type":"event"}
1: (581) ->1013^running
--> E (output): {"event":"output","body":{"category":"console","output":"1: (581) ->*running,thread-id=\"all\"\n"},"seq":210,"type":"event"}
1: (581) ->*running,thread-id="all"
--> E (output): {"event":"output","body":{"category":"console","output":"1: (581) 1013: elapsed time 19\n"},"seq":212,"type":"event"}
1: (581) 1013: elapsed time 19
--> E (output): {"event":"output","body":{"category":"console","output":"1: (581) ->(gdb)\n"},"seq":214,"type":"event"}
1: (581) ->(gdb)
--> E (output): {"event":"output","body":{"category":"console","output":"1: (582) ->1014^done,threads=[{id=\"1\",target-id=\"process 4127\",name=\"a.out\",state=\"running\",core=\"5\"}]\n"},"seq":216,"type":"event"}
1: (582) ->1014^done,threads=[{id="1",target-id="process 4127",name="a.out",state="running",core="5"}]
--> E (output): {"event":"output","body":{"category":"console","output":"1: (583) ->(gdb)\n"},"seq":218,"type":"event"}
1: (583) ->(gdb)
--> E (output): {"event":"output","body":{"category":"console","output":"1: (583) 1014: elapsed time 14\n"},"seq":220,"type":"event"}
1: (583) 1014: elapsed time 14
--> E (output): {"event":"output","body":{"category":"console","output":"1: (584) ->~\"Stopped due to shared library event (no libraries added or removed)\\n\"\n"},"seq":222,"type":"event"}
1: (584) ->~"Stopped due to shared library event (no libraries added or removed)\n"
--> E (output): {"event":"output","body":{"category":"console","output":"1: (585) ->*stopped,reason=\"solib-event\",thread-id=\"1\",stopped-threads=\"all\",core=\"5\"\n"},"seq":224,"type":"event"}
1: (585) ->*stopped,reason="solib-event",thread-id="1",stopped-threads="all",core="5"
--> E (output): {"event":"output","body":{"category":"console","output":"1: (587) ->1015^done,lines=[{pc=\"0x000055555555468a\",line=\"6\"},{pc=\"0x0000555555554692\",line=\"7\"},{pc=\"0x000055555555469a\",line=\"8\"},{pc=\"0x00005555555546a0\",line=\"10\"},{pc=\"0x00005555555546ae\",line=\"14\"},{pc=\"0x00005555555546ba\",line=\"16\"},{pc=\"0x00005555555546bf\",line=\"17\"},{pc=\"0x00005555555546c1\",line=\"0\"}]\n"},"seq":226,"type":"event"}
1: (587) ->1015^done,lines=[{pc="0x000055555555468a",line="6"},{pc="0x0000555555554692",line="7"},{pc="0x000055555555469a",line="8"},{pc="0x00005555555546a0",line="10"},{pc="0x00005555555546ae",line="14"},{pc="0x00005555555546ba",line="16"},{pc="0x00005555555546bf",line="17"},{pc="0x00005555555546c1",line="0"}]
--> E (output): {"event":"output","body":{"category":"console","output":"1: (587) ->(gdb)\n"},"seq":228,"type":"event"}
1: (587) ->(gdb)
--> E (output): {"event":"output","body":{"category":"console","output":"1: (588) Send Event AD7ProcessInfoUpdatedEvent\n"},"seq":230,"type":"event"}
1: (588) Send Event AD7ProcessInfoUpdatedEvent
--> E (output): {"event":"output","body":{"category":"console","output":"1: (588) Send Event AD7ThreadCreateEvent\n"},"seq":232,"type":"event"}
1: (588) Send Event AD7ThreadCreateEvent
--> E (thread): {"event":"thread","body":{"reason":"started","threadId":4127},"seq":234,"type":"event"}
--> E (output): {"event":"output","body":{"category":"stdout","output":"Stopped due to shared library event (no libraries added or removed)\n"},"seq":236,"type":"event"}
Stopped due to shared library event (no libraries added or removed)
--> E (output): {"event":"output","body":{"category":"console","output":"1: (597) 1015: elapsed time 22\n"},"seq":238,"type":"event"}
1: (597) 1015: elapsed time 22
--> E (output): {"event":"output","body":{"category":"console","output":"1: (597) <-1016-interpreter-exec console \"shell echo -e \\\\\\\\033c 1>&2\"\n"},"seq":240,"type":"event"}
1: (597) <-1016-interpreter-exec console "shell echo -e \\\\033c 1>&2"
--> E (output): {"event":"output","body":{"category":"console","output":"1: (598) Send Event AD7BreakpointUnboundEvent\n"},"seq":242,"type":"event"}
1: (598) Send Event AD7BreakpointUnboundEvent
--> E (output): {"event":"output","body":{"category":"console","output":"1: (598) Send Event AD7BreakpointBoundEvent\n"},"seq":244,"type":"event"}
1: (598) Send Event AD7BreakpointBoundEvent
--> E (breakpoint): {"event":"breakpoint","body":{"reason":"changed","breakpoint":{"id":1,"verified":true,"line":14}},"seq":246,"type":"event"}
--> E (output): {"event":"output","body":{"category":"console","output":"1: (599) ->1016^done\n"},"seq":248,"type":"event"}
1: (599) ->1016^done
--> E (output): {"event":"output","body":{"category":"console","output":"1: (599) ->(gdb)\n"},"seq":250,"type":"event"}
1: (599) ->(gdb)
--> E (output): {"event":"output","body":{"category":"console","output":"1: (599) 1016: elapsed time 2\n"},"seq":252,"type":"event"}
1: (599) 1016: elapsed time 2
--> E (output): {"event":"output","body":{"category":"console","output":"1: (600) <-1017-gdb-set stop-on-solib-events 0\n"},"seq":254,"type":"event"}
1: (600) <-1017-gdb-set stop-on-solib-events 0
--> E (output): {"event":"output","body":{"category":"console","output":"1: (600) ->1017^done\n"},"seq":256,"type":"event"}
1: (600) ->1017^done
--> E (output): {"event":"output","body":{"category":"console","output":"1: (601) ->(gdb)\n"},"seq":258,"type":"event"}
1: (601) ->(gdb)
--> E (output): {"event":"output","body":{"category":"console","output":"1: (601) 1017: elapsed time 0\n"},"seq":260,"type":"event"}
1: (601) 1017: elapsed time 0
--> E (output): {"event":"output","body":{"category":"console","output":"1: (605) <-1018-interpreter-exec console \"info sharedlibrary\"\n"},"seq":262,"type":"event"}
1: (605) <-1018-interpreter-exec console "info sharedlibrary"
--> E (output): {"event":"output","body":{"category":"console","output":"1: (606) ->~\"From To Syms Read Shared Object Library\\n\"\n"},"seq":264,"type":"event"}
1: (606) ->~"From To Syms Read Shared Object Library\n"
--> E (output): {"event":"output","body":{"category":"console","output":"1: (606) ->~\"0x00007ffff7dd5f10 0x00007ffff7df4b20 Yes /lib64/ld-linux-x86-64.so.2\\n\"\n"},"seq":266,"type":"event"}
1: (606) ->~"0x00007ffff7dd5f10 0x00007ffff7df4b20 Yes /lib64/ld-linux-x86-64.so.2\n"
--> E (output): {"event":"output","body":{"category":"console","output":"1: (607) ->1018^done\n"},"seq":268,"type":"event"}
1: (607) ->1018^done
--> E (output): {"event":"output","body":{"category":"console","output":"1: (607) ->(gdb)\n"},"seq":270,"type":"event"}
1: (607) ->(gdb)
--> E (output): {"event":"output","body":{"category":"console","output":"1: (607) 1018: elapsed time 1\n"},"seq":272,"type":"event"}
1: (607) 1018: elapsed time 1
--> E (output): {"event":"output","body":{"category":"console","output":"1: (609) Send Event AD7ModuleLoadEvent\n"},"seq":274,"type":"event"}
1: (609) Send Event AD7ModuleLoadEvent
--> E (output): {"event":"output","body":{"category":"console","output":"Loaded '/lib64/ld-linux-x86-64.so.2'. Symbols loaded.\n"},"seq":276,"type":"event"}
Loaded '/lib64/ld-linux-x86-64.so.2'. Symbols loaded.
--> E (output): {"event":"output","body":{"category":"console","output":"1: (610) <--exec-continue\n"},"seq":278,"type":"event"}
1: (610) <--exec-continue
--> E (output): {"event":"output","body":{"category":"console","output":"1: (611) ->^running\n"},"seq":280,"type":"event"}
1: (611) ->^running
--> E (output): {"event":"output","body":{"category":"console","output":"1: (611) ->*running,thread-id=\"all\"\n"},"seq":282,"type":"event"}
1: (611) ->*running,thread-id="all"
--> E (output): {"event":"output","body":{"category":"console","output":"1: (611) ->(gdb)\n"},"seq":284,"type":"event"}
1: (611) ->(gdb)
--> E (output): {"event":"output","body":{"category":"console","output":"1: (612) ->=library-loaded,id=\"/lib/x86_64-linux-gnu/libc.so.6\",target-name=\"/lib/x86_64-linux-gnu/libc.so.6\",host-name=\"/lib/x86_64-linux-gnu/libc.so.6\",symbols-loaded=\"0\",thread-group=\"i1\",ranges=[{from=\"0x00007ffff7a052d0\",to=\"0x00007ffff7b7dc3c\"}]\n"},"seq":286,"type":"event"}
1: (612) ->=library-loaded,id="/lib/x86_64-linux-gnu/libc.so.6",target-name="/lib/x86_64-linux-gnu/libc.so.6",host-name="/lib/x86_64-linux-gnu/libc.so.6",symbols-loaded="0",thread-group="i1",ranges=[{from="0x00007ffff7a052d0",to="0x00007ffff7b7dc3c"}]
<-- C (threads-9): {"command":"threads","type":"request","seq":9}
--> R (threads-9): {"request_seq":9,"success":true,"command":"threads","body":{"threads":[{"id":4127,"name":"a.out"}]},"seq":289,"type":"response"}
--> E (output): {"event":"output","body":{"category":"console","output":"1: (785) ->=breakpoint-modified,bkpt={number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"0x0000555555554692\",func=\"main\",file=\"forktest.c\",fullname=\"/home/stje/test/testdbg/forktest.c\",line=\"7\",thread-groups=[\"i1\"],times=\"1\",original-location=\"main\"}\n"},"seq":291,"type":"event"}
1: (785) ->=breakpoint-modified,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x0000555555554692",func="main",file="forktest.c",fullname="/home/stje/test/testdbg/forktest.c",line="7",thread-groups=["i1"],times="1",original-location="main"}
--> E (output): {"event":"output","body":{"category":"console","output":"1: (785) ->~\"\\n\"\n"},"seq":293,"type":"event"}
1: (785) ->~"\n"
--> E (output): {"event":"output","body":{"category":"console","output":"1: (785) ->~\"Breakpoint 1, main () at forktest.c:7\\n\"\n"},"seq":295,"type":"event"}
1: (785) ->~"Breakpoint 1, main () at forktest.c:7\n"
--> E (output): {"event":"output","body":{"category":"console","output":"1: (786) ->~\"7\\t pid_t pid = fork();\\n\"\n"},"seq":298,"type":"event"}
Breakpoint 1, main () at forktest.c:7
1: (786) ->~"7\t pid_t pid = fork();\n"
--> E (output): {"event":"output","body":{"category":"console","output":"1: (786) ->*stopped,reason=\"breakpoint-hit\",disp=\"keep\",bkptno=\"1\",frame={addr=\"0x0000555555554692\",func=\"main\",args=[],file=\"forktest.c\",fullname=\"/home/stje/test/testdbg/forktest.c\",line=\"7\"},thread-id=\"1\",stopped-threads=\"all\",core=\"5\"\n"},"seq":301,"type":"event"}
7 pid_t pid = fork();
1: (786) ->*stopped,reason="breakpoint-hit",disp="keep",bkptno="1",frame={addr="0x0000555555554692",func="main",args=[],file="forktest.c",fullname="/home/stje/test/testdbg/forktest.c",line="7"},thread-id="1",stopped-threads="all",core="5"
--> E (output): {"event":"output","body":{"category":"console","output":"1: (796) <-1019-thread-info\n"},"seq":304,"type":"event"}
1: (796) <-1019-thread-info
--> E (output): {"event":"output","body":{"category":"console","output":"1: (796) ->1019^done,threads=[{id=\"1\",target-id=\"process 4127\",name=\"a.out\",frame={level=\"0\",addr=\"0x0000555555554692\",func=\"main\",args=[],file=\"forktest.c\",fullname=\"/home/stje/test/testdbg/forktest.c\",line=\"7\"},state=\"stopped\",core=\"5\"}],current-thread-id=\"1\"\n"},"seq":306,"type":"event"}
1: (796) ->1019^done,threads=[{id="1",target-id="process 4127",name="a.out",frame={level="0",addr="0x0000555555554692",func="main",args=[],file="forktest.c",fullname="/home/stje/test/testdbg/forktest.c",line="7"},state="stopped",core="5"}],current-thread-id="1"
--> E (output): {"event":"output","body":{"category":"console","output":"1: (796) ->(gdb)\n"},"seq":308,"type":"event"}
1: (796) ->(gdb)
--> E (output): {"event":"output","body":{"category":"console","output":"1: (797) 1019: elapsed time 1\n"},"seq":310,"type":"event"}
1: (797) 1019: elapsed time 1
--> E (output): {"event":"output","body":{"category":"console","output":"1: (805) <-1020-stack-list-frames 0 1000\n"},"seq":312,"type":"event"}
1: (805) <-1020-stack-list-frames 0 1000
--> E (output): {"event":"output","body":{"category":"console","output":"1: (806) ->1020^done,stack=[frame={level=\"0\",addr=\"0x0000555555554692\",func=\"main\",file=\"forktest.c\",fullname=\"/home/stje/test/testdbg/forktest.c\",line=\"7\"}]\n"},"seq":314,"type":"event"}
1: (806) ->1020^done,stack=[frame={level="0",addr="0x0000555555554692",func="main",file="forktest.c",fullname="/home/stje/test/testdbg/forktest.c",line="7"}]
--> E (output): {"event":"output","body":{"category":"console","output":"1: (806) ->(gdb)\n"},"seq":316,"type":"event"}
1: (806) ->(gdb)
--> E (output): {"event":"output","body":{"category":"console","output":"1: (807) 1020: elapsed time 1\n"},"seq":318,"type":"event"}
1: (807) 1020: elapsed time 1
--> E (output): {"event":"output","body":{"category":"console","output":"1: (813) <-1021-break-delete 1\n"},"seq":320,"type":"event"}
1: (813) <-1021-break-delete 1
--> E (output): {"event":"output","body":{"category":"console","output":"1: (814) ->1021^done\n"},"seq":322,"type":"event"}
1: (814) ->1021^done
--> E (output): {"event":"output","body":{"category":"console","output":"1: (814) ->(gdb)\n"},"seq":324,"type":"event"}
1: (814) ->(gdb)
--> E (output): {"event":"output","body":{"category":"console","output":"1: (814) 1021: elapsed time 1\n"},"seq":326,"type":"event"}
1: (814) 1021: elapsed time 1
--> E (output): {"event":"output","body":{"category":"console","output":"1: (815) Send Event AD7EntryPointEvent\n"},"seq":328,"type":"event"}
1: (815) Send Event AD7EntryPointEvent
--> E (output): {"event":"output","body":{"category":"console","output":"1: (817) <--exec-continue\n"},"seq":330,"type":"event"}
1: (817) <--exec-continue
--> E (output): {"event":"output","body":{"category":"console","output":"1: (818) ->^running\n"},"seq":332,"type":"event"}
1: (818) ->^running
--> E (output): {"event":"output","body":{"category":"console","output":"1: (818) ->*running,thread-id=\"all\"\n"},"seq":334,"type":"event"}
1: (818) ->*running,thread-id="all"
--> E (output): {"event":"output","body":{"category":"console","output":"1: (818) ->(gdb)\n"},"seq":336,"type":"event"}
1: (818) ->(gdb)
--> E (output): {"event":"output","body":{"category":"console","output":"1: (819) ->=thread-group-added,id=\"i2\"\n"},"seq":338,"type":"event"}
1: (819) ->=thread-group-added,id="i2"
--> E (output): {"event":"output","body":{"category":"console","output":"1: (819) ->=thread-group-started,id=\"i2\",pid=\"4135\"\n"},"seq":340,"type":"event"}
1: (819) ->=thread-group-started,id="i2",pid="4135"
--> E (output): {"event":"output","body":{"category":"console","output":"1: (819) ->=thread-exited,id=\"1\",group-id=\"i1\"\n"},"seq":342,"type":"event"}
1: (819) ->=thread-exited,id="1",group-id="i1"
--> E (output): {"event":"output","body":{"category":"console","output":"1: (820) ->=thread-group-exited,id=\"i1\"\n"},"seq":344,"type":"event"}
=thread-group-added,id="i2"
1: (820) ->=thread-group-exited,id="i1"
--> E (output): {"event":"output","body":{"category":"console","output":"1: (820) ->=thread-created,id=\"2\",group-id=\"i2\"\n"},"seq":347,"type":"event"}
1: (820) ->=thread-created,id="2",group-id="i2"
--> E (output): {"event":"output","body":{"category":"console","output":"1: (821) ->~\"[New process 4135]\\n\"\n"},"seq":349,"type":"event"}
1: (821) ->~"[New process 4135]\n"
--> E (output): {"event":"output","body":{"category":"console","output":"1: (821) ->*running,thread-id=\"2\"\n"},"seq":351,"type":"event"}
1: (821) ->*running,thread-id="2"
--> E (output): {"event":"output","body":{"category":"console","output":"1: (821) ->=breakpoint-modified,bkpt={number=\"2\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"0x00005555555546ae\",func=\"main\",file=\"forktest.c\",fullname=\"/home/stje/test/testdbg/forktest.c\",line=\"14\",thread-groups=[\"i1\",\"i2\"],times=\"1\",original-location=\"forktest.c:14\"}\n"},"seq":353,"type":"event"}
1: (821) ->=breakpoint-modified,bkpt={number="2",type="breakpoint",disp="keep",enabled="y",addr="0x00005555555546ae",func="main",file="forktest.c",fullname="/home/stje/test/testdbg/forktest.c",line="14",thread-groups=["i1","i2"],times="1",original-location="forktest.c:14"}
--> E (output): {"event":"output","body":{"category":"console","output":"1: (821) Send Event AD7ThreadDestroyEvent\n"},"seq":355,"type":"event"}
1: (821) Send Event AD7ThreadDestroyEvent
--> E (output): {"event":"output","body":{"category":"console","output":"1: (821) ->~\"[Switching to process 4135]\\n\"\n"},"seq":357,"type":"event"}
1: (821) ->~"[Switching to process 4135]\n"
1: (822) ->~"\n"
--> E (thread): {"event":"thread","body":{"reason":"exited","threadId":4127},"seq":360,"type":"event"}
--> E (output): {"event":"output","body":{"category":"console","output":"1: (822) ->~\"Thread 2.1 \\\"a.out\\\" hit Breakpoint 2, main () at forktest.c:14\\n\"\n"},"seq":362,"type":"event"}
1: (822) ->~"Thread 2.1 \"a.out\" hit Breakpoint 2, main () at forktest.c:14\n"
--> E (output): {"event":"output","body":{"category":"console","output":"1: (823) ->~\"14\\t printf(\\\"Forked process\\\\n\\\");\\n\"\n"},"seq":364,"type":"event"}
1: (823) ->~"14\t printf(\"Forked process\\n\");\n"
--> E (output): {"event":"output","body":{"category":"console","output":"1: (823) ->*stopped,reason=\"breakpoint-hit\",disp=\"keep\",bkptno=\"2\",frame={addr=\"0x00005555555546ae\",func=\"main\",args=[],file=\"forktest.c\",fullname=\"/home/stje/test/testdbg/forktest.c\",line=\"14\"},thread-id=\"2\",stopped-threads=\"all\",core=\"6\"\n"},"seq":366,"type":"event"}
1: (823) ->*stopped,reason="breakpoint-hit",disp="keep",bkptno="2",frame={addr="0x00005555555546ae",func="main",args=[],file="forktest.c",fullname="/home/stje/test/testdbg/forktest.c",line="14"},thread-id="2",stopped-threads="all",core="6"
--> E (output): {"event":"output","body":{"category":"console","output":"1: (824) <-1022-thread-info 2\n"},"seq":368,"type":"event"}
1: (824) <-1022-thread-info 2
--> E (output): {"event":"output","body":{"category":"stdout","output":"[New process 4135]\n"},"seq":370,"type":"event"}
[New process 4135]
--> E (output): {"event":"output","body":{"category":"console","output":"1: (824) ->1022^done,threads=[{id=\"2\",target-id=\"process 4135\",name=\"a.out\",frame={level=\"0\",addr=\"0x00005555555546ae\",func=\"main\",args=[],file=\"forktest.c\",fullname=\"/home/stje/test/testdbg/forktest.c\",line=\"14\"},state=\"stopped\",core=\"6\"}]\n"},"seq":372,"type":"event"}
1: (824) ->1022^done,threads=[{id="2",target-id="process 4135",name="a.out",frame={level="0",addr="0x00005555555546ae",func="main",args=[],file="forktest.c",fullname="/home/stje/test/testdbg/forktest.c",line="14"},state="stopped",core="6"}]
--> E (output): {"event":"output","body":{"category":"console","output":"1: (825) ->(gdb)\n"},"seq":374,"type":"event"}
1: (825) ->(gdb)
--> E (output): {"event":"output","body":{"category":"stdout","output":"[Switching to process 4135]\n"},"seq":376,"type":"event"}
[Switching to process 4135]
--> E (output): {"event":"output","body":{"category":"stdout","output":"\n"},"seq":378,"type":"event"}
--> E (output): {"event":"output","body":{"category":"stdout","output":"Thread 2.1 \"a.out\" hit Breakpoint 2, main () at forktest.c:14\n"},"seq":380,"type":"event"}
Thread 2.1 "a.out" hit Breakpoint 2, main () at forktest.c:14
--> E (output): {"event":"output","body":{"category":"stdout","output":"14\t printf(\"Forked process\\n\");\n"},"seq":382,"type":"event"}
14 printf("Forked process\n");
--> E (output): {"event":"output","body":{"category":"console","output":"1: (826) <-1023-thread-info\n"},"seq":384,"type":"event"}
1: (826) <-1023-thread-info
--> E (output): {"event":"output","body":{"category":"console","output":"1: (827) 1022: elapsed time 3\n"},"seq":386,"type":"event"}
1: (827) 1022: elapsed time 3
--> E (output): {"event":"output","body":{"category":"console","output":"1: (827) ->1023^done,threads=[{id=\"2\",target-id=\"process 4135\",name=\"a.out\",frame={level=\"0\",addr=\"0x00005555555546ae\",func=\"main\",args=[],file=\"forktest.c\",fullname=\"/home/stje/test/testdbg/forktest.c\",line=\"14\"},state=\"stopped\",core=\"6\"}],current-thread-id=\"2\"\n"},"seq":388,"type":"event"}
1: (827) ->1023^done,threads=[{id="2",target-id="process 4135",name="a.out",frame={level="0",addr="0x00005555555546ae",func="main",args=[],file="forktest.c",fullname="/home/stje/test/testdbg/forktest.c",line="14"},state="stopped",core="6"}],current-thread-id="2"
--> E (output): {"event":"output","body":{"category":"console","output":"1: (827) Send Event AD7ProcessInfoUpdatedEvent\n"},"seq":390,"type":"event"}
1: (827) Send Event AD7ProcessInfoUpdatedEvent
--> E (output): {"event":"output","body":{"category":"console","output":"1: (828) ->(gdb)\n"},"seq":392,"type":"event"}
1: (828) ->(gdb)
--> E (output): {"event":"output","body":{"category":"console","output":"1: (828) 1023: elapsed time 1\n"},"seq":394,"type":"event"}
1: (828) 1023: elapsed time 1
--> E (output): {"event":"output","body":{"category":"console","output":"1: (829) <-1024-stack-list-frames 0 1000\n"},"seq":396,"type":"event"}
1: (829) <-1024-stack-list-frames 0 1000
--> E (output): {"event":"output","body":{"category":"console","output":"1: (830) ->1024^done,stack=[frame={level=\"0\",addr=\"0x00005555555546ae\",func=\"main\",file=\"forktest.c\",fullname=\"/home/stje/test/testdbg/forktest.c\",line=\"14\"}]\n"},"seq":398,"type":"event"}
1: (830) ->1024^done,stack=[frame={level="0",addr="0x00005555555546ae",func="main",file="forktest.c",fullname="/home/stje/test/testdbg/forktest.c",line="14"}]
--> E (output): {"event":"output","body":{"category":"console","output":"1: (830) ->(gdb)\n"},"seq":400,"type":"event"}
1: (830) ->(gdb)
--> E (output): {"event":"output","body":{"category":"console","output":"1: (830) 1024: elapsed time 1\n"},"seq":402,"type":"event"}
1: (830) 1024: elapsed time 1
--> E (output): {"event":"output","body":{"category":"console","output":"1: (833) <-1025-interpreter-exec console \"info sharedlibrary\"\n"},"seq":404,"type":"event"}
1: (833) <-1025-interpreter-exec console "info sharedlibrary"
--> E (output): {"event":"output","body":{"category":"console","output":"1: (833) ->~\"From To Syms Read Shared Object Library\\n\"\n"},"seq":406,"type":"event"}
1: (833) ->~"From To Syms Read Shared Object Library\n"
--> E (output): {"event":"output","body":{"category":"console","output":"1: (834) ->~\"0x00007ffff7dd5f10 0x00007ffff7df4b20 Yes /lib64/ld-linux-x86-64.so.2\\n\"\n"},"seq":408,"type":"event"}
1: (834) ->~"0x00007ffff7dd5f10 0x00007ffff7df4b20 Yes /lib64/ld-linux-x86-64.so.2\n"
--> E (output): {"event":"output","body":{"category":"console","output":"1: (834) ->~\"0x00007ffff7a052d0 0x00007ffff7b7dc3c Yes /lib/x86_64-linux-gnu/libc.so.6\\n\"\n"},"seq":410,"type":"event"}
1: (834) ->~"0x00007ffff7a052d0 0x00007ffff7b7dc3c Yes /lib/x86_64-linux-gnu/libc.so.6\n"
--> E (output): {"event":"output","body":{"category":"console","output":"1: (834) ->1025^done\n"},"seq":412,"type":"event"}
1: (834) ->1025^done
--> E (output): {"event":"output","body":{"category":"console","output":"1: (834) ->(gdb)\n"},"seq":414,"type":"event"}
1: (834) ->(gdb)
--> E (output): {"event":"output","body":{"category":"console","output":"1: (834) 1025: elapsed time 1\n"},"seq":416,"type":"event"}
1: (834) 1025: elapsed time 1
--> E (output): {"event":"output","body":{"category":"console","output":"1: (835) Send Event AD7ModuleLoadEvent\n"},"seq":418,"type":"event"}
1: (835) Send Event AD7ModuleLoadEvent
--> E (output): {"event":"output","body":{"category":"console","output":"Loaded '/lib/x86_64-linux-gnu/libc.so.6'. Symbols loaded.\n"},"seq":420,"type":"event"}
Loaded '/lib/x86_64-linux-gnu/libc.so.6'. Symbols loaded.
--> E (output): {"event":"output","body":{"category":"console","output":"1: (838) Send Event AD7BreakpointEvent\n"},"seq":422,"type":"event"}
1: (838) Send Event AD7BreakpointEvent
--> E (output): {"event":"output","body":{"category":"console","output":"Execute debugger commands using \"-exec <command>\", for example \"-exec info registers\" will list registers in use (when GDB is the debugger)\n"},"seq":424,"type":"event"}
Execute debugger commands using "-exec <command>", for example "-exec info registers" will list registers in use (when GDB is the debugger)
--> E (stopped): {"event":"stopped","body":{"reason":"breakpoint","threadId":4135,"allThreadsStopped":true,"source":{"name":"forktest.c","path":"/home/stje/test/testdbg/forktest.c","sources":[],"checksums":[]},"line":14,"column":1},"seq":426,"type":"event"}
<-- C (threads-10): {"command":"threads","type":"request","seq":10}
--> R (threads-10): {"request_seq":10,"success":true,"command":"threads","body":{"threads":[]},"seq":429,"type":"response"}
Ok, I decided to try some old versions to see if I could pinpoint the version where it went wrong, as it seems that per #511 it has worked previously, and curiously it seems that the exact same scenario actually worked fine in 1.22.2!
It does however not work from 1.23.1 onwards.
Below I have attached the full engine log from a _successful_ run in 1.22.2.
1: (203) LaunchOptions<LocalLaunchOptions xmlns='http://schemas.microsoft.com/vstudio/MDDDebuggerOptions/2014'
1: (216) LaunchOptions ExePath='/home/stje/test/testdbg/a.out'
1: (216) LaunchOptions WorkingDirectory='/home/stje/test/testdbg'
1: (216) LaunchOptions ExeArguments=''
1: (216) LaunchOptions MIDebuggerPath=''
1: (216) LaunchOptions WaitDynamicLibLoad='false'
1: (216) LaunchOptions>
1: (216) LaunchOptions <SetupCommands>
1: (216) LaunchOptions <Command IgnoreFailures='true' Description='Enable pretty-printing for gdb'>-gdb-set follow-fork-mode child -enable-pretty-printing</Command>
1: (216) LaunchOptions </SetupCommands>
1: (217) LaunchOptions</LocalLaunchOptions>
1: (316) TempFile=/tmp/Microsoft-MIEngine-fifo-ok4i3vod.qp8
1: (316) TempFile=/tmp/Microsoft-MIEngine-fifo-linvcrgt.5j7
1: (316) TempFile=/tmp/Microsoft-MIEngine-fifo-xd4bzud5.gza
1: (470) term-stdout: # Option “-x” is deprecated and might be removed in a later version of gnome-terminal.
1: (470) term-stdout: # Use “-- ” to terminate the options and put the command line to execute after it.
1: (470) term-stdout: # Failed to load module "appmenu-gtk-module"
1: (475) ShellPid=15352
1: (481) DebuggerPid=15355
1: (531) ->=thread-group-added,id="i1"
1: (532) ->~"GNU gdb (Ubuntu 8.1-0ubuntu3) 8.1.0.20180409-git\n"
1: (533) ->~"Copyright (C) 2018 Free Software Foundation, Inc.\n"
1: (533) ->~"License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law. Type \"show copying\"\nand \"show warranty\" for details.\n"
1: (533) ->~"This GDB was configured as \"x86_64-linux-gnu\".\nType \"show configuration\" for configuration details."
1: (533) ->~"\nFor bug reporting instructions, please see:\n"
1: (533) ->~"<http://www.gnu.org/software/gdb/bugs/>.\n"
1: (533) ->~"Find the GDB manual and other documentation resources online at:\n<http://www.gnu.org/software/gdb/documentation/>.\n"
1: (533) ->~"For help, type \"help\".\n"
1: (533) ->~"Type \"apropos word\" to search for commands related to \"word\".\n"
1: (533) ->(gdb)
1: (538) <-1001-gdb-set target-async on
1: (539) ->1001^done
1: (539) ->(gdb)
1: (541) 1001: elapsed time 3
1: (548) <-1002-gdb-set follow-fork-mode child -enable-pretty-printing
1: (549) ->1002^done
1: (549) ->(gdb)
1: (549) 1002: elapsed time 0
1: (549) <-1003-interpreter-exec console "set pagination off"
1: (550) ->=cmd-param-changed,param="pagination",value="off"
1: (550) ->1003^done
1: (550) ->(gdb)
1: (550) 1003: elapsed time 0
1: (550) <-1004-gdb-set solib-search-path /home/stje/test/testdbg:
1: (550) ->1004^done
1: (550) ->(gdb)
1: (550) 1004: elapsed time 0
1: (550) <-1005-gdb-set stop-on-solib-events 1
1: (551) ->1005^done
1: (551) ->(gdb)
1: (551) 1005: elapsed time 0
1: (551) <-1006-environment-cd /home/stje/test/testdbg
1: (551) ->1006^done
1: (551) ->(gdb)
1: (551) 1006: elapsed time 0
1: (551) <-1007-file-exec-and-symbols /home/stje/test/testdbg/a.out
1: (553) ->1007^done
1: (553) ->(gdb)
1: (553) 1007: elapsed time 1
1: (555) <-1008-interpreter-exec console "show architecture"
1: (555) ->~"The target architecture is set automatically (currently i386:x86-64)\n"
1: (555) ->1008^done
1: (555) ->(gdb)
1: (555) 1008: elapsed time 0
1: (558) <-1009-break-insert main
1: (558) ->1009^done,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x00000000000006d2",func="main",file="forktest.c",fullname="/home/stje/test/testdbg/forktest.c",line="7",thread-groups=["i1"],times="0",original-location="main"}
1: (558) ->(gdb)
1: (561) 1009: elapsed time 2
E output: {"category":"telemetry","output":"VS/Diagnostics/Debugger/Launch","data":{"VS.Diagnostics.Debugger.ImplementationName":"Microsoft.MIDebugEngine","VS.Diagnostics.Debugger.EngineVersion":"14.0.50331.2","VS.Diagnostics.Debugger.HostVersion":"1.0.40106.1","VS.Diagnostics.Debugger.AdapterId":"cppdbg","VS.Diagnostics.Debugger.Launch.Duration":498,"VS.Diagnostics.Debugger.Launch.IsCoreDump":false,"VS.Diagnostics.Debugger.VisualizerFileUsed":false,"VS.Diagnostics.Debugger.SourceFileMappings":0},"type":"output"}
R: {"success":true,"message":null,"request_seq":2,"command":"launch","body":null,"running":false,"refs":null,"seq":0,"type":"response"}
E initialized: {"type":"initialized"}
C setBreakpoints: {"source":{"name":"forktest.c","path":"/home/stje/test/testdbg/forktest.c"},"lines":[14,15],"breakpoints":[{"line":14},{"line":15}],"sourceModified":false}
1: (622) <-1010-break-insert -f forktest.c:14
1: (623) ->1010^done,bkpt={number="2",type="breakpoint",disp="keep",enabled="y",addr="0x00000000000006ee",func="main",file="forktest.c",fullname="/home/stje/test/testdbg/forktest.c",line="14",thread-groups=["i1"],times="0",original-location="forktest.c:14"}
1: (623) ->(gdb)
1: (624) 1010: elapsed time 1
1: (633) <-1011-symbol-list-lines /home/stje/test/testdbg/forktest.c
1: (633) ->1011^done,lines=[{pc="0x00000000000006ca",line="6"},{pc="0x00000000000006d2",line="7"},{pc="0x00000000000006da",line="8"},{pc="0x00000000000006e0",line="10"},{pc="0x00000000000006ee",line="14"},{pc="0x00000000000006fa",line="15"},{pc="0x000000000000070b",line="17"},{pc="0x0000000000000710",line="18"},{pc="0x0000000000000712",line="0"}]
1: (633) ->(gdb)
1: (635) 1011: elapsed time 1
1: (643) <-1012-break-insert -f forktest.c:15
1: (643) ->1012^done,bkpt={number="3",type="breakpoint",disp="keep",enabled="y",addr="0x00000000000006fa",func="main",file="forktest.c",fullname="/home/stje/test/testdbg/forktest.c",line="15",thread-groups=["i1"],times="0",original-location="forktest.c:15"}
1: (643) ->(gdb)
1: (643) 1012: elapsed time 0
R: {"success":true,"message":null,"request_seq":3,"command":"setBreakpoints","body":{"breakpoints":[{"id":1,"verified":true,"line":14,"message":null},{"id":2,"verified":true,"line":15,"message":null}]},"running":false,"refs":null,"seq":0,"type":"response"}
E breakpoint: {"reason":"changed","breakpoint":{"id":1,"verified":true,"line":14,"message":null},"type":"breakpoint"}
E breakpoint: {"reason":"changed","breakpoint":{"id":2,"verified":true,"line":15,"message":null},"type":"breakpoint"}
C setFunctionBreakpoints: {"breakpoints":[]}
R: {"success":true,"message":null,"request_seq":4,"command":"setFunctionBreakpoints","body":{"breakpoints":[]},"running":false,"refs":null,"seq":0,"type":"response"}
C configurationDone: null
R: {"success":true,"message":null,"request_seq":5,"command":"configurationDone","body":null,"running":false,"refs":null,"seq":0,"type":"response"}
C threads: null
E output: {"category":"stdout","output":"=thread-group-added,id=\"i1\"\nGNU gdb (Ubuntu 8.1-0ubuntu3) 8.1.0.20180409-git\nCopyright (C) 2018 Free Software Foundation, Inc.\nLicense GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law. Type \"show copying\"\nand \"show warranty\" for details.\nThis GDB was configured as \"x86_64-linux-gnu\".\nType \"show configuration\" for configuration details.\nFor bug reporting instructions, please see:\n<http://www.gnu.org/software/gdb/bugs/>.\nFind the GDB manual and other documentation resources online at:\n<http://www.gnu.org/software/gdb/documentation/>.\nFor help, type \"help\".\nType \"apropos word\" to search for commands related to \"word\".\n=cmd-param-changed,param=\"pagination\",value=\"off\"\n","data":null,"type":"output"}
=thread-group-added,id="i1"
GNU gdb (Ubuntu 8.1-0ubuntu3) 8.1.0.20180409-git
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word".
=cmd-param-changed,param="pagination",value="off"
R: {"success":true,"message":null,"request_seq":6,"command":"threads","body":{"threads":[]},"running":false,"refs":null,"seq":0,"type":"response"}
1: (673) <-1013-exec-run
1: (674) ->=thread-group-started,id="i1",pid="15361"
1: (674) ->=thread-created,id="1",group-id="i1"
1: (677) ->=breakpoint-modified,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x00005555555546d2",func="main",file="forktest.c",fullname="/home/stje/test/testdbg/forktest.c",line="7",thread-groups=["i1"],times="0",original-location="main"}
1: (677) ->=breakpoint-modified,bkpt={number="2",type="breakpoint",disp="keep",enabled="y",addr="0x00005555555546ee",func="main",file="forktest.c",fullname="/home/stje/test/testdbg/forktest.c",line="14",thread-groups=["i1"],times="0",original-location="forktest.c:14"}
1: (678) ->=breakpoint-modified,bkpt={number="3",type="breakpoint",disp="keep",enabled="y",addr="0x00005555555546fa",func="main",file="forktest.c",fullname="/home/stje/test/testdbg/forktest.c",line="15",thread-groups=["i1"],times="0",original-location="forktest.c:15"}
1: (678) ->=library-loaded,id="/lib64/ld-linux-x86-64.so.2",target-name="/lib64/ld-linux-x86-64.so.2",host-name="/lib64/ld-linux-x86-64.so.2",symbols-loaded="0",thread-group="i1",ranges=[{from="0x00007ffff7dd5f10",to="0x00007ffff7df4b20"}]
1: (678) <-1014-thread-info 1
E breakpoint: {"reason":"changed","breakpoint":{"id":1,"verified":true,"line":14,"message":null},"type":"breakpoint"}
E breakpoint: {"reason":"changed","breakpoint":{"id":2,"verified":true,"line":15,"message":null},"type":"breakpoint"}
1: (692) ->1013^running
1: (692) ->*running,thread-id="all"
1: (693) 1013: elapsed time 19
1: (693) ->(gdb)
1: (693) ->1014^done,threads=[{id="1",target-id="process 15361",name="a.out",state="running",core="0"}]
1: (693) ->(gdb)
1: (693) 1014: elapsed time 15
1: (696) ->~"Stopped due to shared library event (no libraries added or removed)\n"
1: (696) ->*stopped,reason="solib-event",thread-id="1",stopped-threads="all",core="0"
E thread: {"reason":"started","threadId":15361,"type":"thread"}
E output: {"category":"stdout","output":"Stopped due to shared library event (no libraries added or removed)\n","data":null,"type":"output"}
Stopped due to shared library event (no libraries added or removed)
1: (704) <-1015-interpreter-exec console "shell echo -e \\\\033c 1>&2"
1: (707) ->1015^done
1: (707) ->(gdb)
1: (707) 1015: elapsed time 2
1: (707) <-1016-gdb-set stop-on-solib-events 0
1: (707) ->1016^done
1: (707) ->(gdb)
1: (707) 1016: elapsed time 0
1: (711) <-1017-interpreter-exec console "info sharedlibrary"
1: (711) ->~"From To Syms Read Shared Object Library\n"
1: (711) ->~"0x00007ffff7dd5f10 0x00007ffff7df4b20 Yes /lib64/ld-linux-x86-64.so.2\n"
1: (711) ->1017^done
1: (711) ->(gdb)
1: (712) 1017: elapsed time 1
E output: {"category":"console","output":"Loaded '/lib64/ld-linux-x86-64.so.2'. Symbols loaded.\n","data":null,"type":"output"}
Loaded '/lib64/ld-linux-x86-64.so.2'. Symbols loaded.
1: (715) <--exec-continue
1: (715) ->^running
1: (715) ->*running,thread-id="all"
1: (716) ->(gdb)
1: (717) ->=library-loaded,id="/lib/x86_64-linux-gnu/libc.so.6",target-name="/lib/x86_64-linux-gnu/libc.so.6",host-name="/lib/x86_64-linux-gnu/libc.so.6",symbols-loaded="0",thread-group="i1",ranges=[{from="0x00007ffff7a052d0",to="0x00007ffff7b7dc3c"}]
C threads: null
R: {"success":true,"message":null,"request_seq":7,"command":"threads","body":{"threads":[{"id":15361,"name":"a.out"}]},"running":false,"refs":null,"seq":0,"type":"response"}
1: (929) ->=breakpoint-modified,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x00005555555546d2",func="main",file="forktest.c",fullname="/home/stje/test/testdbg/forktest.c",line="7",thread-groups=["i1"],times="1",original-location="main"}
1: (929) ->~"\n"
1: (929) ->~"Breakpoint 1, main () at forktest.c:7\n"
1: (929) ->~"7\t pid_t pid = fork();\n"
E output: {"category":"stdout","output":"\n","data":null,"type":"output"}
1: (929) ->*stopped,reason="breakpoint-hit",disp="keep",bkptno="1",frame={addr="0x00005555555546d2",func="main",args=[],file="forktest.c",fullname="/home/stje/test/testdbg/forktest.c",line="7"},thread-id="1",stopped-threads="all",core="0"
E output: {"category":"stdout","output":"Breakpoint 1, main () at forktest.c:7\n","data":null,"type":"output"}
Breakpoint 1, main () at forktest.c:7
E output: {"category":"stdout","output":"7\t pid_t pid = fork();\n","data":null,"type":"output"}
7 pid_t pid = fork();
1: (940) <-1018-thread-info
1: (940) ->1018^done,threads=[{id="1",target-id="process 15361",name="a.out",frame={level="0",addr="0x00005555555546d2",func="main",args=[],file="forktest.c",fullname="/home/stje/test/testdbg/forktest.c",line="7"},state="stopped",core="0"}],current-thread-id="1"
1: (940) ->(gdb)
1: (942) 1018: elapsed time 2
1: (950) <-1019-stack-list-frames 0 1000
1: (950) ->1019^done,stack=[frame={level="0",addr="0x00005555555546d2",func="main",file="forktest.c",fullname="/home/stje/test/testdbg/forktest.c",line="7"}]
1: (950) ->(gdb)
1: (951) 1019: elapsed time 1
1: (956) <-1020-break-delete 1
1: (957) ->1020^done
1: (957) ->(gdb)
1: (957) 1020: elapsed time 0
1: (959) <--exec-continue
1: (959) ->^running
1: (959) ->*running,thread-id="all"
1: (959) ->(gdb)
1: (959) ->=thread-group-added,id="i2"
1: (959) ->=thread-group-started,id="i2",pid="15371"
1: (959) ->=thread-exited,id="1",group-id="i1"
E output: {"category":"stdout","output":"=thread-group-added,id=\"i2\"\n","data":null,"type":"output"}
=thread-group-added,id="i2"
1: (959) ->=thread-group-exited,id="i1"
1: (959) ->=thread-created,id="2",group-id="i2"
1: (959) ->~"[New process 15371]\n"
1: (960) ->*running,thread-id="2"
1: (960) ->=breakpoint-modified,bkpt={number="2",type="breakpoint",disp="keep",enabled="y",addr="0x00005555555546ee",func="main",file="forktest.c",fullname="/home/stje/test/testdbg/forktest.c",line="14",thread-groups=["i1","i2"],times="1",original-location="forktest.c:14"}
1: (960) ->~"[Switching to process 15371]\n"
1: (960) ->~"\n"
1: (960) ->~"Thread 2.1 \"a.out\" hit Breakpoint 2, main () at forktest.c:14\n"
1: (960) ->~"14\t printf(\"Forked process\\n\");\n"
1: (960) ->*stopped,reason="breakpoint-hit",disp="keep",bkptno="2",frame={addr="0x00005555555546ee",func="main",args=[],file="forktest.c",fullname="/home/stje/test/testdbg/forktest.c",line="14"},thread-id="2",stopped-threads="all",core="5"
E thread: {"reason":"exited","threadId":15361,"type":"thread"}
1: (962) <-1021-thread-info 2
E output: {"category":"stdout","output":"[New process 15371]\n","data":null,"type":"output"}
[New process 15371]
E output: {"category":"stdout","output":"[Switching to process 15371]\n","data":null,"type":"output"}
[Switching to process 15371]
E output: {"category":"stdout","output":"\n","data":null,"type":"output"}
E output: {"category":"stdout","output":"Thread 2.1 \"a.out\" hit Breakpoint 2, main () at forktest.c:14\n","data":null,"type":"output"}
Thread 2.1 "a.out" hit Breakpoint 2, main () at forktest.c:14
E output: {"category":"stdout","output":"14\t printf(\"Forked process\\n\");\n","data":null,"type":"output"}
14 printf("Forked process\n");
1: (963) ->1021^done,threads=[{id="2",target-id="process 15371",name="a.out",frame={level="0",addr="0x00005555555546ee",func="main",args=[],file="forktest.c",fullname="/home/stje/test/testdbg/forktest.c",line="14"},state="stopped",core="5"}]
1: (963) ->(gdb)
1: (963) <-1022-thread-info
1: (963) 1021: elapsed time 0
E thread: {"reason":"started","threadId":15371,"type":"thread"}
1: (963) ->1022^done,threads=[{id="2",target-id="process 15371",name="a.out",frame={level="0",addr="0x00005555555546ee",func="main",args=[],file="forktest.c",fullname="/home/stje/test/testdbg/forktest.c",line="14"},state="stopped",core="5"}],current-thread-id="2"
1: (963) ->(gdb)
1: (963) 1022: elapsed time 0
1: (964) <-1023-stack-list-frames 0 1000
1: (964) ->1023^done,stack=[frame={level="0",addr="0x00005555555546ee",func="main",file="forktest.c",fullname="/home/stje/test/testdbg/forktest.c",line="14"}]
1: (964) ->(gdb)
1: (964) 1023: elapsed time 0
1: (966) <-1024-interpreter-exec console "info sharedlibrary"
1: (966) ->~"From To Syms Read Shared Object Library\n"
1: (966) ->~"0x00007ffff7dd5f10 0x00007ffff7df4b20 Yes /lib64/ld-linux-x86-64.so.2\n"
1: (966) ->~"0x00007ffff7a052d0 0x00007ffff7b7dc3c Yes /lib/x86_64-linux-gnu/libc.so.6\n"
1: (966) ->1024^done
1: (966) ->(gdb)
1: (967) 1024: elapsed time 0
E output: {"category":"console","output":"Loaded '/lib/x86_64-linux-gnu/libc.so.6'. Symbols loaded.\n","data":null,"type":"output"}
Loaded '/lib/x86_64-linux-gnu/libc.so.6'. Symbols loaded.
E output: {"category":"console","output":"Execute debugger commands using \"-exec <command>\", for example \"-exec info registers\" will list registers in use (when GDB is the debugger)\n","data":null,"type":"output"}
Execute debugger commands using "-exec <command>", for example "-exec info registers" will list registers in use (when GDB is the debugger)
E stopped: {"threadId":15371,"reason":"breakpoint","source":{"name":"forktest.c","path":"/home/stje/test/testdbg/forktest.c","sourceReference":0},"line":14,"column":1,"text":null,"allThreadsStopped":true,"type":"stopped"}
C threads: null
R: {"success":true,"message":null,"request_seq":8,"command":"threads","body":{"threads":[{"id":15371,"name":"a.out"}]},"running":false,"refs":null,"seq":0,"type":"response"}
C stackTrace: {"threadId":15371,"startFrame":0,"levels":20}
1: (995) <-1025-stack-list-arguments 0 0 0
1: (995) ->1025^done,stack-args=[frame={level="0",args=[]}]
1: (995) ->(gdb)
1: (996) 1025: elapsed time 1
R: {"success":true,"message":null,"request_seq":9,"command":"stackTrace","body":{"stackFrames":[{"id":1000,"source":{"name":"forktest.c","path":"/home/stje/test/testdbg/forktest.c","sourceReference":0},"line":14,"column":1,"name":"main()"}],"totalFrames":1},"running":false,"refs":null,"seq":0,"type":"response"}
C scopes: {"frameId":1000}
1: (1026) <-1026-stack-list-variables 0
1: (1026) ->1026^done,variables=[{name="pid"}]
1: (1026) ->(gdb)
1: (1029) 1026: elapsed time 3
1: (1034) <-1027-var-create - * "pid"
1: (1038) ->1027^done,name="var1",numchild="0",value="0",type="pid_t",thread-id="2",has_more="0"
1: (1038) ->(gdb)
1: (1038) 1027: elapsed time 4
R: {"success":true,"message":null,"request_seq":10,"command":"scopes","body":{"scopes":[{"name":"Locals","variablesReference":1000,"expensive":false}]},"running":false,"refs":null,"seq":0,"type":"response"}
C variables: {"variablesReference":1000}
R: {"success":true,"message":null,"request_seq":11,"command":"variables","body":{"variables":[{"name":"pid","value":"0","type":"pid_t","variablesReference":0,"evaluateName":"pid"}]},"running":false,"refs":null,"seq":0,"type":"response"}
C threads: null
R: {"success":true,"message":null,"request_seq":12,"command":"threads","body":{"threads":[{"id":15371,"name":"a.out"}]},"running":false,"refs":null,"seq":0,"type":"response"}
I can verify stjen's result. I can't get -exec set db-follow-fork (or variants -gdb-set ...) to work in 1.31, but if I back up to 1.22.2 it works as expected. Please fix this.
I'm having the same issue. For anyone else here looking for the old version of vscode: https://code.visualstudio.com/updates/v1_22.
Any news on this?
I was able to investigate this and see that this broke when this fix was introduced. I'm currently working on a fix for this.
Fixed with 0.24.0.
Most helpful comment
Yes, actually the breakpoint is hit in my case (according to DEBUG CONSOLE), but VSCode UI is not reacting on attaching and detaching of child process with actual breakpoint.