Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debugger aborted Linux #520

Closed
Valmadson opened this issue Mar 1, 2017 · 20 comments
Closed

Debugger aborted Linux #520

Valmadson opened this issue Mar 1, 2017 · 20 comments
Assignees

Comments

@Valmadson
Copy link

Valmadson commented Mar 1, 2017

Hi,
Debugging my app started window show message "HelloWorld" and abort immediately, don't stop in breakpoint.

Any suggestions to solve the problem ?

===============
Information

I just downloaded the version 1.9 of Visual Studio Code.

Install Extensioins : C/C++ Microsoft Extension, C/C++ CLang, CMake, CMake Tools, Native Debug, LLDB Debugger.

tasks.json

{
"version": "0.1.0",
"command": "gcc",
"args": ["-g", "${file}", "-o", "${file}.o"],
"problemMatcher": {
"owner": "cpp",
"fileLocation": ["relative", "${workspaceRoot}"],
"pattern": {
"regexp": "^(.):(\d+):(\d+):\s+(warning|error):\s+(.)$",
"file": 1,
"line": 2,
"column": 3,
"severity": 4,
"message": 5
}
}
}

Launch.json

{
"name": "C++ Launch",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceRoot}/primeiro",
"stopAtEntry": false,
"cwd": "${workspaceRoot}",
"logging": { "trace": true, "traceResponse": true, "engineLogging": true },
"launchCompleteCommand": "exec-run",
"linux": {
"MIMode": "gdb",
"miDebuggerPath": "/usr/bin/gdb"},
"osx": {
"MIMode": "lldb"
},
"windows": {
"MIMode": "gdb",
"miDebuggerPath": "C:\MinGw\bin\gdb.exe"
}
}

My PC

Linux 4.4.0-64-generic - 32 bits
#85-Ubuntu SMP Mon Feb 20 11:49:39 UTC 2017 i686 GNU/Linux
Intel(R) Pentium(R) Dual CPU T3200 @ 2.00GHz

Ubuntu 16.04.2 LTS

DEBUG CONSOLE

1: (999) LaunchOptions<LocalLaunchOptions xmlns='http://schemas.microsoft.com/vstudio/MDDDebuggerOptions/2014'
1: (1051) LaunchOptions ExePath='/home/valmadson/prg/python/projetos/vscode/primeiro'
1: (1051) LaunchOptions WorkingDirectory='/home/valmadson/prg/python/projetos/vscode'
1: (1051) LaunchOptions ExeArguments=''
1: (1051) LaunchOptions MIMode='gdb'
1: (1051) LaunchOptions MIDebuggerPath='/usr/bin/gdb'
1: (1051) LaunchOptions WaitDynamicLibLoad='false'
1: (1051) LaunchOptions>
1: (1051) LaunchOptions exec-run
1: (1060) LaunchOptions
1: (1424) TempFile=/tmp/Microsoft-MIEngine-fifo-cj9nskwd.qh0
1: (1424) TempFile=/tmp/Microsoft-MIEngine-fifo-i8gwg4if.7k4
1: (1424) TempFile=/tmp/Microsoft-MIEngine-fifo-lm4odiib.c7c
1: (1163) LaunchOptions<LocalLaunchOptions xmlns='http://schemas.microsoft.com/vstudio/MDDDebuggerOptions/2014'
1: (1229) LaunchOptions ExePath='/home/valmadson/prg/python/projetos/vscode/primeiro'
1: (1229) LaunchOptions WorkingDirectory='/home/valmadson/prg/python/projetos/vscode'
1: (1229) LaunchOptions ExeArguments=''
1: (1229) LaunchOptions MIMode='gdb'
1: (1229) LaunchOptions MIDebuggerPath='/usr/bin/gdb'
1: (1229) LaunchOptions WaitDynamicLibLoad='false'
1: (1229) LaunchOptions>
1: (1229) LaunchOptions exec-run
1: (1230) LaunchOptions
1: (1809) ShellPid=32093
1: (1920) DebuggerPid=32096
1: (1778) TempFile=/tmp/Microsoft-MIEngine-fifo-grst56nf.b0c
1: (1778) TempFile=/tmp/Microsoft-MIEngine-fifo-2mcd4s4u.f3v
1: (1778) TempFile=/tmp/Microsoft-MIEngine-fifo-lxejqav3.a75
1: (2058) ->=thread-group-added,id="i1"
1: (2070) ->"GNU gdb (Ubuntu 7.11.1-0ubuntu116.04) 7.11.1\n"
1: (2070) ->"Copyright (C) 2016 Free Software Foundation, Inc.\n"
1: (2070) ->
"License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law. Type "show copying"\nand "show warranty" for details.\n"
1: (2070) ->"This GDB was configured as "i686-linux-gnu".\nType "show configuration" for configuration details."
1: (2071) ->
"\nFor bug reporting instructions, please see:\n"
1: (2071) ->"http://www.gnu.org/software/gdb/bugs/.\n"
1: (2071) ->
"Find the GDB manual and other documentation resources online at:\nhttp://www.gnu.org/software/gdb/documentation/.\n"
1: (2071) ->"For help, type "help".\n"
1: (2071) ->
"Type "apropos word" to search for commands related to "word".\n"
1: (2071) ->(gdb)
1: (2088) <-1001-gdb-set target-async on
1: (2089) ->1001^done
1: (2089) ->(gdb)
1: (2094) 1001: elapsed time 13
1: (2153) <-1002-gdb-set solib-search-path /home/valmadson/prg/python/projetos/vscode:
1: (2154) ->1002^done
1: (2155) ->(gdb)
1: (2159) 1002: elapsed time 6
1: (2159) <-1003-gdb-set stop-on-solib-events 1
1: (2160) ->1003^done
1: (2160) ->(gdb)
1: (2164) 1003: elapsed time 4
1: (2164) <-1004-environment-cd /home/valmadson/prg/python/projetos/vscode
1: (2165) ->1004^done
1: (2165) ->(gdb)
1: (2165) 1004: elapsed time 0
1: (2165) <-1005-file-exec-and-symbols /home/valmadson/prg/python/projetos/vscode/primeiro
1: (2167) ->1005^done
1: (2167) ->(gdb)
1: (2167) 1005: elapsed time 1
1: (2171) <-1006-interpreter-exec console "show architecture"
1: (2171) ->"The target architecture is set automatically (currently i386)\n"
1: (2171) ->1006^done
1: (2171) ->(gdb)
1: (2182) 1006: elapsed time 11
1: (2202) <-1007-break-insert main
1: (2203) ->1007^done,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x0804895a",at="<main+15>",thread-groups=["i1"],times="0",original-location="main"}
1: (2203) ->(gdb)
1: (2232) 1007: elapsed time 30
E output: {"category":"telemetry","output":"VS/Diagnostics/Debugger/Launch","data":{"VS.Diagnostics.Debugger.ImplementationName":"Microsoft.MIDebugEngine","VS.Diagnostics.Debugger.EngineVersion":"14.0.40118.1","VS.Diagnostics.Debugger.HostVersion":"1.0.30118.2","VS.Diagnostics.Debugger.AdapterId":"cppdbg","VS.Diagnostics.Debugger.Launch.Duration":1781,"VS.Diagnostics.Debugger.Launch.IsCoreDump":false,"VS.Diagnostics.Debugger.VisualizerFileUsed":false,"VS.Diagnostics.Debugger.SourceFileMappings":0},"type":"output"}
R: {"success":true,"message":null,"request_seq":2,"command":"launch","body":null,"running":false,"refs":null,"seq":0,"type":"response"}
E initialized: {"type":"initialized"}
1: (2174) ShellPid=32103
C setBreakpoints: {"source":{"path":"/home/valmadson/prg/python/projetos/vscode/testcurso.py","name":"testcurso.py"},"lines":[3],"breakpoints":[{"line":3}],"sourceModified":false}
1: (2207) DebuggerPid=32106
1: (2440) ->=thread-group-added,id="i1"
1: (2447) ->
"GNU gdb (Ubuntu 7.11.1-0ubuntu116.04) 7.11.1\n"
1: (2451) ->
"Copyright (C) 2016 Free Software Foundation, Inc.\n"
1: (2451) ->"License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law. Type "show copying"\nand "show warranty" for details.\n"
1: (2451) ->
"This GDB was configured as "i686-linux-gnu".\nType "show configuration" for configuration details."
1: (2451) ->"\nFor bug reporting instructions, please see:\n"
1: (2451) ->
"http://www.gnu.org/software/gdb/bugs/.\n"
1: (2451) ->"Find the GDB manual and other documentation resources online at:\nhttp://www.gnu.org/software/gdb/documentation/.\n"
1: (2451) ->
"For help, type "help".\n"
1: (2451) ->"Type "apropos word" to search for commands related to "word".\n"
1: (2451) ->(gdb)
1: (2468) <-1001-gdb-set target-async on
1: (2469) ->1001^done
1: (2470) ->(gdb)
1: (2475) 1001: elapsed time 8
1: (2681) <-1008-break-insert -f testcurso.py:3
1: (2682) ->&"No symbol table is loaded. Use the "file" command.\n"
1: (2682) ->1008^done,bkpt={number="2",type="breakpoint",disp="keep",enabled="y",addr="",pending="testcurso.py:3",times="0",original-location="testcurso.py:3"}
1: (2682) ->(gdb)
1: (2493) <-1002-gdb-set solib-search-path /home/valmadson/prg/python/projetos/vscode:
1: (2493) ->1002^done
1: (2493) ->(gdb)
1: (2502) 1002: elapsed time 9
1: (2502) <-1003-gdb-set stop-on-solib-events 1
1: (2503) ->1003^done
1: (2503) ->(gdb)
1: (2503) 1003: elapsed time 0
1: (2504) <-1004-environment-cd /home/valmadson/prg/python/projetos/vscode
1: (2695) 1008: elapsed time 13
1: (2504) ->1004^done
1: (2504) ->(gdb)
1: (2504) 1004: elapsed time 0
1: (2504) <-1005-file-exec-and-symbols /home/valmadson/prg/python/projetos/vscode/primeiro
1: (2506) ->1005^done
1: (2507) ->(gdb)
1: (2507) 1005: elapsed time 2
1: (2511) <-1006-interpreter-exec console "show architecture"
1: (2512) ->
"The target architecture is set automatically (currently i386)\n"
1: (2512) ->1006^done
1: (2512) ->(gdb)
1: (2514) 1006: elapsed time 2
1: (2529) <-1007-break-insert main
1: (2530) ->1007^done,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x0804895a",at="<main+15>",thread-groups=["i1"],times="0",original-location="main"}
1: (2530) ->(gdb)
1: (2555) 1007: elapsed time 25
R: {"success":true,"message":null,"request_seq":3,"command":"setBreakpoints","body":{"breakpoints":[{"id":1,"verified":true,"line":3,"message":null}]},"running":false,"refs":null,"seq":0,"type":"response"}
E breakpoint: {"reason":"changed","breakpoint":{"id":1,"verified":false,"line":3,"message":"Module containing this breakpoint has not yet loaded or the breakpoint address could not be obtained."},"type":"breakpoint"}
C setBreakpoints: {"source":{"path":"/home/valmadson/prg/python/projetos/vscode/hello.cc","name":"hello.cc"},"lines":[5],"breakpoints":[{"line":5}],"sourceModified":false}
1: (2764) <-1009-break-insert -f hello.cc:5
1: (2764) ->&"No symbol table is loaded. Use the "file" command.\n"
1: (2764) ->1009^done,bkpt={number="3",type="breakpoint",disp="keep",enabled="y",addr="",pending="hello.cc:5",times="0",original-location="hello.cc:5"}
1: (2765) ->(gdb)
1: (2765) 1009: elapsed time 1
R: {"success":true,"message":null,"request_seq":4,"command":"setBreakpoints","body":{"breakpoints":[{"id":2,"verified":true,"line":5,"message":null}]},"running":false,"refs":null,"seq":0,"type":"response"}
E breakpoint: {"reason":"changed","breakpoint":{"id":2,"verified":false,"line":5,"message":"Module containing this breakpoint has not yet loaded or the breakpoint address could not be obtained."},"type":"breakpoint"}
C setBreakpoints: {"source":{"path":"/home/valmadson/prg/python/projetos/vscode/primeiro.cpp","name":"primeiro.cpp"},"lines":[6],"breakpoints":[{"line":6}],"sourceModified":false}
1: (2766) <-1010-break-insert -f primeiro.cpp:6
1: (2767) ->&"No symbol table is loaded. Use the "file" command.\n"
1: (2767) ->1010^done,bkpt={number="4",type="breakpoint",disp="keep",enabled="y",addr="",pending="primeiro.cpp:6",times="0",original-location="primeiro.cpp:6"}
1: (2767) ->(gdb)
1: (2767) 1010: elapsed time 1
R: {"success":true,"message":null,"request_seq":5,"command":"setBreakpoints","body":{"breakpoints":[{"id":3,"verified":true,"line":6,"message":null}]},"running":false,"refs":null,"seq":0,"type":"response"}
E breakpoint: {"reason":"changed","breakpoint":{"id":3,"verified":false,"line":6,"message":"Module containing this breakpoint has not yet loaded or the breakpoint address could not be obtained."},"type":"breakpoint"}
C setFunctionBreakpoints: {"breakpoints":[]}
R: {"success":true,"message":null,"request_seq":6,"command":"setFunctionBreakpoints","body":{"breakpoints":[]},"running":false,"refs":null,"seq":0,"type":"response"}
E output: {"category":"telemetry","output":"VS/Diagnostics/Debugger/Launch","data":{"VS.Diagnostics.Debugger.ImplementationName":"Microsoft.MIDebugEngine","VS.Diagnostics.Debugger.EngineVersion":"14.0.40118.1","VS.Diagnostics.Debugger.HostVersion":"1.0.30118.2","VS.Diagnostics.Debugger.AdapterId":"cppdbg","VS.Diagnostics.Debugger.Launch.Duration":2117,"VS.Diagnostics.Debugger.Launch.IsCoreDump":false,"VS.Diagnostics.Debugger.VisualizerFileUsed":false,"VS.Diagnostics.Debugger.SourceFileMappings":0},"type":"output"}
R: {"success":true,"message":null,"request_seq":2,"command":"launch","body":null,"running":false,"refs":null,"seq":0,"type":"response"}
E initialized: {"type":"initialized"}
C configurationDone: null
R: {"success":true,"message":null,"request_seq":7,"command":"configurationDone","body":null,"running":false,"refs":null,"seq":0,"type":"response"}
E output: {"category":"stdout","output":"=thread-group-added,id="i1"\nGNU gdb (Ubuntu 7.11.1-0ubuntu116.04) 7.11.1\nCopyright (C) 2016 Free Software Foundation, Inc.\nLicense GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law. Type "show copying"\nand "show warranty" for details.\nThis GDB was configured as "i686-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:\nhttp://www.gnu.org/software/gdb/documentation/.\nFor help, type "help".\nType "apropos word" to search for commands related to "word".\n","data":null,"type":"output"}
=thread-group-added,id="i1"
GNU gdb (Ubuntu 7.11.1-0ubuntu1
16.04) 7.11.1
Copyright (C) 2016 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 "i686-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".
C threads: null
1: (2868) <-1011-exec-run
1: (2869) ->=thread-group-started,id="i1",pid="32114"
1: (2869) ->=thread-created,id="1",group-id="i1"
1: (2879) ->=library-loaded,id="/lib/ld-linux.so.2",target-name="/lib/ld-linux.so.2",host-name="/lib/ld-linux.so.2",symbols-loaded="0",thread-group="i1"
R: {"success":true,"message":null,"request_seq":8,"command":"threads","body":{"threads":[]},"running":false,"refs":null,"seq":0,"type":"response"}
1: (2917) ->1011^running
1: (2917) ->*running,thread-id="all"
1: (2918) ->(gdb)
1: (2918) 1011: elapsed time 49
1: (2919) ->"Stopped due to shared library event (no libraries added or removed)\n"
1: (2919) ->*stopped,reason="solib-event",thread-id="1",stopped-threads="all",core="0"
E output: {"category":"stdout","output":"Stopped due to shared library event (no libraries added or removed)\n","data":null,"type":"output"}
Stopped due to shared library event (no libraries added or removed)
1: (2933) <-1012-interpreter-exec console "shell echo -e \\033c 1>&2"
1: (2944) ->1012^done
1: (2944) ->(gdb)
1: (2944) 1012: elapsed time 10
1: (2944) <-1013-gdb-set stop-on-solib-events 0
1: (2947) ->1013^done
1: (2947) ->(gdb)
1: (2948) 1013: elapsed time 3
C setBreakpoints: {"source":{"path":"/home/valmadson/prg/python/projetos/vscode/testcurso.py","name":"testcurso.py"},"lines":[3],"breakpoints":[{"line":3}],"sourceModified":false}
1: (2966) <-1014-break-info 2
1: (2968) ->1014^done,BreakpointTable={nr_rows="1",nr_cols="6",hdr=[{width="7",alignment="-1",col_name="number",colhdr="Num"},{width="14",alignment="-1",col_name="type",colhdr="Type"},{width="4",alignment="-1",col_name="disp",colhdr="Disp"},{width="3",alignment="-1",col_name="enabled",colhdr="Enb"},{width="10",alignment="-1",col_name="addr",colhdr="Address"},{width="40",alignment="2",col_name="what",colhdr="What"}],body=[bkpt={number="2",type="breakpoint",disp="keep",enabled="y",addr="",pending="testcurso.py:3",times="0",original-location="testcurso.py:3"}]}
1: (2968) ->(gdb)
1: (2974) 1014: elapsed time 7
1: (2981) <-1015-break-info 3
1: (2983) ->1015^done,BreakpointTable={nr_rows="1",nr_cols="6",hdr=[{width="7",alignment="-1",col_name="number",colhdr="Num"},{width="14",alignment="-1",col_name="type",colhdr="Type"},{width="4",alignment="-1",col_name="disp",colhdr="Disp"},{width="3",alignment="-1",col_name="enabled",colhdr="Enb"},{width="10",alignment="-1",col_name="addr",colhdr="Address"},{width="40",alignment="2",col_name="what",colhdr="What"}],body=[bkpt={number="3",type="breakpoint",disp="keep",enabled="y",addr="",pending="hello.cc:5",times="0",original-location="hello.cc:5"}]}
1: (2983) ->(gdb)
1: (2984) 1015: elapsed time 2
1: (2985) <-1016-break-info 4
1: (2986) ->1016^done,BreakpointTable={nr_rows="1",nr_cols="6",hdr=[{width="7",alignment="-1",col_name="number",colhdr="Num"},{width="14",alignment="-1",col_name="type",colhdr="Type"},{width="4",alignment="-1",col_name="disp",colhdr="Disp"},{width="3",alignment="-1",col_name="enabled",colhdr="Enb"},{width="10",alignment="-1",col_name="addr",colhdr="Address"},{width="40",alignment="2",col_name="what",colhdr="What"}],body=[bkpt={number="4",type="breakpoint",disp="keep",enabled="y",addr="",pending="primeiro.cpp:6",times="0",original-location="primeiro.cpp:6"}]}
1: (2987) ->(gdb)
1: (2988) 1016: elapsed time 2
1: (2992) <-1017-interpreter-exec console "info sharedlibrary"
1: (2993) ->
"From To Syms Read Shared Object Library\n"
1: (2994) ->"0xb7fdb860 0xb7ff461d Yes /lib/ld-linux.so.2\n"
1: (2994) ->1017^done
1: (2994) ->(gdb)
1: (2997) 1017: elapsed time 5
E output: {"category":"console","output":"Loaded '/lib/ld-linux.so.2'. Symbols loaded.\n","data":null,"type":"output"}
Loaded '/lib/ld-linux.so.2'. Symbols loaded.
1: (3006) <--exec-continue
1: (3015) ->^running
1: (3015) ->*running,thread-id="all"
1: (2818) <-1008-break-insert -f testcurso.py:3
1: (2819) ->&"No symbol table is loaded. Use the "file" command.\n"
1: (2819) ->1008^done,bkpt={number="2",type="breakpoint",disp="keep",enabled="y",addr="",pending="testcurso.py:3",times="0",original-location="testcurso.py:3"}
1: (2819) ->(gdb)
1: (3020) ->(gdb)
1: (3021) ->=library-loaded,id="/usr/lib/i386-linux-gnu/libstdc++.so.6",target-name="/usr/lib/i386-linux-gnu/libstdc++.so.6",host-name="/usr/lib/i386-linux-gnu/libstdc++.so.6",symbols-loaded="0",thread-group="i1"
1: (3021) ->=library-loaded,id="/lib/i386-linux-gnu/libgcc_s.so.1",target-name="/lib/i386-linux-gnu/libgcc_s.so.1",host-name="/lib/i386-linux-gnu/libgcc_s.so.1",symbols-loaded="0",thread-group="i1"
1: (3021) ->=library-loaded,id="/lib/i386-linux-gnu/libc.so.6",target-name="/lib/i386-linux-gnu/libc.so.6",host-name="/lib/i386-linux-gnu/libc.so.6",symbols-loaded="0",thread-group="i1"
1: (3021) ->=library-loaded,id="/lib/i386-linux-gnu/libm.so.6",target-name="/lib/i386-linux-gnu/libm.so.6",host-name="/lib/i386-linux-gnu/libm.so.6",symbols-loaded="0",thread-group="i1"
1: (2823) 1008: elapsed time 4
R: {"success":true,"message":null,"request_seq":3,"command":"setBreakpoints","body":{"breakpoints":[{"id":1,"verified":true,"line":3,"message":null}]},"running":false,"refs":null,"seq":0,"type":"response"}
E breakpoint: {"reason":"changed","breakpoint":{"id":1,"verified":false,"line":3,"message":"Module containing this breakpoint has not yet loaded or the breakpoint address could not be obtained."},"type":"breakpoint"}
C setBreakpoints: {"source":{"path":"/home/valmadson/prg/python/projetos/vscode/hello.cc","name":"hello.cc"},"lines":[5],"breakpoints":[{"line":5}],"sourceModified":false}
1: (2853) <-1009-break-insert -f hello.cc:5
1: (2854) ->&"No symbol table is loaded. Use the "file" command.\n"
1: (2854) ->1009^done,bkpt={number="3",type="breakpoint",disp="keep",enabled="y",addr="",pending="hello.cc:5",times="0",original-location="hello.cc:5"}
1: (2854) ->(gdb)
1: (2854) 1009: elapsed time 0
R: {"success":true,"message":null,"request_seq":4,"command":"setBreakpoints","body":{"breakpoints":[{"id":2,"verified":true,"line":5,"message":null}]},"running":false,"refs":null,"seq":0,"type":"response"}
E breakpoint: {"reason":"changed","breakpoint":{"id":2,"verified":false,"line":5,"message":"Module containing this breakpoint has not yet loaded or the breakpoint address could not be obtained."},"type":"breakpoint"}
C setBreakpoints: {"source":{"path":"/home/valmadson/prg/python/projetos/vscode/primeiro.cpp","name":"primeiro.cpp"},"lines":[6],"breakpoints":[{"line":6}],"sourceModified":false}
1: (2855) <-1010-break-insert -f primeiro.cpp:6
1: (2856) ->&"No symbol table is loaded. Use the "file" command.\n"
1: (2856) ->1010^done,bkpt={number="4",type="breakpoint",disp="keep",enabled="y",addr="",pending="primeiro.cpp:6",times="0",original-location="primeiro.cpp:6"}
1: (2856) ->(gdb)
1: (2857) 1010: elapsed time 1
R: {"success":true,"message":null,"request_seq":5,"command":"setBreakpoints","body":{"breakpoints":[{"id":3,"verified":true,"line":6,"message":null}]},"running":false,"refs":null,"seq":0,"type":"response"}
E breakpoint: {"reason":"changed","breakpoint":{"id":3,"verified":false,"line":6,"message":"Module containing this breakpoint has not yet loaded or the breakpoint address could not be obtained."},"type":"breakpoint"}
C setFunctionBreakpoints: {"breakpoints":[]}
R: {"success":true,"message":null,"request_seq":6,"command":"setFunctionBreakpoints","body":{"breakpoints":[]},"running":false,"refs":null,"seq":0,"type":"response"}
C configurationDone: null
E output: {"category":"stdout","output":"=thread-group-added,id="i1"\nGNU gdb (Ubuntu 7.11.1-0ubuntu1
16.04) 7.11.1\nCopyright (C) 2016 Free Software Foundation, Inc.\nLicense GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law. Type "show copying"\nand "show warranty" for details.\nThis GDB was configured as "i686-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:\nhttp://www.gnu.org/software/gdb/documentation/.\nFor help, type "help".\nType "apropos word" to search for commands related to "word".\n","data":null,"type":"output"}
=thread-group-added,id="i1"
GNU gdb (Ubuntu 7.11.1-0ubuntu116.04) 7.11.1
Copyright (C) 2016 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 "i686-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".
R: {"success":true,"message":null,"request_seq":7,"command":"configurationDone","body":null,"running":false,"refs":null,"seq":0,"type":"response"}
1: (2964) <-1011-exec-run
1: (2965) ->=thread-group-started,id="i1",pid="32121"
1: (2965) ->=thread-created,id="1",group-id="i1"
1: (2974) ->=library-loaded,id="/lib/ld-linux.so.2",target-name="/lib/ld-linux.so.2",host-name="/lib/ld-linux.so.2",symbols-loaded="0",thread-group="i1"
C threads: null
R: {"success":true,"message":null,"request_seq":8,"command":"threads","body":{"threads":[]},"running":false,"refs":null,"seq":0,"type":"response"}
1: (3027) ->1011^running
1: (3028) ->*running,thread-id="all"
1: (3031) ->(gdb)
1: (3031) ->
"Stopped due to shared library event (no libraries added or removed)\n"
1: (3031) ->*stopped,reason="solib-event",thread-id="1",stopped-threads="all",core="1"
1: (3037) 1011: elapsed time 72
E output: {"category":"stdout","output":"Stopped due to shared library event (no libraries added or removed)\n","data":null,"type":"output"}
Stopped due to shared library event (no libraries added or removed)
1: (3070) <-1012-interpreter-exec console "shell echo -e \\033c 1>&2"
1: (3074) ->1012^done
1: (3074) ->(gdb)
1: (3076) 1012: elapsed time 5
1: (3076) <-1013-gdb-set stop-on-solib-events 0
1: (3077) ->1013^done
1: (3077) ->(gdb)
1: (3077) 1013: elapsed time 1
1: (3104) <-1014-break-info 2
1: (3104) ->1014^done,BreakpointTable={nr_rows="1",nr_cols="6",hdr=[{width="7",alignment="-1",col_name="number",colhdr="Num"},{width="14",alignment="-1",col_name="type",colhdr="Type"},{width="4",alignment="-1",col_name="disp",colhdr="Disp"},{width="3",alignment="-1",col_name="enabled",colhdr="Enb"},{width="10",alignment="-1",col_name="addr",colhdr="Address"},{width="40",alignment="2",col_name="what",colhdr="What"}],body=[bkpt={number="2",type="breakpoint",disp="keep",enabled="y",addr="",pending="testcurso.py:3",times="0",original-location="testcurso.py:3"}]}
1: (3105) ->(gdb)
1: (3122) 1014: elapsed time 18
1: (3136) <-1015-break-info 3
1: (3136) ->1015^done,BreakpointTable={nr_rows="1",nr_cols="6",hdr=[{width="7",alignment="-1",col_name="number",colhdr="Num"},{width="14",alignment="-1",col_name="type",colhdr="Type"},{width="4",alignment="-1",col_name="disp",colhdr="Disp"},{width="3",alignment="-1",col_name="enabled",colhdr="Enb"},{width="10",alignment="-1",col_name="addr",colhdr="Address"},{width="40",alignment="2",col_name="what",colhdr="What"}],body=[bkpt={number="3",type="breakpoint",disp="keep",enabled="y",addr="",pending="hello.cc:5",times="0",original-location="hello.cc:5"}]}
1: (3136) ->(gdb)
1: (3137) 1015: elapsed time 1
1: (3137) <-1016-break-info 4
1: (3137) ->1016^done,BreakpointTable={nr_rows="1",nr_cols="6",hdr=[{width="7",alignment="-1",col_name="number",colhdr="Num"},{width="14",alignment="-1",col_name="type",colhdr="Type"},{width="4",alignment="-1",col_name="disp",colhdr="Disp"},{width="3",alignment="-1",col_name="enabled",colhdr="Enb"},{width="10",alignment="-1",col_name="addr",colhdr="Address"},{width="40",alignment="2",col_name="what",colhdr="What"}],body=[bkpt={number="4",type="breakpoint",disp="keep",enabled="y",addr="",pending="primeiro.cpp:6",times="0",original-location="primeiro.cpp:6"}]}
1: (3138) ->(gdb)
1: (3140) 1016: elapsed time 3
1: (3145) <-1017-interpreter-exec console "info sharedlibrary"
1: (3146) ->"From To Syms Read Shared Object Library\n"
1: (3146) ->
"0xb7fdb860 0xb7ff461d Yes /lib/ld-linux.so.2\n"
1: (3146) ->1017^done
1: (3146) ->(gdb)
1: (3147) 1017: elapsed time 2
E output: {"category":"console","output":"Loaded '/lib/ld-linux.so.2'. Symbols loaded.\n","data":null,"type":"output"}
Loaded '/lib/ld-linux.so.2'. Symbols loaded.
1: (3171) <--exec-continue
1: (3179) ->^running
1: (3179) ->*running,thread-id="all"
1: (3179) ->(gdb)
1: (3179) ->=library-loaded,id="/usr/lib/i386-linux-gnu/libstdc++.so.6",target-name="/usr/lib/i386-linux-gnu/libstdc++.so.6",host-name="/usr/lib/i386-linux-gnu/libstdc++.so.6",symbols-loaded="0",thread-group="i1"
1: (3180) ->=library-loaded,id="/lib/i386-linux-gnu/libgcc_s.so.1",target-name="/lib/i386-linux-gnu/libgcc_s.so.1",host-name="/lib/i386-linux-gnu/libgcc_s.so.1",symbols-loaded="0",thread-group="i1"
1: (3180) ->=library-loaded,id="/lib/i386-linux-gnu/libc.so.6",target-name="/lib/i386-linux-gnu/libc.so.6",host-name="/lib/i386-linux-gnu/libc.so.6",symbols-loaded="0",thread-group="i1"
1: (3180) ->=library-loaded,id="/lib/i386-linux-gnu/libm.so.6",target-name="/lib/i386-linux-gnu/libm.so.6",host-name="/lib/i386-linux-gnu/libm.so.6",symbols-loaded="0",thread-group="i1"
1: (3541) ->=breakpoint-modified,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x0804895a",at="<main+15>",thread-groups=["i1"],times="1",original-location="main"}
1: (3543) ->"\n"
1: (3545) ->
"Breakpoint 1, 0x0804895a in main ()\n"
1: (3545) ->*stopped,reason="breakpoint-hit",disp="keep",bkptno="1",frame={addr="0x0804895a",func="main",args=[]},thread-id="1",stopped-threads="all",core="0"
E output: {"category":"stdout","output":"\n","data":null,"type":"output"}
E output: {"category":"stdout","output":"Breakpoint 1, 0x0804895a in main ()\n","data":null,"type":"output"}
Breakpoint 1, 0x0804895a in main ()
1: (3571) <-1018-thread-info
1: (3573) ->1018^done,threads=[{id="1",target-id="process 32114",name="primeiro",frame={level="0",addr="0x0804895a",func="main",args=[]},state="stopped",core="0"}],current-thread-id="1"
1: (3573) ->(gdb)
1: (3587) 1018: elapsed time 15
1: (3610) <-1019-stack-list-frames 0 1000
1: (3611) ->1019^done,stack=[frame={level="0",addr="0x0804895a",func="main"}]
1: (3611) ->(gdb)
1: (3616) 1019: elapsed time 5
E thread: {"reason":"started","threadId":32114,"type":"thread"}
C threads: null
R: {"success":true,"message":null,"request_seq":9,"command":"threads","body":{"threads":[{"id":32114,"name":"primeiro"}]},"running":false,"refs":null,"seq":0,"type":"response"}
1: (3639) <--exec-continue
1: (3643) ->^running
1: (3644) ->*running,thread-id="all"
1: (3644) ->(gdb)
1: (3644) ->"[Inferior 1 (process 32114) exited normally]\n"
1: (3644) ->=thread-exited,id="1",group-id="i1"
1: (3644) ->=thread-group-exited,id="i1",exit-code="0"
1: (3644) ->*stopped,reason="exited-normally"
E output: {"category":"stdout","output":"[Inferior 1 (process 32114) exited normally]\n","data":null,"type":"output"}
[Inferior 1 (process 32114) exited normally]
1: (3657) <--gdb-exit
1: (3657) ->^exit
E output: {"category":"console","output":"The program '/home/valmadson/prg/python/projetos/vscode/primeiro' has exited with code 0 (0x00000000).\r\n\n","data":null,"type":"output"}
The program '/home/valmadson/prg/python/projetos/vscode/primeiro' has exited with code 0 (0x00000000).
E exited: {"exitCode":0,"type":"exited"}
E terminated: {"type":"terminated"}
E output: {"category":"telemetry","output":"VS/Diagnostics/Debugger/DebugCompleted","data":{"VS.Diagnostics.Debugger.ImplementationName":"Microsoft.MIDebugEngine","VS.Diagnostics.Debugger.EngineVersion":"14.0.40118.1","VS.Diagnostics.Debugger.HostVersion":"1.0.30118.2","VS.Diagnostics.Debugger.AdapterId":"cppdbg","VS.Diagnostics.Debugger.DebugCompleted.BreakCounter":0},"type":"output"}
C disconnect: {"restart":false}
R: {"success":true,"message":null,"request_seq":10,"command":"disconnect","body":null,"running":false,"refs":null,"seq":0,"type":"response"}
1: (3735) ->=breakpoint-modified,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x0804895a",at="<main+15>",thread-groups=["i1"],times="1",original-location="main"}
1: (3738) ->
"\n"
1: (3738) ->"Breakpoint 1, 0x0804895a in main ()\n"
1: (3738) ->*stopped,reason="breakpoint-hit",disp="keep",bkptno="1",frame={addr="0x0804895a",func="main",args=[]},thread-id="1",stopped-threads="all",core="1"
E output: {"category":"stdout","output":"\n","data":null,"type":"output"}
E output: {"category":"stdout","output":"Breakpoint 1, 0x0804895a in main ()\n","data":null,"type":"output"}
Breakpoint 1, 0x0804895a in main ()
1: (3765) <-1018-thread-info
1: (3766) ->1018^done,threads=[{id="1",target-id="process 32121",name="primeiro",frame={level="0",addr="0x0804895a",func="main",args=[]},state="stopped",core="1"}],current-thread-id="1"
1: (3766) ->(gdb)
1: (3792) 1018: elapsed time 26
1: (3821) <-1019-stack-list-frames 0 1000
1: (3822) ->1019^done,stack=[frame={level="0",addr="0x0804895a",func="main"}]
1: (3822) ->(gdb)
1: (3827) 1019: elapsed time 6
E thread: {"reason":"started","threadId":32121,"type":"thread"}
C threads: null
R: {"success":true,"message":null,"request_seq":9,"command":"threads","body":{"threads":[{"id":32121,"name":"primeiro"}]},"running":false,"refs":null,"seq":0,"type":"response"}
1: (3859) <--exec-continue
1: (3860) ->^running
1: (3860) ->*running,thread-id="all"
1: (3860) ->(gdb)
1: (3862) ->
"[Inferior 1 (process 32121) exited normally]\n"
1: (3862) ->=thread-exited,id="1",group-id="i1"
1: (3862) ->=thread-group-exited,id="i1",exit-code="0"
1: (3862) ->*stopped,reason="exited-normally"
E output: {"category":"stdout","output":"[Inferior 1 (process 32121) exited normally]\n","data":null,"type":"output"}
[Inferior 1 (process 32121) exited normally]
1: (3869) <--gdb-exit
1: (3871) ->^exit
E output: {"category":"console","output":"The program '/home/valmadson/prg/python/projetos/vscode/primeiro' has exited with code 0 (0x00000000).\r\n\n","data":null,"type":"output"}
The program '/home/valmadson/prg/python/projetos/vscode/primeiro' has exited with code 0 (0x00000000).
E exited: {"exitCode":0,"type":"exited"}
E terminated: {"type":"terminated"}
E output: {"category":"telemetry","output":"VS/Diagnostics/Debugger/DebugCompleted","data":{"VS.Diagnostics.Debugger.ImplementationName":"Microsoft.MIDebugEngine","VS.Diagnostics.Debugger.EngineVersion":"14.0.40118.1","VS.Diagnostics.Debugger.HostVersion":"1.0.30118.2","VS.Diagnostics.Debugger.AdapterId":"cppdbg","VS.Diagnostics.Debugger.DebugCompleted.BreakCounter":0},"type":"output"}
C disconnect: {"restart":false}
R: {"success":true,"message":null,"request_seq":10,"command":"disconnect","body":null,"running":false,"refs":null,"seq":0,"type":"response"}

@pieandcakes
Copy link
Contributor

@Valmadson Your task.json shows you compiling with output as ${file}.o but your executable you are debugging is: ePath='/home/valmadson/prg/python/projetos/vscode/primeiro' Are you sure you are debugging the same output that you are compiling?

@pieandcakes pieandcakes self-assigned this Mar 2, 2017
@pieandcakes pieandcakes added debugger more info needed The issue report is not actionable in its current state labels Mar 2, 2017
@Valmadson
Copy link
Author

Yes pieandcakes, I sure.

Maybe because it's 32-bits ?

primeiro.cpp
#include < iostream >

using namespace std;

int main() {
string message = "Hello World \n";
cout << message << endl;
return 0;
}

@pieandcakes
Copy link
Contributor

That shouldn't matter. Can you clear your log and try once and send it to me? I don't know where in your log it starts or ends. Also, it seems you have a breakpoint in a testcurso.py file that is also being sent to our debugger.

Can you also change "stopAtEntry": true and see if it stops when you enter main?

@Valmadson
Copy link
Author

I clear my log with "Clear Console"

I removed breakpoint from the testcurso.py, that was inside the folder.

Change "stopAtEntry": true

Debugging >>> Show in top VSCode this message above

[Error] Unable to open 'Unknown Source': File not found (/Unknown Source). [Create File] [Cancel]
Press [Cancel] show other error and pres (Step Over F10) to continue

[Error] Unable to open 'libc-start.c': File not found (/build/glibc-tpy382/glibc-2.23/csu/libc-start.c). [Create File] [Cancel]

In parallel with this is show window (DebuggerTerminal) with message. Hello World

Press (Step Over F10) and exit

=========
Log Error

1: (627) LaunchOptions<LocalLaunchOptions xmlns='http://schemas.microsoft.com/vstudio/MDDDebuggerOptions/2014'
1: (655) LaunchOptions ExePath='/home/valmadson/prg/python/projetos/vscode/primeiro'
1: (656) LaunchOptions WorkingDirectory='/home/valmadson/prg/python/projetos/vscode'
1: (656) LaunchOptions ExeArguments=''
1: (656) LaunchOptions MIMode='gdb'
1: (657) LaunchOptions MIDebuggerPath='/usr/bin/gdb'
1: (657) LaunchOptions WaitDynamicLibLoad='false'
1: (658) LaunchOptions ExternalConsole='true'
1: (658) LaunchOptions>
1: (661) LaunchOptions exec-run
1: (662) LaunchOptions
1: (892) TempFile=/tmp/Microsoft-MIEngine-fifo-ewu6ox9a.vao
1: (893) TempFile=/tmp/Microsoft-MIEngine-fifo-t92l0gvm.0ui
1: (893) TempFile=/tmp/Microsoft-MIEngine-fifo-jz7a5hyj.twy
1: (1134) ShellPid=4202
1: (1240) DebuggerPid=4205
1: (1375) ->=thread-group-added,id="i1"
1: (1383) ->"GNU gdb (Ubuntu 7.11.1-0ubuntu116.04) 7.11.1\n"
1: (1383) ->"Copyright (C) 2016 Free Software Foundation, Inc.\n"
1: (1384) ->
"License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law. Type "show copying"\nand "show warranty" for details.\n"
1: (1384) ->"This GDB was configured as "i686-linux-gnu".\nType "show configuration" for configuration details."
1: (1386) ->
"\nFor bug reporting instructions, please see:\n"
1: (1387) ->"http://www.gnu.org/software/gdb/bugs/.\n"
1: (1387) ->
"Find the GDB manual and other documentation resources online at:\nhttp://www.gnu.org/software/gdb/documentation/.\n"
1: (1387) ->"For help, type "help".\n"
1: (1388) ->
"Type "apropos word" to search for commands related to "word".\n"
1: (1388) ->(gdb)
1: (1397) <-1001-gdb-set target-async on
1: (1399) ->1001^done
1: (1399) ->(gdb)
1: (1405) 1001: elapsed time 10
1: (1423) <-1002-gdb-set solib-search-path /home/valmadson/prg/python/projetos/vscode:
1: (1424) ->1002^done
1: (1425) ->(gdb)
1: (1426) 1002: elapsed time 2
1: (1426) <-1003-gdb-set stop-on-solib-events 1
1: (1427) ->1003^done
1: (1427) ->(gdb)
1: (1428) 1003: elapsed time 1
1: (1428) <-1004-environment-cd /home/valmadson/prg/python/projetos/vscode
1: (1429) ->1004^done
1: (1429) ->(gdb)
1: (1430) 1004: elapsed time 2
1: (1431) <-1005-file-exec-and-symbols /home/valmadson/prg/python/projetos/vscode/primeiro
1: (1433) ->1005^done
1: (1433) ->(gdb)
1: (1434) 1005: elapsed time 2
1: (1439) <-1006-interpreter-exec console "show architecture"
1: (1440) ->"The target architecture is set automatically (currently i386)\n"
1: (1440) ->1006^done
1: (1440) ->(gdb)
1: (1442) 1006: elapsed time 3
1: (1452) <-1007-break-insert main
1: (1453) ->1007^done,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x0804895a",at="<main+15>",thread-groups=["i1"],times="0",original-location="main"}
1: (1453) ->(gdb)
1: (1460) 1007: elapsed time 8
E output: {"category":"telemetry","output":"VS/Diagnostics/Debugger/Launch","data":{"VS.Diagnostics.Debugger.ImplementationName":"Microsoft.MIDebugEngine","VS.Diagnostics.Debugger.EngineVersion":"14.0.40301.2","VS.Diagnostics.Debugger.HostVersion":"1.0.30301.1","VS.Diagnostics.Debugger.AdapterId":"cppdbg","VS.Diagnostics.Debugger.Launch.Duration":1220,"VS.Diagnostics.Debugger.Launch.IsCoreDump":false,"VS.Diagnostics.Debugger.VisualizerFileUsed":false,"VS.Diagnostics.Debugger.SourceFileMappings":0},"type":"output"}
R: {"success":true,"message":null,"request_seq":2,"command":"launch","body":null,"running":false,"refs":null,"seq":0,"type":"response"}
E initialized: {"type":"initialized"}
C setBreakpoints: {"source":{"path":"/home/valmadson/prg/python/projetos/vscode/primeiro.cpp","name":"primeiro.cpp"},"lines":[3],"breakpoints":[{"line":3}],"sourceModified":false}
1: (1626) <-1008-break-insert -f primeiro.cpp:3
1: (1627) ->&"No symbol table is loaded. Use the "file" command.\n"
1: (1627) ->1008^done,bkpt={number="2",type="breakpoint",disp="keep",enabled="y",addr="",pending="primeiro.cpp:3",times="0",original-location="primeiro.cpp:3"}
1: (1627) ->(gdb)
1: (1632) 1008: elapsed time 5
R: {"success":true,"message":null,"request_seq":3,"command":"setBreakpoints","body":{"breakpoints":[{"id":1,"verified":true,"line":3,"message":null}]},"running":false,"refs":null,"seq":0,"type":"response"}
E breakpoint: {"reason":"changed","breakpoint":{"id":1,"verified":false,"line":3,"message":"Module containing this breakpoint has not yet loaded or the breakpoint address could not be obtained."},"type":"breakpoint"}
C setFunctionBreakpoints: {"breakpoints":[]}
R: {"success":true,"message":null,"request_seq":4,"command":"setFunctionBreakpoints","body":{"breakpoints":[]},"running":false,"refs":null,"seq":0,"type":"response"}
C configurationDone: null
R: {"success":true,"message":null,"request_seq":5,"command":"configurationDone","body":null,"running":false,"refs":null,"seq":0,"type":"response"}
C threads: null
E output: {"category":"stdout","output":"=thread-group-added,id="i1"\nGNU gdb (Ubuntu 7.11.1-0ubuntu1
16.04) 7.11.1\nCopyright (C) 2016 Free Software Foundation, Inc.\nLicense GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law. Type "show copying"\nand "show warranty" for details.\nThis GDB was configured as "i686-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:\nhttp://www.gnu.org/software/gdb/documentation/.\nFor help, type "help".\nType "apropos word" to search for commands related to "word".\n","data":null,"type":"output"}
=thread-group-added,id="i1"
GNU gdb (Ubuntu 7.11.1-0ubuntu116.04) 7.11.1
Copyright (C) 2016 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 "i686-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".
1: (1705) <-1009-exec-run
1: (1707) ->=thread-group-started,id="i1",pid="4211"
R: {"success":true,"message":null,"request_seq":6,"command":"threads","body":{"threads":[]},"running":false,"refs":null,"seq":0,"type":"response"}
1: (1713) ->=thread-created,id="1",group-id="i1"
1: (1716) ->=library-loaded,id="/lib/ld-linux.so.2",target-name="/lib/ld-linux.so.2",host-name="/lib/ld-linux.so.2",symbols-loaded="0",thread-group="i1"
1: (1726) <-1010-thread-info 1
1: (1749) ->1009^running
1: (1749) ->*running,thread-id="all"
1: (1749) 1009: elapsed time 44
1: (1753) ->(gdb)
1: (1753) ->1010^done,threads=[{id="1",target-id="process 4211",name="primeiro",state="running",core="1"}]
1: (1753) ->(gdb)
1: (1754) 1010: elapsed time 27
1: (1756) ->
"Stopped due to shared library event (no libraries added or removed)\n"
1: (1756) ->stopped,reason="solib-event",thread-id="1",stopped-threads="all",core="1"
E thread: {"reason":"started","threadId":4211,"type":"thread"}
E output: {"category":"stdout","output":"Stopped due to shared library event (no libraries added or removed)\n","data":null,"type":"output"}
Stopped due to shared library event (no libraries added or removed)
C threads: null
R: {"success":true,"message":null,"request_seq":7,"command":"threads","body":{"threads":[{"id":4211,"name":"primeiro"}]},"running":false,"refs":null,"seq":0,"type":"response"}
1: (1782) <-1011-interpreter-exec console "shell echo -e \\033c 1>&2"
1: (1787) ->1011^done
1: (1787) ->(gdb)
1: (1789) 1011: elapsed time 7
1: (1790) <-1012-gdb-set stop-on-solib-events 0
1: (1790) ->1012^done
1: (1790) ->(gdb)
1: (1791) 1012: elapsed time 1
1: (1805) <-1013-break-info 2
1: (1806) ->1013^done,BreakpointTable={nr_rows="1",nr_cols="6",hdr=[{width="7",alignment="-1",col_name="number",colhdr="Num"},{width="14",alignment="-1",col_name="type",colhdr="Type"},{width="4",alignment="-1",col_name="disp",colhdr="Disp"},{width="3",alignment="-1",col_name="enabled",colhdr="Enb"},{width="10",alignment="-1",col_name="addr",colhdr="Address"},{width="40",alignment="2",col_name="what",colhdr="What"}],body=[bkpt={number="2",type="breakpoint",disp="keep",enabled="y",addr="",pending="primeiro.cpp:3",times="0",original-location="primeiro.cpp:3"}]}
1: (1806) ->(gdb)
1: (1814) 1013: elapsed time 8
1: (1824) <-1014-interpreter-exec console "info sharedlibrary"
1: (1825) ->"From To Syms Read Shared Object Library\n"
1: (1825) ->
"0xb7fdb860 0xb7ff461d Yes /lib/ld-linux.so.2\n"
1: (1825) ->1014^done
1: (1826) ->(gdb)
1: (1829) 1014: elapsed time 4
E output: {"category":"console","output":"Loaded '/lib/ld-linux.so.2'. Symbols loaded.\n","data":null,"type":"output"}
Loaded '/lib/ld-linux.so.2'. Symbols loaded.
1: (1837) <--exec-continue
1: (1838) ->^running
1: (1838) ->running,thread-id="all"
1: (1838) ->(gdb)
1: (1849) ->=library-loaded,id="/usr/lib/i386-linux-gnu/libstdc++.so.6",target-name="/usr/lib/i386-linux-gnu/libstdc++.so.6",host-name="/usr/lib/i386-linux-gnu/libstdc++.so.6",symbols-loaded="0",thread-group="i1"
1: (1849) ->=library-loaded,id="/lib/i386-linux-gnu/libgcc_s.so.1",target-name="/lib/i386-linux-gnu/libgcc_s.so.1",host-name="/lib/i386-linux-gnu/libgcc_s.so.1",symbols-loaded="0",thread-group="i1"
1: (1849) ->=library-loaded,id="/lib/i386-linux-gnu/libc.so.6",target-name="/lib/i386-linux-gnu/libc.so.6",host-name="/lib/i386-linux-gnu/libc.so.6",symbols-loaded="0",thread-group="i1"
1: (1849) ->=library-loaded,id="/lib/i386-linux-gnu/libm.so.6",target-name="/lib/i386-linux-gnu/libm.so.6",host-name="/lib/i386-linux-gnu/libm.so.6",symbols-loaded="0",thread-group="i1"
1: (2228) ->=breakpoint-modified,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x0804895a",at="<main+15>",thread-groups=["i1"],times="1",original-location="main"}
1: (2229) ->"\n"
1: (2230) ->
"Breakpoint 1, 0x0804895a in main ()\n"
1: (2230) ->stopped,reason="breakpoint-hit",disp="keep",bkptno="1",frame={addr="0x0804895a",func="main",args=[]},thread-id="1",stopped-threads="all",core="1"
E output: {"category":"stdout","output":"\n","data":null,"type":"output"}
E output: {"category":"stdout","output":"Breakpoint 1, 0x0804895a in main ()\n","data":null,"type":"output"}
Breakpoint 1, 0x0804895a in main ()
1: (2251) <-1015-thread-info
1: (2252) ->1015^done,threads=[{id="1",target-id="process 4211",name="primeiro",frame={level="0",addr="0x0804895a",func="main",args=[]},state="stopped",core="1"}],current-thread-id="1"
1: (2252) ->(gdb)
1: (2257) 1015: elapsed time 5
1: (2273) <-1016-stack-list-frames 0 1000
1: (2274) ->1016^done,stack=[frame={level="0",addr="0x0804895a",func="main"}]
1: (2274) ->(gdb)
1: (2278) 1016: elapsed time 4
E output: {"category":"console","output":"Execute debugger commands using "-exec ", for example "-exec info registers" will list registers in use (when GDB is the debugger)\n","data":null,"type":"output"}
Execute debugger commands using "-exec ", for example "-exec info registers" will list registers in use (when GDB is the debugger)
E stopped: {"threadId":4211,"reason":"step","source":null,"line":0,"column":0,"text":null,"allThreadsStopped":true,"type":"stopped"}
C threads: null
R: {"success":true,"message":null,"request_seq":8,"command":"threads","body":{"threads":[{"id":4211,"name":"primeiro"}]},"running":false,"refs":null,"seq":0,"type":"response"}
C stackTrace: {"threadId":4211,"startFrame":0,"levels":20}
1: (2367) <-1017-stack-list-arguments 2 0 0
1: (2378) ->1017^done,stack-args=[frame={level="0",args=[]}]
1: (2378) ->(gdb)
1: (2394) 1017: elapsed time 26
R: {"success":true,"message":null,"request_seq":9,"command":"stackTrace","body":{"stackFrames":[{"id":1000,"source":null,"line":0,"column":0,"name":"main"}],"totalFrames":1},"running":false,"refs":null,"seq":0,"type":"response"}
C scopes: {"frameId":1000}
R: {"success":true,"message":null,"request_seq":10,"command":"scopes","body":{"scopes":[]},"running":false,"refs":null,"seq":0,"type":"response"}
C next: {"threadId":4211}
1: (438361) <-1018-exec-next
1: (438362) ->~"Single stepping until exit from function main,\nwhich has no line number information.\n"
1: (438362) ->1018^running
1: (438363) ->running,thread-id="all"
1: (438363) ->(gdb)
E output: {"category":"stdout","output":"Single stepping until exit from function main,\nwhich has no line number information.\n","data":null,"type":"output"}
Single stepping until exit from function main,
which has no line number information.
1: (438366) 1018: elapsed time 4
R: {"success":true,"message":null,"request_seq":11,"command":"next","body":null,"running":false,"refs":null,"seq":0,"type":"response"}
1: (438442) ->stopped,reason="end-stepping-range",frame={addr="0xb7c8663a",func="__libc_start_main",args=[{name="main",value="0x804894b

"},{name="argc",value="1"},{name="argv",value="0xbffff194"},{name="init",value="0x8048a90 <__libc_csu_init>"},{name="fini",value="0x8048af0 <__libc_csu_fini>"},{name="rtld_fini",value="0xb7fea780 <_dl_fini>"},{name="stack_end",value="0xbffff18c"}],file="../csu/libc-start.c",fullname="/build/glibc-tpy382/glibc-2.23/csu/../csu/libc-start.c",line="325"},thread-id="1",stopped-threads="all",core="1"
1: (438443) <-1019-stack-list-frames 0 1000
1: (438443) ->1019^done,stack=[frame={level="0",addr="0xb7c8663a",func="__libc_start_main",file="../csu/libc-start.c",fullname="/build/glibc-tpy382/glibc-2.23/csu/../csu/libc-start.c",line="325"},frame={level="1",addr="0x08048871",func="_start"}]
1: (438444) ->(gdb)
1: (438444) 1019: elapsed time 1
E stopped: {"threadId":4211,"reason":"step","source":{"name":"libc-start.c","path":"/build/glibc-tpy382/glibc-2.23/csu/../csu/libc-start.c","sourceReference":0},"line":325,"column":1,"text":null,"allThreadsStopped":true,"type":"stopped"}
C threads: null
R: {"success":true,"message":null,"request_seq":12,"command":"threads","body":{"threads":[{"id":4211,"name":"primeiro"}]},"running":false,"refs":null,"seq":0,"type":"response"}
C stackTrace: {"threadId":4211,"startFrame":0,"levels":20}
1: (438479) <-1020-stack-list-arguments 2 0 1
1: (438482) ->1020^done,stack-args=[frame={level="0",args=[{name="main",type="int (
)(int, char **, char **)",value="0x804894b "},{name="argc",type="int",value="1"},{name="argv",type="char **",value="0xbffff194"},{name="init",type="int (
)(int, char **, char **)",value="0x8048a90 <__libc_csu_init>"},{name="fini",type="void (
)(void)",value="0x8048af0 <__libc_csu_fini>"},{name="rtld_fini",type="void ()(void)",value="0xb7fea780 <_dl_fini>"},{name="stack_end",type="void ",value="0xbffff18c"}]},frame={level="1",args=[]}]
1: (438483) ->(gdb)
1: (438483) 1020: elapsed time 3
R: {"success":true,"message":null,"request_seq":13,"command":"stackTrace","body":{"stackFrames":[{"id":1000,"source":{"name":"libc-start.c","path":"/build/glibc-tpy382/glibc-2.23/csu/../csu/libc-start.c","sourceReference":0},"line":325,"column":1,"name":"__libc_start_main(int (
)(int, char **, char **) main, int argc, char ** argv, int ()(int, char **, char **) init, void ()(void) fini, void ()(void) rtld_fini, void * stack_end)"},{"id":1001,"source":null,"line":0,"column":0,"name":"_start"}],"totalFrames":2},"running":false,"refs":null,"seq":0,"type":"response"}
C scopes: {"frameId":1000}
1: (438533) <-1021-stack-list-variables 0
1: (438534) ->1021^done,variables=[{name="main",arg="1"},{name="argc",arg="1"},{name="argv",arg="1"},{name="init",arg="1"},{name="fini",arg="1"},{name="rtld_fini",arg="1"},{name="stack_end",arg="1"},{name="result"},{name="unwind_buf"},{name="not_first_call"}]
1: (438534) ->(gdb)
1: (438540) 1021: elapsed time 6
1: (438553) <-1022-var-create - * "main"
1: (438554) ->1022^done,name="var1",numchild="0",value="0x804894b ",type="int ()(int, char **, char **)",thread-id="1",has_more="0"
1: (438554) ->(gdb)
1: (438561) 1022: elapsed time 8
1: (438562) <-1023-var-create - * "argc"
1: (438563) ->1023^done,name="var2",numchild="0",value="1",type="int",thread-id="1",has_more="0"
1: (438563) ->(gdb)
1: (438565) 1023: elapsed time 2
1: (438566) <-1024-var-create - * "argv"
1: (438569) ->1024^done,name="var3",numchild="1",value="0xbffff194",type="char **",thread-id="1",has_more="0"
1: (438569) ->(gdb)
1: (438570) 1024: elapsed time 3
1: (438571) <-1025-var-create - * "init"
1: (438572) ->1025^done,name="var4",numchild="0",value="0x8048a90 <__libc_csu_init>",type="int (
)(int, char **, char **)",thread-id="1",has_more="0"
1: (438572) ->(gdb)
1: (438573) 1025: elapsed time 1
1: (438573) <-1026-var-create - * "fini"
1: (438574) ->1026^done,name="var5",numchild="0",value="0x8048af0 <__libc_csu_fini>",type="void ()(void)",thread-id="1",has_more="0"
1: (438575) ->(gdb)
1: (438576) 1026: elapsed time 2
1: (438576) <-1027-var-create - * "rtld_fini"
1: (438580) ->1027^done,name="var6",numchild="0",value="0xb7fea780 <_dl_fini>",type="void (
)(void)",thread-id="1",has_more="0"
1: (438580) ->(gdb)
1: (438580) 1027: elapsed time 4
1: (438581) <-1028-var-create - * "stack_end"
1: (438582) ->1028^done,name="var7",numchild="0",value="0xbffff18c",type="void ",thread-id="1",has_more="0"
1: (438582) ->(gdb)
1: (438583) 1028: elapsed time 1
1: (438583) <-1029-var-create - * "result"
1: (438584) ->1029^done,name="var8",numchild="0",value="0",type="int",thread-id="1",has_more="0"
1: (438585) ->(gdb)
1: (438585) 1029: elapsed time 1
1: (438586) <-1030-var-create - * "unwind_buf"
1: (438591) ->1030^done,name="var9",numchild="2",value="{...}",type="struct pthread_unwind_buf",thread-id="1",has_more="0"
1: (438591) ->(gdb)
1: (438592) 1030: elapsed time 5
1: (438592) <-1031-var-create - * "not_first_call"
1: (438593) ->1031^done,name="var10",numchild="0",value="",type="int",thread-id="1",has_more="0"
1: (438593) ->(gdb)
1: (438594) 1031: elapsed time 1
R: {"success":true,"message":null,"request_seq":14,"command":"scopes","body":{"scopes":[{"name":"Locals","variablesReference":1000,"expensive":false}]},"running":false,"refs":null,"seq":0,"type":"response"}
C variables: {"variablesReference":1000}
R: {"success":true,"message":null,"request_seq":15,"command":"variables","body":{"variables":[{"name":"result","value":"0","type":"int","variablesReference":0,"evaluateName":"result"},{"name":"unwind_buf","value":"{...}","type":"struct pthread_unwind_buf","variablesReference":1001,"evaluateName":"unwind_buf"},{"name":"not_first_call","value":"","type":"int","variablesReference":0,"evaluateName":"not_first_call"},{"name":"main","value":"0x804894b ","type":"int (
)(int, char **, char **)","variablesReference":0,"evaluateName":"main"},{"name":"argc","value":"1","type":"int","variablesReference":0,"evaluateName":"argc"},{"name":"argv","value":"0xbffff194","type":"char **","variablesReference":1002,"evaluateName":"argv"},{"name":"init","value":"0x8048a90 <__libc_csu_init>","type":"int ()(int, char **, char **)","variablesReference":0,"evaluateName":"init"},{"name":"fini","value":"0x8048af0 <__libc_csu_fini>","type":"void ()(void)","variablesReference":0,"evaluateName":"fini"},{"name":"rtld_fini","value":"0xb7fea780 <_dl_fini>","type":"void (*)(void)","variablesReference":0,"evaluateName":"rtld_fini"},{"name":"stack_end","value":"0xbffff18c","type":"void *","variablesReference":0,"evaluateName":"stack_end"}]},"running":false,"refs":null,"seq":0,"type":"response"}
C next: {"threadId":4211}
1: (570354) <-1032-exec-next
1: (570358) ->1032^running
1: (570358) ->*running,thread-id="all"
1: (570358) ->(gdb)
1: (570359) 1032: elapsed time 4
R: {"success":true,"message":null,"request_seq":16,"command":"next","body":null,"running":false,"refs":null,"seq":0,"type":"response"}
1: (570359) ->~"[Inferior 1 (process 4211) exited normally]\n"
1: (570359) ->=thread-exited,id="1",group-id="i1"
E output: {"category":"stdout","output":"[Inferior 1 (process 4211) exited normally]\n","data":null,"type":"output"}
[Inferior 1 (process 4211) exited normally]
1: (570363) ->=thread-group-exited,id="i1",exit-code="0"
1: (570363) ->*stopped,reason="exited-normally"
E thread: {"reason":"exited","threadId":4211,"type":"thread"}
1: (570369) <--gdb-exit
1: (570370) ->^exit
E output: {"category":"console","output":"The program '/home/valmadson/prg/python/projetos/vscode/primeiro' has exited with code 0 (0x00000000).\r\n\n","data":null,"type":"output"}
The program '/home/valmadson/prg/python/projetos/vscode/primeiro' has exited with code 0 (0x00000000).
E exited: {"exitCode":0,"type":"exited"}
E terminated: {"type":"terminated"}
E output: {"category":"telemetry","output":"VS/Diagnostics/Debugger/DebugCompleted","data":{"VS.Diagnostics.Debugger.ImplementationName":"Microsoft.MIDebugEngine","VS.Diagnostics.Debugger.EngineVersion":"14.0.40301.2","VS.Diagnostics.Debugger.HostVersion":"1.0.30301.1","VS.Diagnostics.Debugger.AdapterId":"cppdbg","VS.Diagnostics.Debugger.DebugCompleted.BreakCounter":2},"type":"output"}
C disconnect: {"restart":false}
R: {"success":true,"message":null,"request_seq":17,"command":"disconnect","body":null,"running":false,"refs":null,"seq":0,"type":"response"}

@pieandcakes pieandcakes added external and removed more info needed The issue report is not actionable in its current state labels Mar 3, 2017
@pieandcakes
Copy link
Contributor

@Valmadson This looks like you aren't compiling with -g. I setup an Ubuntu 16.04 32bit machine and tested this. If you run: g++ -g primeiro.cpp -o primeiro and then set a breakpoint or stopAtEntry it works. If you don't set the -g flag, then you get the errors you are seeing above.

@Valmadson
Copy link
Author

In your case, show messages in top ?

  Unable to open 'Unknown Source': File not found (/Unknown Source).
  Unable to open 'libc-start.c': File not found (/build/glibc-tpy382/glibc-2.23/csu/libc-start.c).

What file are you waiting for? File not found (/Unknown Source)

you have this file /libc-start.c in the folder?

@pieandcakes
Copy link
Contributor

No. I only get that error if I compile g++ primeiro.cpp -o primeiro. To fix it and allow user breakpoints you have to compile with -g. You only get the Unknown Source and libc-start.c behavior if you forget to use -g

@Valmadson
Copy link
Author

You could show the tasks.json and launch.json ?

@pieandcakes
Copy link
Contributor

Here are my files:
primeiro.cpp

#include <iostream>

using namespace std;

int main() {
    string message = "Hello World"; // set optional breakpoint
    cout << message << endl;
}

tasks.json

{
    // See https://go.microsoft.com/fwlink/?LinkId=733558
    // for the documentation about the tasks.json format
    "version": "0.1.0",
    "command": "g++",
    "isShellCommand": true,
    "args": ["-g", "primeiro.cpp", "-o", "primeiro"],
    "showOutput": "always"
}

launch.json

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "C++ Launch",
            "type": "cppdbg",
            "request": "launch",
            "program": "${workspaceRoot}/primeiro",
            "args": [],
            "stopAtEntry": false,
            "cwd": "${workspaceRoot}",
            "environment": [],
            "externalConsole": true,
            "linux": {
                "MIMode": "gdb"
            },
            "preLaunchTask": "g++"
        }
    ]
}

I've verified that i'm running our version of the extension 0.10.2 and VSCode version 1.10.1

@Valmadson
Copy link
Author

Please, Could inform : distribution linux and version.

@pieandcakes
Copy link
Contributor

image

@pieandcakes
Copy link
Contributor

@Valmadson have you been able to get it working?

@Valmadson
Copy link
Author

Valmadson commented Mar 6, 2017

thanks for your attention.

I update VSCode to 1.09 to 1.10

my launch.json
{
"version": "0.2.0",
"configurations": [
{
"name": "C++ Launch",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceRoot}/main",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceRoot}",
"environment": [],
"externalConsole": true,
"linux": {
"MIMode": "gdb"
},
"preLaunchTask": "g++"
}
]
}

my task.json
{
"version": "0.1.0",
"command": "g++",
"isShellCommand": true,
"args": ["-g", "main.cpp", "-o", "main.o"],
"showOutput": "always"
}

main.cpp
#include

using namespace std;

int main() {
string message = "Hello World"; // set optional breakpoint
cout << message << endl;
}

when run debug , show message :
The preLaunchTask 'g++' terminated with exit code 1. [debug anyway] [show problems] [close]

if press debug anyway, show message :
launch: program '/home/valmadson/prg/python/projetos/vscode/main' does not exist

However i make a new folder : '/home/valmadson/prg/python/projetos/vscode/teste' and the file main.cpp in the folder.

if press [show problems] , show this :
launch: program '/home/valmadson/prg/python/projetos/vscode/main' does not exist

Other problem : why press Ctrl+Shift+B in OUTPUT show :

         g++: error: main.cpp: No such file or directory
         g++: fatal error: no input files
         compilation terminated.

, The correct one would be to show the message: "Hello World" ?

The tasks.json, launch.json and main.cpp are in the folder : '/home/valmadson/prg/python/projetos/vscode/teste'

@pieandcakes
Copy link
Contributor

when run debug , show message :
The preLaunchTask 'g++' terminated with exit code 1. [debug anyway] [show problems] [close]

This tells me you have a problem with g++ on your machine. If you can open a Terminal window and manually compile by using g++ -g main.cpp -o main.o does it work? Also -o main.o tells me that you are compiling the output as main.o and you are expecting main which are not the same as you are missing the file extension .o.

The -o isn't for it to create an object file, but to set the output executable name of the compile task.

Your other problem of No such file or directory tells me g++ can't find the file it is being asked to compile. This might be an issue with the task not running in your workspace directory. You will need to read the VS Code documentation for help on how to fix this issue as task.json is a VS Code feature and not a feature of this extension. If you are still having a problem with compilation, please file an issue with them at https://github.com/Microsoft/vscode/issues.

@Valmadson
Copy link
Author

Valmadson commented Mar 7, 2017 via email

@pieandcakes
Copy link
Contributor

Your image didn't come through.

@Valmadson
Copy link
Author

Valmadson commented Mar 7, 2017 via email

@pieandcakes
Copy link
Contributor

Still no image. If you hit preview do you see it? I don't see anything. Might be a GitHub issue.

@Valmadson
Copy link
Author

Valmadson commented Mar 9, 2017 via email

@pieandcakes
Copy link
Contributor

Thanks for the update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants