Open arturkrutikhin-mars opened 1 year ago
Can you enable debug logs by adding the following to your launch.json.
"logging": {
"engineLogging": true,
"traceResponse": true
}
And share the output from the debug console and share it here?
Now I try to debug this code (source.cpp):
#include <iostream>
#include <string>
using namespace std;
int main() {
cout << "What is your name?" << endl;
string name;
getline(cin, name);
cout <<"Hello, " << name << endl;
}
launch.json:
{
"version": "0.2.0",
"configurations": [
{
"name": "C/C++: g++ build and debug active file",
"type": "cppdbg",
"request": "launch",
"program": "${fileDirname}/${fileBasenameNoExtension}",
"args": [],
"stopAtEntry": false,
"stopAtConnect": true,
"cwd": "${fileDirname}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
},
{
"description": "Set Disassembly Flavor to Intel",
"text": "-gdb-set disassembly-flavor intel",
"ignoreFailures": true
}
],
"preLaunchTask": "C/C++: g++ build active file",
"miDebuggerPath": "/usr/bin/gdb",
"logging": {
"engineLogging": true,
"traceResponse": true
}
}
]
}
c_cpp_properties.json:
{
"configurations": [
{
"name": "Linux",
"includePath": [
"${workspaceFolder}/**"
],
"defines": [],
"cStandard": "c17",
"cppStandard": "c++17",
"intelliSenseMode": "linux-gcc-x64",
"compilerPath": "/usr/bin/gcc"
}
],
"version": 4
}
DEBUG CONSOLE: =thread-group-added,id="i1" GNU gdb (Ubuntu 12.1-0ubuntu1~22.04) 12.1 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-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". Warning: Debuggee TargetArchitecture not detected, assuming x86_64. =cmd-param-changed,param="pagination",value="off" Stopped due to shared library event (no libraries added or removed) Loaded '/lib64/ld-linux-x86-64.so.2'. Symbols loaded.
Program received signal SIGSEGV, Segmentation fault.
0x0000aaaa9aa5ab49 in ?? ()
Execute debugger commands using "-exec
Hi Warden! What I'm doing wrong with launch.json file? I don't clear understand how to configure it. Thanks!
I'm not seeing the logs in your comment. Are you starting your debug session with F5
?
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (99) LaunchOptions{\"name\":\"C/C++: g++ build and debug active file\",\"type\":\"cppdbg\",\"request\":\"launch\",\"program\":\"/home/vboxuser/Projects/source\",\"args\":[],\"stopAtEntry\":true,\"cwd\":\"/home/vboxuser/Projects\",\"environment\":[],\"externalConsole\":false,\"MIMode\":\"gdb\",\"logging\":{\"engineLogging\":true,\"traceResponse\":true},\"setupCommands\":[{\"description\":\"Enable pretty-printing for gdb\",\"text\":\"-enable-pretty-printing\",\"ignoreFailures\":true},{\"description\":\"Set Disassembly Flavor to Intel\",\"text\":\"-gdb-set disassembly-flavor intel\",\"ignoreFailures\":true}],\"preLaunchTask\":\"C/C++: g++ build active file\",\"miDebuggerPath\":\"/usr/bin/gdb\",\"configSource\":\"workspaceFolder\",\"detail\":\"preLaunchTask: C/C++: g++ build active file\",\"existing\":true,\"isDefault\":true,\"debuggerEvent\":\"playButton\",\"debugType\":\"run\",\"sessionId\":\"df80bcae-1aec-43d3-8f1d-0c5ce9287c1f\"}\n"},"seq":2}
1: (99) LaunchOptions{"name":"C/C++: g++ build and debug active file","type":"cppdbg","request":"launch","program":"/home/vboxuser/Projects/source","args":[],"stopAtEntry":true,"cwd":"/home/vboxuser/Projects","environment":[],"externalConsole":false,"MIMode":"gdb","logging":{"engineLogging":true,"traceResponse":true},"setupCommands":[{"description":"Enable pretty-printing for gdb","text":"-enable-pretty-printing","ignoreFailures":true},{"description":"Set Disassembly Flavor to Intel","text":"-gdb-set disassembly-flavor intel","ignoreFailures":true}],"preLaunchTask":"C/C++: g++ build active file","miDebuggerPath":"/usr/bin/gdb","configSource":"workspaceFolder","detail":"preLaunchTask: C/C++: g++ build active file","existing":true,"isDefault":true,"debuggerEvent":"playButton","debugType":"run","sessionId":"df80bcae-1aec-43d3-8f1d-0c5ce9287c1f"}
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (159) DbgCmd:echo $$ > /tmp/Microsoft-MIEngine-Pid-0yhzbv0y.rpj ; cd \"/home/vboxuser/Projects\" ; DbgTerm=tty
; set -o monitor ; trap 'rm \"/tmp/Microsoft-MIEngine-In-s3jueqw2.lkc\" \"/tmp/Microsoft-MIEngine-Out-hhi3gwrj.5hg\" \"/tmp/Microsoft-MIEngine-Pid-0yhzbv0y.rpj\" \"/tmp/Microsoft-MIEngine-Cmd-u51mvldt.5c0\"' EXIT ; \"/usr/bin/gdb\" --interpreter=mi --tty=$DbgTerm < \"/tmp/Microsoft-MIEngine-In-s3jueqw2.lkc\" > \"/tmp/Microsoft-MIEngine-Out-hhi3gwrj.5hg\" & clear; pid=$! ; echo $pid > \"/tmp/Microsoft-MIEngine-Pid-0yhzbv0y.rpj\" ; wait $pid; \n"},"seq":4}
1: (159) DbgCmd:echo $$ > /tmp/Microsoft-MIEngine-Pid-0yhzbv0y.rpj ; cd "/home/vboxuser/Projects" ; DbgTerm=tty
; set -o monitor ; trap 'rm "/tmp/Microsoft-MIEngine-In-s3jueqw2.lkc" "/tmp/Microsoft-MIEngine-Out-hhi3gwrj.5hg" "/tmp/Microsoft-MIEngine-Pid-0yhzbv0y.rpj" "/tmp/Microsoft-MIEngine-Cmd-u51mvldt.5c0"' EXIT ; "/usr/bin/gdb" --interpreter=mi --tty=$DbgTerm < "/tmp/Microsoft-MIEngine-In-s3jueqw2.lkc" > "/tmp/Microsoft-MIEngine-Out-hhi3gwrj.5hg" & clear; pid=$! ; echo $pid > "/tmp/Microsoft-MIEngine-Pid-0yhzbv0y.rpj" ; wait $pid;
--> C (runInTerminal-6): {"type":"request","command":"runInTerminal","arguments":{"kind":"integrated","title":"cppdbg: source","cwd":"","args":["/bin/sh","/tmp/Microsoft-MIEngine-Cmd-u51mvldt.5c0"],"env":{}},"seq":6}
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (177) Wait for connection completion.\n"},"seq":8}
1: (177) Wait for connection completion.
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (2179) ->=thread-group-added,id=\"i1\"\n"},"seq":10}
1: (2179) ->=thread-group-added,id="i1"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (2186) ->~\"GNU gdb (Ubuntu 12.1-0ubuntu1~22.04) 12.1\n\"\n"},"seq":12}
1: (2186) ->~"GNU gdb (Ubuntu 12.1-0ubuntu1~22.04) 12.1\n"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (2186) ->~\"Copyright (C) 2022 Free Software Foundation, Inc.\n\"\n"},"seq":14}
1: (2186) ->~"Copyright (C) 2022 Free Software Foundation, Inc.\n"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (2186) ->~\"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: (2186) ->~"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: (2186) ->~\"\nType \\"show copying\\" and \\"show warranty\\" for details.\n\"\n"},"seq":18}
1: (2186) ->~"\nType \"show copying\" and \"show warranty\" for details.\n"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (2186) ->~\"This GDB was configured as \\"x86_64-linux-gnu\\".\n\"\n"},"seq":20}
1: (2186) ->~"This GDB was configured as \"x86_64-linux-gnu\".\n"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (2186) ->~\"Type \\"show configuration\\" for configuration details.\n\"\n"},"seq":22}
1: (2186) ->~"Type \"show configuration\" for configuration details.\n"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (2186) ->~\"For bug reporting instructions, please see:\n\"\n"},"seq":24}
1: (2186) ->~"For bug reporting instructions, please see:\n"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (2187) ->~\"https://www.gnu.org/software/gdb/bugs/.\n\"\n"},"seq":26}
1: (2187) ->~"https://www.gnu.org/software/gdb/bugs/.\n"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (2187) ->~\"Find the GDB manual and other documentation resources online at:\n http://www.gnu.org/software/gdb/documentation/.\"\n"},"seq":28}
1: (2187) ->~"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: (2187) ->~\"\n\n\"\n"},"seq":30}
1: (2187) ->~"\n\n"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (2187) ->~\"For help, type \\"help\\".\n\"\n"},"seq":32}
1: (2187) ->~"For help, type \"help\".\n"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (2187) ->~\"Type \\"apropos word\\" to search for commands related to \\"word\\".\n\"\n"},"seq":34}
1: (2187) ->~"Type \"apropos word\" to search for commands related to \"word\".\n"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (2190) ->(gdb)\n"},"seq":36}
1: (2190) ->(gdb)
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (2201) <-1001-gdb-set mi-async on\n"},"seq":38}
1: (2201) <-1001-gdb-set mi-async on
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (2209) ->1001^done\n"},"seq":40}
1: (2209) ->1001^done
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (2210) ->(gdb)\n"},"seq":42}
1: (2210) ->(gdb)
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (2221) 1001: elapsed time 21\n"},"seq":44}
1: (2221) 1001: elapsed time 21
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (2239) <-1002-enable-pretty-printing\n"},"seq":46}
1: (2239) <-1002-enable-pretty-printing
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (2239) ->1002^done\n"},"seq":48}
1: (2239) ->1002^done
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (2239) ->(gdb)\n"},"seq":50}
1: (2239) ->(gdb)
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (2245) 1002: elapsed time 5\n"},"seq":52}
1: (2245) 1002: elapsed time 5
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (2245) <-1003-gdb-set disassembly-flavor intel\n"},"seq":54}
1: (2245) <-1003-gdb-set disassembly-flavor intel
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (2245) ->1003^done\n"},"seq":56}
1: (2245) ->1003^done
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (2245) ->(gdb)\n"},"seq":58}
1: (2245) ->(gdb)
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (2249) 1003: elapsed time 3\n"},"seq":60}
1: (2249) 1003: elapsed time 3
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (2249) <-1004-interpreter-exec console \"set pagination off\"\n"},"seq":62}
1: (2249) <-1004-interpreter-exec console "set pagination off"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (2249) ->=cmd-param-changed,param=\"pagination\",value=\"off\"\n"},"seq":64}
1: (2249) ->=cmd-param-changed,param="pagination",value="off"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (2249) ->1004^done\n"},"seq":66}
1: (2249) ->1004^done
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (2249) ->(gdb)\n"},"seq":68}
1: (2249) ->(gdb)
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (2254) 1004: elapsed time 5\n"},"seq":70}
1: (2254) 1004: elapsed time 5
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (2255) <-1005-gdb-set auto-solib-add on\n"},"seq":72}
1: (2255) <-1005-gdb-set auto-solib-add on
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (2255) ->1005^done\n"},"seq":74}
1: (2255) ->1005^done
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (2255) ->(gdb)\n"},"seq":76}
1: (2255) ->(gdb)
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (2255) 1005: elapsed time 0\n"},"seq":78}
1: (2255) 1005: elapsed time 0
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (2255) <-1006-gdb-set solib-search-path /home/vboxuser/Projects:\n"},"seq":80}
1: (2255) <-1006-gdb-set solib-search-path /home/vboxuser/Projects:
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (2256) ->1006^done\n"},"seq":82}
1: (2256) ->1006^done
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (2256) ->(gdb)\n"},"seq":84}
1: (2256) ->(gdb)
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (2256) 1006: elapsed time 0\n"},"seq":86}
1: (2256) 1006: elapsed time 0
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (2256) <-1007-gdb-set stop-on-solib-events 1\n"},"seq":88}
1: (2256) <-1007-gdb-set stop-on-solib-events 1
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (2258) ->1007^done\n"},"seq":90}
1: (2258) ->1007^done
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (2258) ->(gdb)\n"},"seq":92}
1: (2258) ->(gdb)
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (2258) 1007: elapsed time 1\n"},"seq":94}
1: (2258) 1007: elapsed time 1
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (2258) <-1008-environment-cd /home/vboxuser/Projects\n"},"seq":96}
1: (2258) <-1008-environment-cd /home/vboxuser/Projects
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (2258) ->1008^done\n"},"seq":98}
1: (2258) ->1008^done
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (2259) ->(gdb)\n"},"seq":100}
1: (2259) ->(gdb)
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (2259) 1008: elapsed time 0\n"},"seq":102}
1: (2259) 1008: elapsed time 0
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (2259) <-1009-file-exec-and-symbols /home/vboxuser/Projects/source\n"},"seq":104}
1: (2259) <-1009-file-exec-and-symbols /home/vboxuser/Projects/source
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (2263) ->1009^done\n"},"seq":106}
1: (2263) ->1009^done
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (2264) ->(gdb)\n"},"seq":108}
1: (2264) ->(gdb)
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (2264) 1009: elapsed time 5\n"},"seq":110}
1: (2264) 1009: elapsed time 5
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (2265) <-1010-interpreter-exec console \"show architecture\"\n"},"seq":112}
1: (2265) <-1010-interpreter-exec console "show architecture"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (2266) ->~\"The target architecture is set to \\"auto\\" (currently \\"i386:x86-64\\").\n\"\n"},"seq":114}
1: (2266) ->~"The target architecture is set to \"auto\" (currently \"i386:x86-64\").\n"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (2266) ->1010^done\n"},"seq":116}
1: (2266) ->1010^done
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (2266) ->(gdb)\n"},"seq":118}
1: (2266) ->(gdb)
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (2270) 1010: elapsed time 4\n"},"seq":120}
1: (2270) 1010: elapsed time 4
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (2279) <-1011-break-insert -f main\n"},"seq":122}
1: (2279) <-1011-break-insert -f main
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (2285) ->1011^done,bkpt={number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"0x0000000000001276\",func=\"main()\",file=\"/home/vboxuser/Projects/source.cpp\",fullname=\"/home/vboxuser/Projects/source.cpp\",line=\"6\",thread-groups=[\"i1\"],times=\"0\",original-location=\"main\"}\n"},"seq":124}
1: (2285) ->1011^done,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x0000000000001276",func="main()",file="/home/vboxuser/Projects/source.cpp",fullname="/home/vboxuser/Projects/source.cpp",line="6",thread-groups=["i1"],times="0",original-location="main"}
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (2285) ->(gdb)\n"},"seq":126}
1: (2285) ->(gdb)
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (2311) 1011: elapsed time 31\n"},"seq":128}
1: (2311) 1011: elapsed time 31
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (2317) Send Event AD7EngineCreateEvent\n"},"seq":130}
1: (2317) Send Event AD7EngineCreateEvent
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (2318) Send Event AD7ProgramCreateEvent\n"},"seq":132}
1: (2318) 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.4.30208.2","VS.Diagnostics.Debugger.HostVersion":"17.4.30208.2","VS.Diagnostics.Debugger.AdapterId":"cppdbg","VS.Diagnostics.Debugger.Launch.Duration":2247,"VS.Diagnostics.Debugger.Launch.IsNoDebug":true,"VS.Diagnostics.Debugger.MIMode":"gdb","VS.Diagnostics.Debugger.FrameworkVersion":"6.0.1322.58009"}},"seq":134}
--> R (launch-2): {"type":"response","request_seq":2,"success":true,"command":"launch","body":{},"seq":136}
--> E (initialized): {"type":"event","event":"initialized","body":{},"seq":138}
<-- R (runInTerminal-6) [3026 ms]: {"type":"response","seq":3,"command":"runInTerminal","request_seq":6,"success":true,"body":{"shellProcessId":8809}}
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (3271) ShellPid=8825\n"},"seq":141}
1: (3271) ShellPid=8825
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (3287) DebuggerPid=8827\n"},"seq":143}
1: (3287) DebuggerPid=8827
<-- C (configurationDone-4): {"command":"configurationDone","type":"request","seq":4}
--> R (configurationDone-4): {"type":"response","request_seq":4,"success":true,"command":"configurationDone","body":{},"seq":146}
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (3353) Send Event AD7LoadCompleteEvent\n"},"seq":148}
1: (3353) Send Event AD7LoadCompleteEvent
--> E (output): {"type":"event","event":"output","body":{"category":"stdout","output":"=thread-group-added,id=\"i1\"\nGNU gdb (Ubuntu 12.1-0ubuntu1~22.04) 12.1\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-linux-gnu\".\nType \"show configuration\" for configuration details.\nFor bug reporting instructions, please see:\nhttps://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\".\nWarning: Debuggee TargetArchitecture not detected, assuming x86_64.\n=cmd-param-changed,param=\"pagination\",value=\"off\"\n"},"seq":150}
=thread-group-added,id="i1"
GNU gdb (Ubuntu 12.1-0ubuntu1~22.04) 12.1
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-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". Warning: Debuggee TargetArchitecture not detected, assuming x86_64. =cmd-param-changed,param="pagination",value="off" --> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (3408) <-1012-exec-run\n"},"seq":152} 1: (3408) <-1012-exec-run --> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (3415) ->=thread-group-started,id=\"i1\",pid=\"8847\"\n"},"seq":154} 1: (3415) ->=thread-group-started,id="i1",pid="8847" --> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (3415) ->=thread-created,id=\"1\",group-id=\"i1\"\n"},"seq":156} 1: (3415) ->=thread-created,id="1",group-id="i1" --> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (3415) ->=breakpoint-modified,bkpt={number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"0x0000555555555276\",func=\"main()\",file=\"/home/vboxuser/Projects/source.cpp\",fullname=\"/home/vboxuser/Projects/source.cpp\",line=\"6\",thread-groups=[\"i1\"],times=\"0\",original-location=\"main\"}\n"},"seq":158} 1: (3415) ->=breakpoint-modified,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x0000555555555276",func="main()",file="/home/vboxuser/Projects/source.cpp",fullname="/home/vboxuser/Projects/source.cpp",line="6",thread-groups=["i1"],times="0",original-location="main"} --> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (3415) ->=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=\"0x00007ffff7fc5090\",to=\"0x00007ffff7fee335\"}]\n"},"seq":160} 1: (3415) ->=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="0x00007ffff7fc5090",to="0x00007ffff7fee335"}] --> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (3440) <-1013-thread-info 1\n"},"seq":162} 1: (3440) <-1013-thread-info 1 --> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (3453) ->1012^running\n"},"seq":164} 1: (3453) ->1012^running --> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (3453) ->running,thread-id=\"all\"\n"},"seq":166} 1: (3453) ->running,thread-id="all" --> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (3453) ->(gdb)\n"},"seq":168} 1: (3453) ->(gdb) --> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (3453) ->~\"Stopped due to shared library event (no libraries added or removed)\n\"\n"},"seq":170} 1: (3453) ->~"Stopped due to shared library event (no libraries added or removed)\n" --> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (3453) ->stopped,reason=\"solib-event\",thread-id=\"1\",stopped-threads=\"all\",core=\"0\"\n"},"seq":172} 1: (3453) ->stopped,reason="solib-event",thread-id="1",stopped-threads="all",core="0" --> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (3453) ->1013^done,threads=[{id=\"1\",target-id=\"process 8847\",name=\"source\",frame={level=\"0\",addr=\"0x00007ffff7fc6300\",func=\"GIdl_debug_state\",args=[],file=\"./elf/dl-debug.c\",fullname=\"./elf/./elf/dl-debug.c\",line=\"116\",arch=\"i386:x86-64\"},state=\"stopped\",core=\"0\"}]\n"},"seq":174} 1: (3453) ->1013^done,threads=[{id="1",target-id="process 8847",name="source",frame={level="0",addr="0x00007ffff7fc6300",func="GIdl_debug_state",args=[],file="./elf/dl-debug.c",fullname="./elf/./elf/dl-debug.c",line="116",arch="i386:x86-64"},state="stopped",core="0"}] --> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (3453) ->(gdb)\n"},"seq":176} 1: (3453) ->(gdb) --> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (3472) 1012: elapsed time 64\n"},"seq":178} 1: (3472) 1012: elapsed time 64 --> E (output): {"type":"event","event":"output","body":{"category":"stdout","output":"Stopped due to shared library event (no libraries added or removed)\n"},"seq":180} Stopped due to shared library event (no libraries added or removed) --> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (3539) 1013: elapsed time 99\n"},"seq":182} 1: (3539) 1013: elapsed time 99 --> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (3561) <-1014-interpreter-exec console \"shell echo -e \\\\033c 1>&2\"\n"},"seq":184} 1: (3561) <-1014-interpreter-exec console "shell echo -e \\033c 1>&2" --> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (3567) ->1014^done\n"},"seq":186} 1: (3567) ->1014^done --> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (3567) ->(gdb)\n"},"seq":188} 1: (3567) ->(gdb) --> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (3572) Send Event AD7ProcessInfoUpdatedEvent\n"},"seq":190} 1: (3572) Send Event AD7ProcessInfoUpdatedEvent --> E (process): {"type":"event","event":"process","body":{"startMethod":"launch","name":"/home/vboxuser/Projects/source","systemProcessId":8847,"pointerSize":64},"seq":192} --> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (3638) Send Event AD7ThreadCreateEvent\n"},"seq":194} 1: (3638) Send Event AD7ThreadCreateEvent --> E (thread): {"type":"event","event":"thread","body":{"reason":"started","threadId":8847},"seq":196} --> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (3677) 1014: elapsed time 115\n"},"seq":198} 1: (3677) 1014: elapsed time 115 --> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (3681) <-1015-gdb-set stop-on-solib-events 0\n"},"seq":200} 1: (3681) <-1015-gdb-set stop-on-solib-events 0 --> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (3689) ->1015^done\n"},"seq":202} 1: (3689) ->1015^done --> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (3689) ->(gdb)\n"},"seq":204} 1: (3689) ->(gdb) --> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (3690) 1015: elapsed time 9\n"},"seq":206} 1: (3690) 1015: elapsed time 9 --> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (3740) <-1016-interpreter-exec console \"info sharedlibrary\"\n"},"seq":208} 1: (3740) <-1016-interpreter-exec console "info sharedlibrary" --> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (3745) ->~\"From To Syms Read Shared Object Library\n\"\n"},"seq":210} 1: (3745) ->~"From To Syms Read Shared Object Library\n" --> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (3746) ->~\"0x00007ffff7fc5090 0x00007ffff7fee335 Yes /lib64/ld-linux-x86-64.so.2\n\"\n"},"seq":212} 1: (3746) ->~"0x00007ffff7fc5090 0x00007ffff7fee335 Yes /lib64/ld-linux-x86-64.so.2\n" --> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (3746) ->1016^done\n"},"seq":214} 1: (3746) ->1016^done --> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (3746) ->(gdb)\n"},"seq":216} 1: (3746) ->(gdb) --> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (3748) 1016: elapsed time 8\n"},"seq":218} 1: (3748) 1016: elapsed time 8 --> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (3761) Send Event AD7ModuleLoadEvent\n"},"seq":220} 1: (3761) 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":222} 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":"140737353896080","vsPreferredLoadAddress":"140737353896080","vsModuleSize":168613,"vsLoadOrder":0,"vsTimestampUTC":"1688827604","vsIs64Bit":true}},"seq":224} --> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (3835) <--exec-continue\n"},"seq":226} 1: (3835) <--exec-continue --> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (3838) ->^running\n"},"seq":228} 1: (3838) ->^running --> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (3838) ->running,thread-id=\"all\"\n"},"seq":230} 1: (3838) ->running,thread-id="all" --> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (3838) ->(gdb)\n"},"seq":232} 1: (3838) ->(gdb) --> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (3838) ->~\"\nProgram\"\n"},"seq":234} 1: (3838) ->~"\nProgram" --> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (3838) ->~\" received signal SIGSEGV, Segmentation fault.\n\"\n"},"seq":236} 1: (3838) ->~" received signal SIGSEGV, Segmentation fault.\n" --> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (3838) ->~\"0x0000aaaa9aa5ab49 in ?? ()\n\"\n"},"seq":238} 1: (3838) ->~"0x0000aaaa9aa5ab49 in ?? ()\n" --> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (3838) ->stopped,reason=\"signal-received\",signal-name=\"SIGSEGV\",signal-meaning=\"Segmentation fault\",frame={addr=\"0x0000aaaa9aa5ab49\",func=\"??\",args=[],arch=\"i386:x86-64\"},thread-id=\"1\",stopped-threads=\"all\",core=\"0\"\n"},"seq":240} 1: (3838) ->stopped,reason="signal-received",signal-name="SIGSEGV",signal-meaning="Segmentation fault",frame={addr="0x0000aaaa9aa5ab49",func="??",args=[],arch="i386:x86-64"},thread-id="1",stopped-threads="all",core="0" --> E (output): {"type":"event","event":"output","body":{"category":"stdout","output":"\nProgram"},"seq":242}
Program
--> E (output): {"type":"event","event":"output","body":{"category":"stdout","output":" received signal SIGSEGV, Segmentation fault.\n"},"seq":244}
received signal SIGSEGV, Segmentation fault.
--> E (output): {"type":"event","event":"output","body":{"category":"stdout","output":"0x0000aaaa9aa5ab49 in ?? ()\n"},"seq":246}
0x0000aaaa9aa5ab49 in ?? ()
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (4057) <-1017-thread-info\n"},"seq":248}
1: (4057) <-1017-thread-info
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (4057) ->1017^done,threads=[{id=\"1\",target-id=\"process 8847\",name=\"source\",frame={level=\"0\",addr=\"0x0000aaaa9aa5ab49\",func=\"??\",args=[],arch=\"i386:x86-64\"},state=\"stopped\",core=\"0\"}],current-thread-id=\"1\"\n"},"seq":250}
1: (4057) ->1017^done,threads=[{id="1",target-id="process 8847",name="source",frame={level="0",addr="0x0000aaaa9aa5ab49",func="??",args=[],arch="i386:x86-64"},state="stopped",core="0"}],current-thread-id="1"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (4057) ->(gdb)\n"},"seq":252}
1: (4057) ->(gdb)
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (4064) 1017: elapsed time 7\n"},"seq":254}
1: (4064) 1017: elapsed time 7
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (4163) <-1018-stack-list-frames 0 1000\n"},"seq":256}
1: (4163) <-1018-stack-list-frames 0 1000
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (4178) ->1018^done,stack=[frame={level=\"0\",addr=\"0x0000aaaa9aa5ab49\",func=\"??\",arch=\"i386:x86-64\"},frame={level=\"1\",addr=\"0x00007ffff7fe636c\",func=\"dl_main\",file=\"./elf/rtld.c\",fullname=\"./elf/./elf/rtld.c\",line=\"1868\",arch=\"i386:x86-64\"},frame={level=\"2\",addr=\"0x00007ffff7fe285c\",func=\"_dl_sysdep_start\",file=\"../elf/dl-sysdep.c\",fullname=\"./elf/../elf/dl-sysdep.c\",line=\"256\",arch=\"i386:x86-64\"},frame={level=\"3\",addr=\"0x00007ffff7fe45b8\",func=\"_dl_start_final\",file=\"./elf/rtld.c\",fullname=\"./elf/./elf/rtld.c\",line=\"507\",arch=\"i386:x86-64\"},frame={level=\"4\",addr=\"0x00007ffff7fe45b8\",func=\"_dl_start\",file=\"./elf/rtld.c\",fullname=\"./elf/./elf/rtld.c\",line=\"596\",arch=\"i386:x86-64\"},frame={level=\"5\",addr=\"0x00007ffff7fe32b8\",func=\"_start\",from=\"/lib64/ld-linux-x86-64.so.2\",arch=\"i386:x86-64\"},frame={level=\"6\",addr=\"0x0000000000000001\",func=\"??\",arch=\"i386:x86-64\"},frame={level=\"7\",addr=\"0x00007fffffffe24d\",func=\"??\",arch=\"i386:x86-64\"},frame={level=\"8\",addr=\"0x0000000000000000\",func=\"??\",arch=\"i386:x86-64\"}]\n"},"seq":258}
1: (4178) ->1018^done,stack=[frame={level="0",addr="0x0000aaaa9aa5ab49",func="??",arch="i386:x86-64"},frame={level="1",addr="0x00007ffff7fe636c",func="dl_main",file="./elf/rtld.c",fullname="./elf/./elf/rtld.c",line="1868",arch="i386:x86-64"},frame={level="2",addr="0x00007ffff7fe285c",func="_dl_sysdep_start",file="../elf/dl-sysdep.c",fullname="./elf/../elf/dl-sysdep.c",line="256",arch="i386:x86-64"},frame={level="3",addr="0x00007ffff7fe45b8",func="_dl_start_final",file="./elf/rtld.c",fullname="./elf/./elf/rtld.c",line="507",arch="i386:x86-64"},frame={level="4",addr="0x00007ffff7fe45b8",func="_dl_start",file="./elf/rtld.c",fullname="./elf/./elf/rtld.c",line="596",arch="i386:x86-64"},frame={level="5",addr="0x00007ffff7fe32b8",func="_start",from="/lib64/ld-linux-x86-64.so.2",arch="i386:x86-64"},frame={level="6",addr="0x0000000000000001",func="??",arch="i386:x86-64"},frame={level="7",addr="0x00007fffffffe24d",func="??",arch="i386:x86-64"},frame={level="8",addr="0x0000000000000000",func="??",arch="i386:x86-64"}]
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (4178) ->(gdb)\n"},"seq":260}
1: (4178) ->(gdb)
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (4182) 1018: elapsed time 19\n"},"seq":262}
1: (4182) 1018: elapsed time 19
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (4223) Send Event AD7ExceptionEvent\n"},"seq":264}
1: (4223) Send Event AD7ExceptionEvent
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"Execute debugger commands using \"-exec
It seems I got it) Launch.json:
{
"version": "2.0.0",
"configurations": [
{
"name": "C/C++: g++ build and debug active file",
"type": "cppdbg",
"request": "launch",
"program": "${fileDirname}/${fileBasenameNoExtension}",
"args": [],
"stopAtEntry": true,
"cwd": "${fileDirname}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
},
{
"description": "Set Disassembly Flavor to Intel",
"text": "-gdb-set disassembly-flavor intel",
"ignoreFailures": true
}
],
"preLaunchTask": "C/C++: g++ build active file",
"miDebuggerPath": "/usr/bin/gdb",
"logging": {
"engineLogging": true,
"traceResponse": true
}
}
],
"logging": {
"engineLogging": true,
"traceResponse": true
}
}
What's wrong with this launch.json file? Why the debugger does not stop and highlight the breakpoints? When I press Step-In I receive this message:
<-- C (stepIn-11): {"command":"stepIn","arguments":{"threadId":9091},"type":"request","seq":11} --> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (94262) <-1043-exec-step\n"},"seq":489} 1: (94262) <-1043-exec-step --> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (94262) ->1043^error,msg=\"Cannot find bounds of current function\"\n"},"seq":491} 1: (94262) ->1043^error,msg="Cannot find bounds of current function" --> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (94263) ->(gdb)\n"},"seq":493} 1: (94263) ->(gdb) --> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (94263) 1043: elapsed time 1\n"},"seq":495} 1: (94263) 1043: elapsed time 1 --> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (94264) Send Event AD7MessageEvent\n"},"seq":497} 1: (94264) Send Event AD7MessageEvent --> E (output): {"type":"event","event":"output","body":{"category":"stderr","output":"ERROR: Unexpected GDB output from command \"-exec-step\". Cannot find bounds of current function\n"},"seq":499} ERROR: Unexpected GDB output from command "-exec-step". Cannot find bounds of current function --> R (stepIn-11): {"type":"response","request_seq":11,"success":false,"command":"stepIn","message":"Unable to step in. Operation failed with error code 0x80004004.","body":{},"seq":501}
Hi Warden! Can you help me?
HI! I configured VS Code on Ubuntu on Virtual Box (Host - MacOs, MacBook Pro) as it is written here: https://code.visualstudio.com/docs/cpp/config-linux But when I tried to debug the breakpoint was not highlighted at all and the following errors appeared: In Debug Console:
"Warning: Debuggee TargetArchitecture not detected, assuming x86_64. =cmd-param-changed,param="pagination",value="off" Stopped due to shared library event (no libraries added or removed) Loaded '/lib64/ld-linux-x86-64.so.2'. Symbols loaded. Program received signal SIGSEGV, Segmentation fault. 0x0000aaaa9aa598a9 in ?? ()" And when push "Step Into" or "Step Over", etc. it shows another error: "Unable to step in. Operation failed with error code 0x80004004." Could you please help me to fix this issue?! Thank you!