Vscode ignoring breakpoints (c++ code) #9103
fellipe-carvalho-de-oliveira
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm trying to debug my .cpp files using a Makefile, but Vscode is ignoring breakpoints!
Can anyone help me handling this, please?
My tasks.json, launch.json are:
tasks.json
{
"version": "2.0.0",
"tasks": [
{
"label": "Build",
"type": "shell",
"command": "make clean && make",
"group": "build",
"problemMatcher": {
"owner": "cpp",
"fileLocation": [
"relative",
"${workspaceFolder}/examples/pcsaft/cpp/metanol_1_octanol"
],
"pattern": {
"regexp": "^(.):(\d+):(\d+):\s+(warning|error):\s+(.)$",
"file": 1,
"line": 2,
"column": 3,
"severity": 4,
"message": 5
}
},
"options": {
"cwd": "${workspaceFolder}/examples/pcsaft/cpp/metanol_1_octanol/"
}
}
]
}
launch.json
{
"configurations": [
{
"name": "(gdb) PCSAFT",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/examples/pcsaft/cpp/metanol_1_octanol/main",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}/examples/pcsaft/cpp/metanol_1_octanol",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"logging": { "trace": true, "traceResponse": true },
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
},
],
}
launch.json log is:
--> C (runInTerminal-2): {"type":"request","command":"runInTerminal","arguments":{"kind":"integrated","title":"cppdbg: main","cwd":"","args":["/bin/sh","/tmp/Microsoft-MIEngine-Cmd-q4o1d4ua.pan"],"env":{}},"seq":2}
--> 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.1.20308.3","VS.Diagnostics.Debugger.HostVersion":"17.1.20308.3","VS.Diagnostics.Debugger.AdapterId":"cppdbg","VS.Diagnostics.Debugger.Launch.Duration":282,"VS.Diagnostics.Debugger.MIMode":"gdb","VS.Diagnostics.Debugger.FrameworkVersion":"6.0.222.6406"}},"seq":4}
--> R (launch-2): {"type":"response","request_seq":2,"success":true,"command":"launch","body":{},"seq":6}
--> E (initialized): {"type":"event","event":"initialized","body":{},"seq":8}
<-- R (runInTerminal-2) [245 ms]: {"type":"response","seq":3,"command":"runInTerminal","request_seq":2,"success":true,"body":{"shellProcessId":56187}}
<-- C (setBreakpoints-4): {"command":"setBreakpoints","arguments":{"source":{"name":"main.cpp","path":"/home/fellipe/Dropbox/Pessoais/pos doc/Programas Pós Doc/examples/pcsaft/cpp/metanol_1_octanol/main.cpp"},"lines":[11],"breakpoints":[{"line":11}],"sourceModified":false},"type":"request","seq":4}
--> R (setBreakpoints-4): {"type":"response","request_seq":4,"success":true,"command":"setBreakpoints","body":{"breakpoints":[{"id":1,"verified":false,"message":"Error setting breakpoint. ","line":11,"BoundBreakpoints":[]}]},"seq":12}
--> E (breakpoint): {"type":"event","event":"breakpoint","body":{"reason":"changed","breakpoint":{"id":1,"verified":false,"message":"Module containing this breakpoint has not yet loaded or the breakpoint address could not be obtained.","line":11,"BoundBreakpoints":[]}},"seq":14}
<-- 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":17}
<-- C (setDataBreakpoints-6): {"command":"setDataBreakpoints","arguments":{"breakpoints":[]},"type":"request","seq":6}
--> R (setDataBreakpoints-6): {"type":"response","request_seq":6,"success":true,"command":"setDataBreakpoints","body":{"breakpoints":[]},"seq":20}
<-- C (setInstructionBreakpoints-7): {"command":"setInstructionBreakpoints","arguments":{"breakpoints":[]},"type":"request","seq":7}
--> R (setInstructionBreakpoints-7): {"type":"response","request_seq":7,"success":true,"command":"setInstructionBreakpoints","body":{"breakpoints":[]},"seq":23}
<-- C (setExceptionBreakpoints-8): {"command":"setExceptionBreakpoints","arguments":{"filters":[],"filterOptions":[]},"type":"request","seq":8}
--> R (setExceptionBreakpoints-8): {"type":"response","request_seq":8,"success":true,"command":"setExceptionBreakpoints","body":{},"seq":26}
<-- C (configurationDone-9): {"command":"configurationDone","type":"request","seq":9}
--> E (output): {"type":"event","event":"output","body":{"category":"stdout","output":"=thread-group-added,id="i1"\nGNU gdb (Ubuntu 9.2-0ubuntu1
20.04.1) 9.2\nCopyright (C) 2020 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:\nhttp://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".\nFile(s) bits/*.h will be skipped when stepping.\nWarning: Debuggee TargetArchitecture not detected, assuming x86_64.\n=cmd-param-changed,param="pagination",value="off"\n"},"seq":30}20.04.1) 9.2=thread-group-added,id="i1"
GNU gdb (Ubuntu 9.2-0ubuntu1
Copyright (C) 2020 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".
File(s) bits/*.h will be skipped when stepping.
Warning: Debuggee TargetArchitecture not detected, assuming x86_64.
=cmd-param-changed,param="pagination",value="off"
--> R (configurationDone-9): {"type":"response","request_seq":9,"success":true,"command":"configurationDone","body":{},"seq":29}
<-- C (threads-10): {"command":"threads","type":"request","seq":10}
--> R (threads-10): {"type":"response","request_seq":10,"success":true,"command":"threads","body":{"threads":[]},"seq":34}
--> E (output): {"type":"event","event":"output","body":{"category":"stdout","output":"Stopped due to shared library event (no libraries added or removed)\n"},"seq":36}
Stopped due to shared library event (no libraries added or removed)
--> E (process): {"type":"event","event":"process","body":{"startMethod":"launch","name":"/home/fellipe/Dropbox/Pessoais/pos doc/Programas Pós Doc/examples/pcsaft/cpp/metanol_1_octanol/main","systemProcessId":60948,"pointerSize":64},"seq":38}
--> E (thread): {"type":"event","event":"thread","body":{"reason":"started","threadId":60948},"seq":40}
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"Loaded '/lib64/ld-linux-x86-64.so.2'. Symbols loaded.\n"},"seq":42}
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":"140737353941248","vsPreferredLoadAddress":"140737353941248","vsModuleSize":140660,"vsLoadOrder":0,"vsTimestampUTC":"1645731760","vsIs64Bit":true}},"seq":44}
<-- C (threads-11): {"command":"threads","type":"request","seq":11}
--> R (threads-11): {"type":"response","request_seq":11,"success":true,"command":"threads","body":{"threads":[{"id":60948,"name":"main"}]},"seq":47}
--> E (output): {"type":"event","event":"output","body":{"category":"stdout","output":"\n"},"seq":49}
--> E (output): {"type":"event","event":"output","body":{"category":"stdout","output":"Breakpoint 1, 0x0000555555557889 in main ()\n"},"seq":51}
Breakpoint 1, 0x0000555555557889 in main ()
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"Loaded '/lib/x86_64-linux-gnu/libstdc++.so.6'. Symbols loaded.\n"},"seq":53}
Loaded '/lib/x86_64-linux-gnu/libstdc++.so.6'. Symbols loaded.
--> E (module): {"type":"event","event":"module","body":{"reason":"new","module":{"id":2,"name":"libstdc++.so.6","path":"/lib/x86_64-linux-gnu/libstdc++.so.6","symbolFilePath":"/lib/x86_64-linux-gnu/libstdc++.so.6","vsLoadAddress":"140737352470880","vsPreferredLoadAddress":"140737352470880","vsModuleSize":951026,"vsLoadOrder":1,"vsTimestampUTC":"1622274567","vsIs64Bit":true}},"seq":55}
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"Loaded '/lib/x86_64-linux-gnu/libm.so.6'. Symbols loaded.\n"},"seq":57}
Loaded '/lib/x86_64-linux-gnu/libm.so.6'. Symbols loaded.
--> E (module): {"type":"event","event":"module","body":{"reason":"new","module":{"id":3,"name":"libm.so.6","path":"/lib/x86_64-linux-gnu/libm.so.6","symbolFilePath":"/lib/x86_64-linux-gnu/libm.so.6","vsLoadAddress":"140737350505408","vsPreferredLoadAddress":"140737350505408","vsModuleSize":682840,"vsLoadOrder":2,"vsTimestampUTC":"1645731760","vsIs64Bit":true}},"seq":59}
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"Loaded '/lib/x86_64-linux-gnu/libgcc_s.so.1'. Symbols loaded.\n"},"seq":61}
Loaded '/lib/x86_64-linux-gnu/libgcc_s.so.1'. Symbols loaded.
--> E (module): {"type":"event","event":"module","body":{"reason":"new","module":{"id":4,"name":"libgcc_s.so.1","path":"/lib/x86_64-linux-gnu/libgcc_s.so.1","symbolFilePath":"/lib/x86_64-linux-gnu/libgcc_s.so.1","vsLoadAddress":"140737350354400","vsPreferredLoadAddress":"140737350354400","vsModuleSize":68197,"vsLoadOrder":3,"vsTimestampUTC":"1622274567","vsIs64Bit":true}},"seq":63}
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"Loaded '/lib/x86_64-linux-gnu/libc.so.6'. Symbols loaded.\n"},"seq":65}
Loaded '/lib/x86_64-linux-gnu/libc.so.6'. Symbols loaded.
--> E (module): {"type":"event","event":"module","body":{"reason":"new","module":{"id":5,"name":"libc.so.6","path":"/lib/x86_64-linux-gnu/libc.so.6","symbolFilePath":"/lib/x86_64-linux-gnu/libc.so.6","vsLoadAddress":"140737348441648","vsPreferredLoadAddress":"140737348441648","vsModuleSize":1526621,"vsLoadOrder":4,"vsTimestampUTC":"1645731760","vsIs64Bit":true}},"seq":67}
--> E (output): {"type":"event","event":"output","body":{"category":"stdout","output":"[Inferior 1 (process 60948) exited normally]\n"},"seq":69}
[Inferior 1 (process 60948) exited normally]
--> E (thread): {"type":"event","event":"thread","body":{"reason":"exited","threadId":60948},"seq":71}
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"The program '/home/fellipe/Dropbox/Pessoais/pos doc/Programas Pós Doc/examples/pcsaft/cpp/metanol_1_octanol/main' has exited with code 0 (0x00000000).\r\n\n"},"seq":73}
The program '/home/fellipe/Dropbox/Pessoais/pos doc/Programas Pós Doc/examples/pcsaft/cpp/metanol_1_octanol/main' has exited with code 0 (0x00000000).
--> E (exited): {"type":"event","event":"exited","body":{"exitCode":0},"seq":75}
--> E (terminated): {"type":"event","event":"terminated","body":{},"seq":77}
--> 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.1.20308.3","VS.Diagnostics.Debugger.HostVersion":"17.1.20308.3","VS.Diagnostics.Debugger.AdapterId":"cppdbg","VS.Diagnostics.Debugger.DebugCompleted.BreakCounter":0}},"seq":79}
<-- C (disconnect-12): {"command":"disconnect","arguments":{"restart":false},"type":"request","seq":12}
--> R (disconnect-12): {"type":"response","request_seq":12,"success":true,"command":"disconnect","body":{},"seq":82}
Beta Was this translation helpful? Give feedback.
All reactions