microsoft / vscode-cpptools

Official repository for the Microsoft C/C++ extension for VS Code.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Debugger target command line args containing semicolon are truncated

tsondergaard opened this issue · comments

Environment

  • OS and version: AlmaLinux 9.4
  • VS Code: 1.89.1
  • C/C++ extension: 1.20.5
  • OS and version of remote machine (if applicable): N/A
  • GDB / LLDB version: GNU gdb (GDB) AlmaLinux 12.1-5.el9

Bug Summary and Steps to Reproduce

Bug Summary:
When launching gdb with the "args": ["foo;bar"] the target application only sees foo - ;bar is lost

Steps to reproduce:

  1. On Linux (I use VSCode running on linux and connect to AlmaLinux 9.4 running in WSL2)
  2. Put the provided debugger configuration in launch.json
  3. Launch the debugger
  4. See the the program echoes "foo" when it should echo "foo;bar"

Observations:

  • It looks in the debugger log like the arguments are passed verbatim via MI to gdb as -exec-arguments foo;bar\n
  • A semicolon with a " " or "(" on one side or the other does not result in argument truncation. See the various examples commented out in the debugger configuration below

Debugger Configurations

{
        "name": "example",
        "type": "cppdbg",
        "request": "launch",
        "program": "/bin/echo",
        "args": [
             // good: "foo; bar"
             // good: "foo ;bar"
             // good: "foo;(bar"
             // argument changed: "foo;bar" -> "foo"
             // argument changed: "foo;-bar" -> "foo"
             // argument changed: "foo;_bar" -> "foo"
             // gdb fails to launch executable: "foo;;bar"
             "foo;bar"
        ],
        "cwd": "${workspaceFolder}",
        "externalConsole": false,
        "MIMode": "gdb",
      }


### Debugger Logs

```shell
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (47) LaunchOptions{\"name\":\"aa repro example\",\"type\":\"cppdbg\",\"request\":\"launch\",\"program\":\"/bin/echo\",\"args\":[\"foo;bar\"],\"cwd\":\"/home/ts/src/easyviz-2\",\"externalConsole\":false,\"MIMode\":\"gdb\",\"logging\":{\"engineLogging\":true,\"trace\":true,\"traceResponse\":true},\"__configurationTarget\":2,\"__sessionId\":\"5bc516bf-b20f-4860-a75c-4221188a489a\"}\n"},"seq":2}
1: (47) LaunchOptions{"name":"aa repro example","type":"cppdbg","request":"launch","program":"/bin/echo","args":["foo;bar"],"cwd":"/home/ts/src/easyviz-2","externalConsole":false,"MIMode":"gdb","logging":{"engineLogging":true,"trace":true,"traceResponse":true},"__configurationTarget":2,"__sessionId":"5bc516bf-b20f-4860-a75c-4221188a489a"}
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (76) DbgCmd:echo $$ > /tmp/Microsoft-MIEngine-Pid-ocdrd40g.2me ; cd \"/bin\" ; DbgTerm=`tty` ; set -o monitor ; trap 'rm \"/tmp/Microsoft-MIEngine-In-un5y54sc.frd\" \"/tmp/Microsoft-MIEngine-Out-le1yqbct.grl\" \"/tmp/Microsoft-MIEngine-Pid-ocdrd40g.2me\" \"/tmp/Microsoft-MIEngine-Cmd-aj0a1qw3.id2\"' EXIT ; \"/home/ts/.local/bin/gdb\" --interpreter=mi --tty=$DbgTerm < \"/tmp/Microsoft-MIEngine-In-un5y54sc.frd\" > \"/tmp/Microsoft-MIEngine-Out-le1yqbct.grl\" & clear; pid=$! ; echo $pid > \"/tmp/Microsoft-MIEngine-Pid-ocdrd40g.2me\" ; wait $pid; \n"},"seq":4}
1: (76) DbgCmd:echo $$ > /tmp/Microsoft-MIEngine-Pid-ocdrd40g.2me ; cd "/bin" ; DbgTerm=`tty` ; set -o monitor ; trap 'rm "/tmp/Microsoft-MIEngine-In-un5y54sc.frd" "/tmp/Microsoft-MIEngine-Out-le1yqbct.grl" "/tmp/Microsoft-MIEngine-Pid-ocdrd40g.2me" "/tmp/Microsoft-MIEngine-Cmd-aj0a1qw3.id2"' EXIT ; "/home/ts/.local/bin/gdb" --interpreter=mi --tty=$DbgTerm < "/tmp/Microsoft-MIEngine-In-un5y54sc.frd" > "/tmp/Microsoft-MIEngine-Out-le1yqbct.grl" & clear; pid=$! ; echo $pid > "/tmp/Microsoft-MIEngine-Pid-ocdrd40g.2me" ; wait $pid;
--> C (runInTerminal-6): {"type":"request","command":"runInTerminal","arguments":{"kind":"integrated","title":"cppdbg: echo","cwd":"","args":["/bin/sh","/tmp/Microsoft-MIEngine-Cmd-aj0a1qw3.id2"],"env":{}},"seq":6}
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (83) Wait for connection completion.\n"},"seq":8}
1: (83) Wait for connection completion.
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (128) ->=thread-group-added,id=\"i1\"\n"},"seq":10}
1: (128) ->=thread-group-added,id="i1"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (129) ->~\"GNU gdb (GDB) AlmaLinux 12.1-5.el9\\n\"\n"},"seq":12}
1: (129) ->~"GNU gdb (GDB) AlmaLinux 12.1-5.el9\n"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (129) ->~\"Copyright (C) 2022 Free Software Foundation, Inc.\\n\"\n"},"seq":14}
1: (129) ->~"Copyright (C) 2022 Free Software Foundation, Inc.\n"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (129) ->~\"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.\"\n"},"seq":16}
1: (129) ->~"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."
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (129) ->~\"\\nType \\\"show copying\\\" and \\\"show warranty\\\" for details.\\n\"\n"},"seq":18}
1: (129) ->~"\nType \"show copying\" and \"show warranty\" for details.\n"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (129) ->~\"This GDB was configured as \\\"x86_64-redhat-linux-gnu\\\".\\n\"\n"},"seq":20}
1: (129) ->~"This GDB was configured as \"x86_64-redhat-linux-gnu\".\n"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (129) ->~\"Type \\\"show configuration\\\" for configuration details.\\n\"\n"},"seq":22}
1: (129) ->~"Type \"show configuration\" for configuration details.\n"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (129) ->~\"For bug reporting instructions, please see:\\n\"\n"},"seq":24}
1: (129) ->~"For bug reporting instructions, please see:\n"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (129) ->~\"<https://www.gnu.org/software/gdb/bugs/>.\\n\"\n"},"seq":26}
1: (129) ->~"<https://www.gnu.org/software/gdb/bugs/>.\n"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (129) ->~\"Find the GDB manual and other documentation resources online at:\\n    <http://www.gnu.org/software/gdb/documentation/>.\"\n"},"seq":28}
1: (129) ->~"Find the GDB manual and other documentation resources online at:\n    <http://www.gnu.org/software/gdb/documentation/>."
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (129) ->~\"\\n\\n\"\n"},"seq":30}
1: (129) ->~"\n\n"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (129) ->~\"For help, type \\\"help\\\".\\n\"\n"},"seq":32}
1: (129) ->~"For help, type \"help\".\n"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (129) ->~\"Type \\\"apropos word\\\" to search for commands related to \\\"word\\\".\\n\"\n"},"seq":34}
1: (129) ->~"Type \"apropos word\" to search for commands related to \"word\".\n"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (129) ->=cmd-param-changed,param=\"debuginfod enabled\",value=\"on\"\n"},"seq":36}
1: (129) ->=cmd-param-changed,param="debuginfod enabled",value="on"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (129) ->=cmd-param-changed,param=\"index-cache enabled\",value=\"on\"\n"},"seq":38}
1: (129) ->=cmd-param-changed,param="index-cache enabled",value="on"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (129) ->=cmd-param-changed,param=\"pagination\",value=\"off\"\n"},"seq":40}
1: (129) ->=cmd-param-changed,param="pagination",value="off"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (129) ->(gdb)\n"},"seq":42}
1: (129) ->(gdb)
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (133) <-1001-gdb-set mi-async on\n"},"seq":44}
1: (133) <-1001-gdb-set mi-async on
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (134) ->1001^done\n"},"seq":46}
1: (134) ->1001^done
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (134) ->(gdb)\n"},"seq":48}
1: (134) ->(gdb)
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (135) 1001: elapsed time 3\n"},"seq":50}
1: (135) 1001: elapsed time 3
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (143) <-1002-interpreter-exec console \"set pagination off\"\n"},"seq":52}
1: (143) <-1002-interpreter-exec console "set pagination off"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (144) ->1002^done\n"},"seq":54}
1: (144) ->1002^done
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (144) ->(gdb)\n"},"seq":56}
1: (144) ->(gdb)
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (144) 1002: elapsed time 0\n"},"seq":58}
1: (144) 1002: elapsed time 0
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (144) <-1003-gdb-set auto-solib-add on\n"},"seq":60}
1: (144) <-1003-gdb-set auto-solib-add on
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (144) ->1003^done\n"},"seq":62}
1: (144) ->1003^done
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (144) ->(gdb)\n"},"seq":64}
1: (144) ->(gdb)
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (144) 1003: elapsed time 0\n"},"seq":66}
1: (144) 1003: elapsed time 0
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (145) <-1004-gdb-set solib-search-path /bin:\n"},"seq":68}
1: (145) <-1004-gdb-set solib-search-path /bin:
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (145) ->1004^done\n"},"seq":70}
1: (145) ->1004^done
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (145) ->(gdb)\n"},"seq":72}
1: (145) ->(gdb)
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (145) 1004: elapsed time 0\n"},"seq":74}
1: (145) 1004: elapsed time 0
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (145) <-1005-gdb-set stop-on-solib-events 1\n"},"seq":76}
1: (145) <-1005-gdb-set stop-on-solib-events 1
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (145) ->1005^done\n"},"seq":78}
1: (145) ->1005^done
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (145) ->(gdb)\n"},"seq":80}
1: (145) ->(gdb)
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (145) 1005: elapsed time 0\n"},"seq":82}
1: (145) 1005: elapsed time 0
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (146) <-1006-environment-cd /home/ts/src/easyviz-2\n"},"seq":84}
1: (146) <-1006-environment-cd /home/ts/src/easyviz-2
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (146) ->1006^done\n"},"seq":86}
1: (146) ->1006^done
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (146) ->(gdb)\n"},"seq":88}
1: (146) ->(gdb)
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (146) 1006: elapsed time 0\n"},"seq":90}
1: (146) 1006: elapsed time 0
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (146) <-1007-file-exec-and-symbols /bin/echo\n"},"seq":92}
1: (146) <-1007-file-exec-and-symbols /bin/echo
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (150) ->1007^done\n"},"seq":94}
1: (150) ->1007^done
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (150) ->(gdb)\n"},"seq":96}
1: (150) ->(gdb)
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (150) 1007: elapsed time 3\n"},"seq":98}
1: (150) 1007: elapsed time 3
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (151) <-1008-interpreter-exec console \"show architecture\"\n"},"seq":100}
1: (151) <-1008-interpreter-exec console "show architecture"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (151) ->~\"The target architecture is set to \\\"auto\\\" (currently \\\"i386:x86-64\\\").\\n\"\n"},"seq":102}
1: (151) ->~"The target architecture is set to \"auto\" (currently \"i386:x86-64\").\n"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (151) ->1008^done\n"},"seq":104}
1: (151) ->1008^done
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (151) ->(gdb)\n"},"seq":106}
1: (151) ->(gdb)
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (152) 1008: elapsed time 0\n"},"seq":108}
1: (152) 1008: elapsed time 0
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (152) <-1009-exec-arguments foo;bar\n"},"seq":110}
1: (152) <-1009-exec-arguments foo;bar
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (153) ->1009^done\n"},"seq":112}
1: (153) ->1009^done
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (153) ->(gdb)\n"},"seq":114}
1: (153) ->(gdb)
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (153) 1009: elapsed time 0\n"},"seq":116}
1: (153) 1009: elapsed time 0
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (153) <-1010-break-insert -f main\n"},"seq":118}
1: (153) <-1010-break-insert -f main
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (153) ->1010^done,bkpt={number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"0x0000000000002500\",func=\"main\",file=\"../src/echo.c\",fullname=\"/usr/src/debug/coreutils-8.32-35.el9.x86_64/src/echo.c\",line=\"109\",thread-groups=[\"i1\"],times=\"0\",original-location=\"main\"}\n"},"seq":120}
1: (153) ->1010^done,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x0000000000002500",func="main",file="../src/echo.c",fullname="/usr/src/debug/coreutils-8.32-35.el9.x86_64/src/echo.c",line="109",thread-groups=["i1"],times="0",original-location="main"}
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (153) ->(gdb)\n"},"seq":122}
1: (153) ->(gdb)
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (157) 1010: elapsed time 4\n"},"seq":124}
1: (157) 1010: elapsed time 4
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (161) Send Event AD7EngineCreateEvent\n"},"seq":126}
1: (161) Send Event AD7EngineCreateEvent
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (162) Send Event AD7ProgramCreateEvent\n"},"seq":128}
1: (162) Send Event AD7ProgramCreateEvent
--> E (output): {"type":"event","event":"output","body":{"category":"telemetry","output":"VS/Diagnostics/Debugger/Launch","data":{"VS.Diagnostics.Debugger.ImplementationName":"Microsoft.MIDebugEngine","VS.Diagnostics.Debugger.EngineVersion":"17.8.20302.1","VS.Diagnostics.Debugger.HostVersion":"17.8.20302.1","VS.Diagnostics.Debugger.AdapterId":"cppdbg","VS.Diagnostics.Debugger.Launch.Duration":124,"VS.Diagnostics.Debugger.MIMode":"gdb","VS.Diagnostics.Debugger.FrameworkVersion":"6.0.2724.6912"}},"seq":130}
--> R (launch-2): {"type":"response","request_seq":2,"success":true,"command":"launch","body":{},"seq":132}
--> E (initialized): {"type":"event","event":"initialized","body":{},"seq":134}
<--   R (runInTerminal-6) [90 ms]: {"type":"response","seq":3,"command":"runInTerminal","request_seq":6,"success":true,"body":{"shellProcessId":32134}}
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (176) ShellPid=4425\n"},"seq":137}
1: (176) ShellPid=4425
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (177) DebuggerPid=4427\n"},"seq":139}
1: (177) DebuggerPid=4427
<--   C (setBreakpoints-4): {"command":"setBreakpoints","arguments":{"source":{"name":"MhdUtils.cc","path":"/home/ts/src/easyviz-2/vdbclient/src/MhdUtils.cc"},"lines":[],"breakpoints":[],"sourceModified":false},"type":"request","seq":4}
--> R (setBreakpoints-4): {"type":"response","request_seq":4,"success":true,"command":"setBreakpoints","body":{"breakpoints":[]},"seq":142}
<--   C (setFunctionBreakpoints-5): {"command":"setFunctionBreakpoints","arguments":{"breakpoints":[]},"type":"request","seq":5}
--> R (setFunctionBreakpoints-5): {"type":"response","request_seq":5,"success":true,"command":"setFunctionBreakpoints","body":{"breakpoints":[]},"seq":145}
<--   C (setInstructionBreakpoints-6): {"command":"setInstructionBreakpoints","arguments":{"breakpoints":[]},"type":"request","seq":6}
--> R (setInstructionBreakpoints-6): {"type":"response","request_seq":6,"success":true,"command":"setInstructionBreakpoints","body":{"breakpoints":[]},"seq":148}
<--   C (setExceptionBreakpoints-7): {"command":"setExceptionBreakpoints","arguments":{"filters":[],"filterOptions":[]},"type":"request","seq":7}
--> R (setExceptionBreakpoints-7): {"type":"response","request_seq":7,"success":true,"command":"setExceptionBreakpoints","body":{"breakpoints":[]},"seq":151}
<--   C (setDataBreakpoints-8): {"command":"setDataBreakpoints","arguments":{"breakpoints":[]},"type":"request","seq":8}
--> R (setDataBreakpoints-8): {"type":"response","request_seq":8,"success":true,"command":"setDataBreakpoints","body":{"breakpoints":[]},"seq":154}
<--   C (configurationDone-9): {"command":"configurationDone","type":"request","seq":9}
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (264) Send Event AD7LoadCompleteEvent\n"},"seq":158}
1: (264) Send Event AD7LoadCompleteEvent
--> R (configurationDone-9): {"type":"response","request_seq":9,"success":true,"command":"configurationDone","body":{},"seq":157}
--> E (output): {"type":"event","event":"output","body":{"category":"stdout","output":"=thread-group-added,id=\"i1\"\nGNU gdb (GDB) AlmaLinux 12.1-5.el9\nCopyright (C) 2022 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.\nType \"show copying\" and \"show warranty\" for details.\nThis GDB was configured as \"x86_64-redhat-linux-gnu\".\nType \"show configuration\" for configuration details.\nFor bug reporting instructions, please see:\n<https://www.gnu.org/software/gdb/bugs/>.\nFind the GDB manual and other documentation resources online at:\n    <http://www.gnu.org/software/gdb/documentation/>.\n\nFor help, type \"help\".\nType \"apropos word\" to search for commands related to \"word\".\n=cmd-param-changed,param=\"debuginfod enabled\",value=\"on\"\n=cmd-param-changed,param=\"index-cache enabled\",value=\"on\"\n=cmd-param-changed,param=\"pagination\",value=\"off\"\nWarning: Debuggee TargetArchitecture not detected, assuming x86_64.\n"},"seq":161}
=thread-group-added,id="i1"
GNU gdb (GDB) AlmaLinux 12.1-5.el9
Copyright (C) 2022 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".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://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="debuginfod enabled",value="on"
=cmd-param-changed,param="index-cache enabled",value="on"
=cmd-param-changed,param="pagination",value="off"
Warning: Debuggee TargetArchitecture not detected, assuming x86_64.
<--   C (threads-10): {"command":"threads","type":"request","seq":10}
--> R (threads-10): {"type":"response","request_seq":10,"success":true,"command":"threads","body":{"threads":[]},"seq":164}
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (277) <-1011-exec-run\n"},"seq":166}
1: (277) <-1011-exec-run
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (277) ->=thread-group-started,id=\"i1\",pid=\"4453\"\n"},"seq":168}
1: (277) ->=thread-group-started,id="i1",pid="4453"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (277) ->=thread-created,id=\"1\",group-id=\"i1\"\n"},"seq":170}
1: (277) ->=thread-created,id="1",group-id="i1"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (279) <-1012-thread-info 1\n"},"seq":172}
1: (279) <-1012-thread-info 1
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (280) ->=breakpoint-modified,bkpt={number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"0x0000555555556500\",func=\"main\",file=\"../src/echo.c\",fullname=\"/usr/src/debug/coreutils-8.32-35.el9.x86_64/src/echo.c\",line=\"109\",thread-groups=[\"i1\"],times=\"0\",original-location=\"main\"}\n"},"seq":174}
1: (280) ->=breakpoint-modified,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x0000555555556500",func="main",file="../src/echo.c",fullname="/usr/src/debug/coreutils-8.32-35.el9.x86_64/src/echo.c",line="109",thread-groups=["i1"],times="0",original-location="main"}
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (280) ->=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=\"0x00007ffff7fc9090\",to=\"0x00007ffff7feeb43\"}]\n"},"seq":176}
1: (280) ->=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="0x00007ffff7fc9090",to="0x00007ffff7feeb43"}]
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (282) ->1011^running\n"},"seq":178}
1: (282) ->1011^running
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (282) ->*running,thread-id=\"all\"\n"},"seq":180}
1: (282) ->*running,thread-id="all"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (282) ->(gdb)\n"},"seq":182}
1: (282) ->(gdb)
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (282) 1011: elapsed time 5\n"},"seq":184}
1: (282) 1011: elapsed time 5
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (282) ->1012^done,threads=[{id=\"1\",target-id=\"process 4453\",name=\"echo\",state=\"running\",core=\"4\"}]\n"},"seq":186}
1: (282) ->1012^done,threads=[{id="1",target-id="process 4453",name="echo",state="running",core="4"}]
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (283) ->(gdb)\n"},"seq":188}
1: (283) ->(gdb)
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (283) ->~\"Stopped due to shared library event (no libraries added or removed)\\n\"\n"},"seq":190}
1: (283) ->~"Stopped due to shared library event (no libraries added or removed)\n"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (283) ->*stopped,reason=\"solib-event\",thread-id=\"1\",stopped-threads=\"all\",core=\"4\"\n"},"seq":192}
1: (283) ->*stopped,reason="solib-event",thread-id="1",stopped-threads="all",core="4"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (284) 1012: elapsed time 4\n"},"seq":194}
1: (284) 1012: elapsed time 4
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (285) Send Event AD7ProcessInfoUpdatedEvent\n"},"seq":196}
1: (285) Send Event AD7ProcessInfoUpdatedEvent
--> E (process): {"type":"event","event":"process","body":{"startMethod":"launch","name":"/bin/echo","systemProcessId":4453,"pointerSize":64},"seq":198}
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (289) Send Event AD7ThreadCreateEvent\n"},"seq":200}
1: (289) Send Event AD7ThreadCreateEvent
--> E (thread): {"type":"event","event":"thread","body":{"reason":"started","threadId":4453},"seq":202}
--> E (output): {"type":"event","event":"output","body":{"category":"stdout","output":"Stopped due to shared library event (no libraries added or removed)\n"},"seq":204}
Stopped due to shared library event (no libraries added or removed)
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (295) <-1013-interpreter-exec console \"shell echo -e \\\\\\\\033c 1>&2\"\n"},"seq":206}
1: (295) <-1013-interpreter-exec console "shell echo -e \\\\033c 1>&2"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (296) ->1013^done\n"},"seq":208}
1: (296) ->1013^done
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (296) ->(gdb)\n"},"seq":210}
1: (296) ->(gdb)
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (296) 1013: elapsed time 1\n"},"seq":212}
1: (296) 1013: elapsed time 1
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (296) <-1014-gdb-set stop-on-solib-events 0\n"},"seq":214}
1: (296) <-1014-gdb-set stop-on-solib-events 0
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (297) ->1014^done\n"},"seq":216}
1: (297) ->1014^done
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (297) ->(gdb)\n"},"seq":218}
1: (297) ->(gdb)
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (297) 1014: elapsed time 0\n"},"seq":220}
1: (297) 1014: elapsed time 0
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (302) <-1015-interpreter-exec console \"info sharedlibrary\"\n"},"seq":222}
1: (302) <-1015-interpreter-exec console "info sharedlibrary"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (302) ->~\"From                To                  Syms Read   Shared Object Library\\n\"\n"},"seq":224}
1: (302) ->~"From                To                  Syms Read   Shared Object Library\n"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (302) ->~\"0x00007ffff7fc9090  0x00007ffff7feeb43  Yes         /lib64/ld-linux-x86-64.so.2\\n\"\n"},"seq":226}
1: (302) ->~"0x00007ffff7fc9090  0x00007ffff7feeb43  Yes         /lib64/ld-linux-x86-64.so.2\n"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (302) ->1015^done\n"},"seq":228}
1: (302) ->1015^done
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (302) ->(gdb)\n"},"seq":230}
1: (302) ->(gdb)
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (303) 1015: elapsed time 0\n"},"seq":232}
1: (303) 1015: elapsed time 0
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (305) Send Event AD7ModuleLoadEvent\n"},"seq":234}
1: (305) Send Event AD7ModuleLoadEvent
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"Loaded '/lib64/ld-linux-x86-64.so.2'. Symbols loaded.\n"},"seq":236}
Loaded '/lib64/ld-linux-x86-64.so.2'. Symbols loaded.
--> E (module): {"type":"event","event":"module","body":{"reason":"new","module":{"id":1,"name":"ld-linux-x86-64.so.2","path":"/lib64/ld-linux-x86-64.so.2","symbolFilePath":"/lib64/ld-linux-x86-64.so.2","vsLoadAddress":"140737353912464","vsPreferredLoadAddress":"140737353912464","vsModuleSize":154291,"vsLoadOrder":0,"vsTimestampUTC":"1711878774","vsIs64Bit":true}},"seq":238}
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (314) <--exec-continue\n"},"seq":240}
1: (314) <--exec-continue
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (314) ->^running\n"},"seq":242}
1: (314) ->^running
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (314) ->*running,thread-id=\"all\"\n"},"seq":244}
1: (314) ->*running,thread-id="all"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (314) ->(gdb)\n"},"seq":246}
1: (314) ->(gdb)
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (315) ->=library-loaded,id=\"/lib64/libc.so.6\",target-name=\"/lib64/libc.so.6\",host-name=\"/lib64/libc.so.6\",symbols-loaded=\"0\",thread-group=\"i1\",ranges=[{from=\"0x00007ffff7dd4700\",to=\"0x00007ffff7f4740d\"}]\n"},"seq":248}
1: (315) ->=library-loaded,id="/lib64/libc.so.6",target-name="/lib64/libc.so.6",host-name="/lib64/libc.so.6",symbols-loaded="0",thread-group="i1",ranges=[{from="0x00007ffff7dd4700",to="0x00007ffff7f4740d"}]
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (325) ->~\"[Thread debugging using libthread_db enabled]\\n\"\n"},"seq":250}
1: (325) ->~"[Thread debugging using libthread_db enabled]\n"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (325) ->~\"Using host libthread_db library \\\"/lib64/libthread_db.so.1\\\".\\n\"\n"},"seq":252}
1: (325) ->~"Using host libthread_db library \"/lib64/libthread_db.so.1\".\n"
--> E (output): {"type":"event","event":"output","body":{"category":"stdout","output":"[Thread debugging using libthread_db enabled]\n"},"seq":254}
[Thread debugging using libthread_db enabled]
--> E (output): {"type":"event","event":"output","body":{"category":"stdout","output":"Using host libthread_db library \"/lib64/libthread_db.so.1\".\n"},"seq":256}
Using host libthread_db library "/lib64/libthread_db.so.1".
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (326) ->=breakpoint-modified,bkpt={number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"0x0000555555556500\",func=\"main\",file=\"../src/echo.c\",fullname=\"/usr/src/debug/coreutils-8.32-35.el9.x86_64/src/echo.c\",line=\"109\",thread-groups=[\"i1\"],times=\"1\",original-location=\"main\"}\n"},"seq":258}
1: (326) ->=breakpoint-modified,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x0000555555556500",func="main",file="../src/echo.c",fullname="/usr/src/debug/coreutils-8.32-35.el9.x86_64/src/echo.c",line="109",thread-groups=["i1"],times="1",original-location="main"}
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (326) ->~\"\\n\"\n"},"seq":260}
1: (326) ->~"\n"
--> E (output): {"type":"event","event":"output","body":{"category":"stdout","output":"\n"},"seq":262}

--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (326) ->~\"Breakpoint 1, main (argc=2, argv=0x7fffffffd8c8) at ../src/echo.c:109\\n\"\n"},"seq":263}
1: (326) ->~"Breakpoint 1, main (argc=2, argv=0x7fffffffd8c8) at ../src/echo.c:109\n"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (326) ->~\"109\\t{\\n\"\n"},"seq":266}
1: (326) ->~"109\t{\n"
--> E (output): {"type":"event","event":"output","body":{"category":"stdout","output":"Breakpoint 1, main (argc=2, argv=0x7fffffffd8c8) at ../src/echo.c:109\n"},"seq":267}
Breakpoint 1, main (argc=2, argv=0x7fffffffd8c8) at ../src/echo.c:109
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (326) ->*stopped,reason=\"breakpoint-hit\",disp=\"keep\",bkptno=\"1\",frame={addr=\"0x0000555555556500\",func=\"main\",args=[{name=\"argc\",value=\"2\"},{name=\"argv\",value=\"0x7fffffffd8c8\"}],file=\"../src/echo.c\",fullname=\"/usr/src/debug/coreutils-8.32-35.el9.x86_64/src/echo.c\",line=\"109\",arch=\"i386:x86-64\"},thread-id=\"1\",stopped-threads=\"all\",core=\"4\"\n"},"seq":270}
1: (326) ->*stopped,reason="breakpoint-hit",disp="keep",bkptno="1",frame={addr="0x0000555555556500",func="main",args=[{name="argc",value="2"},{name="argv",value="0x7fffffffd8c8"}],file="../src/echo.c",fullname="/usr/src/debug/coreutils-8.32-35.el9.x86_64/src/echo.c",line="109",arch="i386:x86-64"},thread-id="1",stopped-threads="all",core="4"
--> E (output): {"type":"event","event":"output","body":{"category":"stdout","output":"109\t{\n"},"seq":272}
109	{
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (339) <-1016-thread-info\n"},"seq":274}
1: (339) <-1016-thread-info
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (340) ->1016^done,threads=[{id=\"1\",target-id=\"Thread 0x7ffff7da9740 (LWP 4453)\",name=\"echo\",frame={level=\"0\",addr=\"0x0000555555556500\",func=\"main\",args=[{name=\"argc\",value=\"2\"},{name=\"argv\",value=\"0x7fffffffd8c8\"}],file=\"../src/echo.c\",fullname=\"/usr/src/debug/coreutils-8.32-35.el9.x86_64/src/echo.c\",line=\"109\",arch=\"i386:x86-64\"},state=\"stopped\",core=\"4\"}],current-thread-id=\"1\"\n"},"seq":276}
1: (340) ->1016^done,threads=[{id="1",target-id="Thread 0x7ffff7da9740 (LWP 4453)",name="echo",frame={level="0",addr="0x0000555555556500",func="main",args=[{name="argc",value="2"},{name="argv",value="0x7fffffffd8c8"}],file="../src/echo.c",fullname="/usr/src/debug/coreutils-8.32-35.el9.x86_64/src/echo.c",line="109",arch="i386:x86-64"},state="stopped",core="4"}],current-thread-id="1"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (340) ->(gdb)\n"},"seq":278}
1: (340) ->(gdb)
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (340) 1016: elapsed time 1\n"},"seq":280}
1: (340) 1016: elapsed time 1
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (344) <-1017-interpreter-exec console \"info sharedlibrary\"\n"},"seq":282}
1: (344) <-1017-interpreter-exec console "info sharedlibrary"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (344) ->~\"From                To                  Syms Read   Shared Object Library\\n\"\n"},"seq":284}
1: (344) ->~"From                To                  Syms Read   Shared Object Library\n"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (344) ->~\"0x00007ffff7fc9090  0x00007ffff7feeb43  Yes         /lib64/ld-linux-x86-64.so.2\\n\"\n"},"seq":286}
1: (344) ->~"0x00007ffff7fc9090  0x00007ffff7feeb43  Yes         /lib64/ld-linux-x86-64.so.2\n"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (345) ->~\"0x00007ffff7dd4700  0x00007ffff7f4740d  Yes         /lib64/libc.so.6\\n\"\n"},"seq":288}
1: (345) ->~"0x00007ffff7dd4700  0x00007ffff7f4740d  Yes         /lib64/libc.so.6\n"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (345) ->1017^done\n"},"seq":290}
1: (345) ->1017^done
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (345) ->(gdb)\n"},"seq":292}
1: (345) ->(gdb)
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (345) 1017: elapsed time 0\n"},"seq":294}
1: (345) 1017: elapsed time 0
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (345) Send Event AD7ModuleLoadEvent\n"},"seq":296}
1: (345) Send Event AD7ModuleLoadEvent
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"Loaded '/lib64/libc.so.6'. Symbols loaded.\n"},"seq":298}
Loaded '/lib64/libc.so.6'. Symbols loaded.
--> E (module): {"type":"event","event":"module","body":{"reason":"new","module":{"id":2,"name":"libc.so.6","path":"/lib64/libc.so.6","symbolFilePath":"/lib64/libc.so.6","vsLoadAddress":"140737351862016","vsPreferredLoadAddress":"140737351862016","vsModuleSize":1518861,"vsLoadOrder":1,"vsTimestampUTC":"1711878774","vsIs64Bit":true}},"seq":300}
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (348) <-1018-stack-list-frames 0 1000\n"},"seq":302}
1: (348) <-1018-stack-list-frames 0 1000
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (348) ->1018^done,stack=[frame={level=\"0\",addr=\"0x0000555555556500\",func=\"main\",file=\"../src/echo.c\",fullname=\"/usr/src/debug/coreutils-8.32-35.el9.x86_64/src/echo.c\",line=\"109\",arch=\"i386:x86-64\"}]\n"},"seq":304}
1: (348) ->1018^done,stack=[frame={level="0",addr="0x0000555555556500",func="main",file="../src/echo.c",fullname="/usr/src/debug/coreutils-8.32-35.el9.x86_64/src/echo.c",line="109",arch="i386:x86-64"}]
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (348) ->(gdb)\n"},"seq":306}
1: (348) ->(gdb)
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (349) 1018: elapsed time 1\n"},"seq":308}
1: (349) 1018: elapsed time 1
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (354) <-1019-break-delete 1\n"},"seq":310}
1: (354) <-1019-break-delete 1
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (355) ->1019^done\n"},"seq":312}
1: (355) ->1019^done
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (355) ->(gdb)\n"},"seq":314}
1: (355) ->(gdb)
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (355) 1019: elapsed time 0\n"},"seq":316}
1: (355) 1019: elapsed time 0
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (356) Send Event AD7EntryPointEvent\n"},"seq":318}
1: (356) Send Event AD7EntryPointEvent
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (357) <--exec-continue\n"},"seq":320}
1: (357) <--exec-continue
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (357) ->^running\n"},"seq":322}
1: (357) ->^running
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (357) ->*running,thread-id=\"all\"\n"},"seq":324}
1: (357) ->*running,thread-id="all"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (357) ->(gdb)\n"},"seq":326}
1: (357) ->(gdb)
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (357) ->~\"[Inferior 1 (process 4453) exited normally]\\n\"\n"},"seq":328}
1: (357) ->~"[Inferior 1 (process 4453) exited normally]\n"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (357) ->=thread-exited,id=\"1\",group-id=\"i1\"\n"},"seq":330}
1: (357) ->=thread-exited,id="1",group-id="i1"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (357) ->=thread-group-exited,id=\"i1\",exit-code=\"0\"\n"},"seq":332}
1: (357) ->=thread-group-exited,id="i1",exit-code="0"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (358) ->*stopped,reason=\"exited-normally\"\n"},"seq":334}
1: (358) ->*stopped,reason="exited-normally"
--> E (output): {"type":"event","event":"output","body":{"category":"stdout","output":"[Inferior 1 (process 4453) exited normally]\n"},"seq":336}
[Inferior 1 (process 4453) exited normally]
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (359) Send Event AD7ThreadDestroyEvent\n"},"seq":338}
1: (359) Send Event AD7ThreadDestroyEvent
--> E (thread): {"type":"event","event":"thread","body":{"reason":"exited","threadId":4453},"seq":340}
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (359) <--gdb-exit\n"},"seq":342}
1: (359) <--gdb-exit
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (359) ->^exit\n"},"seq":344}
1: (359) ->^exit
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (363) Send Event AD7ProgramDestroyEvent\n"},"seq":346}
1: (363) Send Event AD7ProgramDestroyEvent
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"The program '/bin/echo' has exited with code 0 (0x00000000).\r\n\n"},"seq":348}
The program '/bin/echo' has exited with code 0 (0x00000000).
--> E (exited): {"type":"event","event":"exited","body":{"exitCode":0},"seq":350}
--> E (terminated): {"type":"event","event":"terminated","body":{},"seq":352}
--> E (output): {"type":"event","event":"output","body":{"category":"telemetry","output":"VS/Diagnostics/Debugger/DebugCompleted","data":{"VS.Diagnostics.Debugger.ImplementationName":"Microsoft.MIDebugEngine","VS.Diagnostics.Debugger.EngineVersion":"17.8.20302.1","VS.Diagnostics.Debugger.HostVersion":"17.8.20302.1","VS.Diagnostics.Debugger.AdapterId":"cppdbg","VS.Diagnostics.Debugger.DebugCompleted.BreakCounter":0}},"seq":354}
<--   C (disconnect-11): {"command":"disconnect","arguments":{"restart":false},"type":"request","seq":11}
--> R (disconnect-11): {"type":"response","request_seq":11,"success":true,"command":"disconnect","body":{},"seq":357}


### Other Extensions

_No response_

### Additional Information

_No response_

The debugger logs provided above are accidentally using an overridden gdb:

$ ll ~/.local/bin/gdb
lrwxrwxrwx 1 ts ts 39 Feb 25 18:58 /home/ts/.local/bin/gdb -> /opt/rh/gcc-toolset-13/root/usr/bin/gdb

But behaviour is the same with RHEL 9.4 stock /usr/bin/gdb (GNU gdb (GDB) Red Hat Enterprise Linux 10.2-13.el9)

I can reproduce the behaviour with /usr/bin/gdb on the command line using --interpreter=mi using this string of commands:

  • -gdb-set target-async on
  • -file-exec-and-symbols /bin/echo
  • -exec-arguments foo;bar
  • -exec-run

As can be seen the inferior outputs only foo, not foo;bar:

$ /usr/bin/gdb --interpreter=mi -nx -q
=thread-group-added,id="i1"
(gdb)
-gdb-set target-async on
^done
(gdb)
-file-exec-and-symbols /bin/echo
^done
(gdb)
-exec-arguments foo;bar
^done
(gdb)
-exec-run
=thread-group-started,id="i1",pid="23252"
=thread-created,id="1",group-id="i1"
=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="0x00007ffff7fc9090",to="0x00007ffff7feeb43"}]
^running
*running,thread-id="all"
(gdb)
=library-loaded,id="/lib64/libc.so.6",target-name="/lib64/libc.so.6",host-name="/lib64/libc.so.6",symbols-loaded="0",thread-group="i1",ranges=[{from="0x00007ffff7dd4700",to="0x00007ffff7f4740d"}]
~"[Thread debugging using libthread_db enabled]\n"
~"Using host libthread_db library \"/lib64/libthread_db.so.1\".\n"
foo
~"[Inferior 1 (process 23252) exited normally]\n"
=thread-exited,id="1",group-id="i1"
=thread-group-exited,id="i1",exit-code="0"
*stopped,reason="exited-normally"

If I change -exec-arguments foo;bar to -exec-arguments "foo;bar" then /bin/echo outputs foo;bar.

Hm, I can see with execsnoop that gdb actually uses bash to launch the executable:

$ sudo -E /usr/share/bcc/tools/execsnoop |grep foo
bash             3880    3853      0 /bin/bash -c exec /usr/bin/echo foo;bar
echo             3880    3853      0 /usr/bin/echo foo

This also happens when I just run gdb --args /bin/echo "foo;bar", but here I can see in the execsnoop output that the semicolon gets escaped:

$ sudo -E /usr/share/bcc/tools/execsnoop |grep foo
gdb              5952    16623     0 /usr/bin/gdb --args /bin/echo foo;bar
bash             5974    5952      0 /bin/bash -c exec /usr/bin/echo foo\;bar
echo             5974    5952      0 /usr/bin/echo foo;bar

I also checked qt-creator version 12.0.1 and it has the same behaviour as Visual Studio Code, i.e. the same bug. Now I'm uncertain if this is an issue in Visual Studio Code or gdb.

I can disable gdb's use of a shell with set startup-with-shell off or equivalently in gdb MI lingo -gdb-set startup-with-shell off. Doing this fixes the reported issue.

This means this is not a vscode or vscode-cpptools problem as adding "setupCommands": [ { "text": "-gdb-set startup-with-shell off" }] allows this to be done. Here is the full working configuration:

      {
        "name": "example",
        "type": "cppdbg",
        "request": "launch",
        "program": "/bin/echo",
        "args": [
             "foo;bar"
        ],
        "cwd": "${workspaceFolder}",
        "externalConsole": false,
        "MIMode": "gdb",
        "setupCommands": [ { "text": "-gdb-set startup-with-shell off" }]
      }

Not a vscode-cpptools problem. Closing issue.