microsoft / vscode-cpptools

Official repository for the Microsoft C/C++ extension for VS Code.
Other
5.53k stars 1.56k forks source link

Debugger not stopping on breakpoints #2830

Closed dsinecos closed 5 years ago

dsinecos commented 5 years ago

Type: Debugger Input information below Describe the bug

To Reproduce

hello-world.c

#include <stdio.h>

int main()
{
    printf("Hello World\n");
    printf("Hello Again\n");
}

tasks.json

{
    // See https://go.microsoft.com/fwlink/?LinkId=733558
    // for the documentation about the tasks.json format
    "version": "2.0.0",
    "tasks": [
        {
            "label": "Build",
            "type": "shell",
            "command": "gcc",
            "args": [
                "-g",
                "-o",
                "hello-world",
                "hello-world.c"
            ],
            "group": {
                "kind": "build",
                "isDefault": true
            }
        }
    ]
}

launch.json

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "(gdb) Launch",
            "type": "cppdbg",
            "request": "launch",
            "program": "${workspaceFolder}/hello-world",
            "args": [],
            "stopAtEntry": true,
            "cwd": "${workspaceFolder}",
            "environment": [],
            "externalConsole": false,
            "MIMode": "gdb",
            "miDebuggerPath": "/usr/bin/gdb",
            "logging": { "engineLogging": true, "trace": true, "traceResponse": true },
            "setupCommands": [
                {
                    "description": "Enable pretty-printing for gdb",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                }
            ]
        }
    ]
}

Additional context

Logs

--> E (output): {"event":"output","body":{"category":"console","output":"1: (200) LaunchOptions<LocalLaunchOptions xmlns='http://schemas.microsoft.com/vstudio/MDDDebuggerOptions/2014'\n"},"seq":2,"type":"event"}
1: (200) LaunchOptions<LocalLaunchOptions xmlns='http://schemas.microsoft.com/vstudio/MDDDebuggerOptions/2014'
--> E (output): {"event":"output","body":{"category":"console","output":"1: (215) LaunchOptions  ExePath='/home/divyanshu/programming/learn-c/hello-world'\n"},"seq":4,"type":"event"}
1: (215) LaunchOptions  ExePath='/home/divyanshu/programming/learn-c/hello-world'
--> E (output): {"event":"output","body":{"category":"console","output":"1: (215) LaunchOptions  WorkingDirectory='/home/divyanshu/programming/learn-c'\n"},"seq":6,"type":"event"}
1: (215) LaunchOptions  WorkingDirectory='/home/divyanshu/programming/learn-c'
--> E (output): {"event":"output","body":{"category":"console","output":"1: (215) LaunchOptions  ExeArguments=''\n"},"seq":8,"type":"event"}
1: (215) LaunchOptions  ExeArguments=''
--> E (output): {"event":"output","body":{"category":"console","output":"1: (216) LaunchOptions  MIMode='gdb'\n"},"seq":10,"type":"event"}
1: (216) LaunchOptions  MIMode='gdb'
--> E (output): {"event":"output","body":{"category":"console","output":"1: (216) LaunchOptions  MIDebuggerPath='/usr/bin/gdb'\n"},"seq":12,"type":"event"}
1: (216) LaunchOptions  MIDebuggerPath='/usr/bin/gdb'
--> E (output): {"event":"output","body":{"category":"console","output":"1: (217) LaunchOptions  WaitDynamicLibLoad='false'\n"},"seq":14,"type":"event"}
1: (217) LaunchOptions  WaitDynamicLibLoad='false'
--> E (output): {"event":"output","body":{"category":"console","output":"1: (218) LaunchOptions>\n"},"seq":16,"type":"event"}
1: (218) LaunchOptions>
--> E (output): {"event":"output","body":{"category":"console","output":"1: (218) LaunchOptions    <SetupCommands>\n"},"seq":18,"type":"event"}
1: (218) LaunchOptions    <SetupCommands>
--> E (output): {"event":"output","body":{"category":"console","output":"1: (219) LaunchOptions        <Command IgnoreFailures='true' Description='Enable pretty-printing for gdb'>-enable-pretty-printing</Command>\n"},"seq":20,"type":"event"}
1: (219) LaunchOptions        <Command IgnoreFailures='true' Description='Enable pretty-printing for gdb'>-enable-pretty-printing</Command>
--> E (output): {"event":"output","body":{"category":"console","output":"1: (219) LaunchOptions    </SetupCommands>\n"},"seq":22,"type":"event"}
1: (219) LaunchOptions    </SetupCommands>
--> E (output): {"event":"output","body":{"category":"console","output":"1: (220) LaunchOptions</LocalLaunchOptions>\n"},"seq":24,"type":"event"}
1: (220) LaunchOptions</LocalLaunchOptions>
--> E (output): {"event":"output","body":{"category":"console","output":"1: (367) DbgCmd:echo $$ > /tmp/Microsoft-MIEngine-Pid-9n4yyjpo.ta7 ; cd /home/divyanshu/programming/learn-c ; DbgTerm=`tty` ; set -o monitor ; trap 'rm /tmp/Microsoft-MIEngine-In-8ug3jvha.0s1 /tmp/Microsoft-MIEngine-Out-k320f8no.w9p /tmp/Microsoft-MIEngine-Pid-9n4yyjpo.ta7 /tmp/Microsoft-MIEngine-Cmd-6i6c3kzo.sn9' EXIT ; /usr/bin/gdb --interpreter=mi --tty=$DbgTerm < /tmp/Microsoft-MIEngine-In-8ug3jvha.0s1 > /tmp/Microsoft-MIEngine-Out-k320f8no.w9p & clear; pid=$! ; echo $pid > /tmp/Microsoft-MIEngine-Pid-9n4yyjpo.ta7 ; wait $pid; \n"},"seq":26,"type":"event"}
1: (367) DbgCmd:echo $$ > /tmp/Microsoft-MIEngine-Pid-9n4yyjpo.ta7 ; cd /home/divyanshu/programming/learn-c ; DbgTerm=`tty` ; set -o monitor ; trap 'rm /tmp/Microsoft-MIEngine-In-8ug3jvha.0s1 /tmp/Microsoft-MIEngine-Out-k320f8no.w9p /tmp/Microsoft-MIEngine-Pid-9n4yyjpo.ta7 /tmp/Microsoft-MIEngine-Cmd-6i6c3kzo.sn9' EXIT ; /usr/bin/gdb --interpreter=mi --tty=$DbgTerm < /tmp/Microsoft-MIEngine-In-8ug3jvha.0s1 > /tmp/Microsoft-MIEngine-Out-k320f8no.w9p & clear; pid=$! ; echo $pid > /tmp/Microsoft-MIEngine-Pid-9n4yyjpo.ta7 ; wait $pid; 
--> C (runInTerminal-28): {"command":"runInTerminal","arguments":{"kind":"integrated","title":"cppdbg: hello-world","cwd":"","args":["sh","/tmp/Microsoft-MIEngine-Cmd-6i6c3kzo.sn9"],"env":{}},"seq":28,"type":"request"}
--> E (output): {"event":"output","body":{"category":"console","output":"1: (388) Wait for connection completion.\n"},"seq":30,"type":"event"}
1: (388) Wait for connection completion.
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1082) ->=thread-group-added,id=\"i1\"\n"},"seq":32,"type":"event"}
1: (1082) ->=thread-group-added,id="i1"
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1086) ->~\"GNU gdb (Ubuntu 7.11.1-0ubuntu1~16.5) 7.11.1\\n\"\n"},"seq":34,"type":"event"}
1: (1086) ->~"GNU gdb (Ubuntu 7.11.1-0ubuntu1~16.5) 7.11.1\n"
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1087) ->~\"Copyright (C) 2016 Free Software Foundation, Inc.\\n\"\n"},"seq":36,"type":"event"}
1: (1087) ->~"Copyright (C) 2016 Free Software Foundation, Inc.\n"
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1089) ->~\"License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\\nThis is free software: you are free to change and redistribute it.\\nThere is NO WARRANTY, to the extent permitted by law.  Type \\\"show copying\\\"\\nand \\\"show warranty\\\" for details.\\n\"\n"},"seq":38,"type":"event"}
1: (1089) ->~"License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law.  Type \"show copying\"\nand \"show warranty\" for details.\n"
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1090) ->~\"This GDB was configured as \\\"x86_64-linux-gnu\\\".\\nType \\\"show configuration\\\" for configuration details.\"\n"},"seq":40,"type":"event"}
1: (1090) ->~"This GDB was configured as \"x86_64-linux-gnu\".\nType \"show configuration\" for configuration details."
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1090) ->~\"\\nFor bug reporting instructions, please see:\\n\"\n"},"seq":42,"type":"event"}
1: (1090) ->~"\nFor bug reporting instructions, please see:\n"
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1091) ->~\"<http://www.gnu.org/software/gdb/bugs/>.\\n\"\n"},"seq":44,"type":"event"}
1: (1091) ->~"<http://www.gnu.org/software/gdb/bugs/>.\n"
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1091) ->~\"Find the GDB manual and other documentation resources online at:\\n<http://www.gnu.org/software/gdb/documentation/>.\\n\"\n"},"seq":46,"type":"event"}
1: (1091) ->~"Find the GDB manual and other documentation resources online at:\n<http://www.gnu.org/software/gdb/documentation/>.\n"
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1091) ->~\"For help, type \\\"help\\\".\\n\"\n"},"seq":48,"type":"event"}
1: (1091) ->~"For help, type \"help\".\n"
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1092) ->~\"Type \\\"apropos word\\\" to search for commands related to \\\"word\\\".\\n\"\n"},"seq":50,"type":"event"}
1: (1092) ->~"Type \"apropos word\" to search for commands related to \"word\".\n"
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1092) ->(gdb)\n"},"seq":52,"type":"event"}
1: (1092) ->(gdb)
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1096) <-1001-gdb-set target-async on\n"},"seq":54,"type":"event"}
1: (1096) <-1001-gdb-set target-async on
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1097) ->1001^done\n"},"seq":56,"type":"event"}
1: (1097) ->1001^done
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1098) ->(gdb)\n"},"seq":58,"type":"event"}
1: (1098) ->(gdb)
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1100) 1001: elapsed time 4\n"},"seq":60,"type":"event"}
1: (1100) 1001: elapsed time 4
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1112) <-1002-enable-pretty-printing\n"},"seq":62,"type":"event"}
1: (1112) <-1002-enable-pretty-printing
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1113) ->1002^done\n"},"seq":64,"type":"event"}
1: (1113) ->1002^done
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1113) ->(gdb)\n"},"seq":66,"type":"event"}
1: (1113) ->(gdb)
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1113) 1002: elapsed time 0\n"},"seq":68,"type":"event"}
1: (1113) 1002: elapsed time 0
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1114) <-1003-interpreter-exec console \"set pagination off\"\n"},"seq":70,"type":"event"}
1: (1114) <-1003-interpreter-exec console "set pagination off"
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1115) ->=cmd-param-changed,param=\"pagination\",value=\"off\"\n"},"seq":72,"type":"event"}
1: (1115) ->=cmd-param-changed,param="pagination",value="off"
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1115) ->1003^done\n"},"seq":74,"type":"event"}
1: (1115) ->1003^done
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1115) ->(gdb)\n"},"seq":76,"type":"event"}
1: (1115) ->(gdb)
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1115) 1003: elapsed time 1\n"},"seq":78,"type":"event"}
1: (1115) 1003: elapsed time 1
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1116) <-1004-gdb-set auto-solib-add on\n"},"seq":80,"type":"event"}
1: (1116) <-1004-gdb-set auto-solib-add on
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1116) ->1004^done\n"},"seq":82,"type":"event"}
1: (1116) ->1004^done
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1118) ->(gdb)\n"},"seq":84,"type":"event"}
1: (1118) ->(gdb)
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1118) 1004: elapsed time 1\n"},"seq":86,"type":"event"}
1: (1118) 1004: elapsed time 1
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1119) <-1005-gdb-set solib-search-path /home/divyanshu/programming/learn-c:\n"},"seq":88,"type":"event"}
1: (1119) <-1005-gdb-set solib-search-path /home/divyanshu/programming/learn-c:
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1120) ->1005^done\n"},"seq":90,"type":"event"}
1: (1120) ->1005^done
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1121) ->(gdb)\n"},"seq":92,"type":"event"}
1: (1121) ->(gdb)
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1122) 1005: elapsed time 2\n"},"seq":94,"type":"event"}
1: (1122) 1005: elapsed time 2
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1122) <-1006-gdb-set stop-on-solib-events 1\n"},"seq":96,"type":"event"}
1: (1122) <-1006-gdb-set stop-on-solib-events 1
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1123) ->1006^done\n"},"seq":98,"type":"event"}
1: (1123) ->1006^done
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1124) ->(gdb)\n"},"seq":100,"type":"event"}
1: (1124) ->(gdb)
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1124) 1006: elapsed time 1\n"},"seq":102,"type":"event"}
1: (1124) 1006: elapsed time 1
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1124) <-1007-environment-cd /home/divyanshu/programming/learn-c\n"},"seq":104,"type":"event"}
1: (1124) <-1007-environment-cd /home/divyanshu/programming/learn-c
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1125) ->1007^done\n"},"seq":106,"type":"event"}
1: (1125) ->1007^done
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1125) ->(gdb)\n"},"seq":108,"type":"event"}
1: (1125) ->(gdb)
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1125) 1007: elapsed time 0\n"},"seq":110,"type":"event"}
1: (1125) 1007: elapsed time 0
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1126) <-1008-file-exec-and-symbols /home/divyanshu/programming/learn-c/hello-world\n"},"seq":112,"type":"event"}
1: (1126) <-1008-file-exec-and-symbols /home/divyanshu/programming/learn-c/hello-world
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1127) ->1008^done\n"},"seq":114,"type":"event"}
1: (1127) ->1008^done
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1128) ->(gdb)\n"},"seq":116,"type":"event"}
1: (1128) ->(gdb)
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1128) 1008: elapsed time 1\n"},"seq":118,"type":"event"}
1: (1128) 1008: elapsed time 1
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1130) <-1009-interpreter-exec console \"show architecture\"\n"},"seq":120,"type":"event"}
1: (1130) <-1009-interpreter-exec console "show architecture"
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1131) ->~\"The target architecture is set automatically (currently i386:x86-64)\\n\"\n"},"seq":122,"type":"event"}
1: (1131) ->~"The target architecture is set automatically (currently i386:x86-64)\n"
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1131) ->1009^done\n"},"seq":124,"type":"event"}
1: (1131) ->1009^done
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1133) ->(gdb)\n"},"seq":126,"type":"event"}
1: (1133) ->(gdb)
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1133) 1009: elapsed time 2\n"},"seq":128,"type":"event"}
1: (1133) 1009: elapsed time 2
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1137) <-1010-break-insert -f main\n"},"seq":130,"type":"event"}
1: (1137) <-1010-break-insert -f main
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1138) ->1010^done,bkpt={number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"0x000000000040052a\",at=\"<main+4>\",thread-groups=[\"i1\"],times=\"0\",original-location=\"main\"}\n"},"seq":132,"type":"event"}
1: (1138) ->1010^done,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x000000000040052a",at="<main+4>",thread-groups=["i1"],times="0",original-location="main"}
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1138) ->(gdb)\n"},"seq":134,"type":"event"}
1: (1138) ->(gdb)
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1144) 1010: elapsed time 6\n"},"seq":136,"type":"event"}
1: (1144) 1010: elapsed time 6
--> E (output): {"event":"output","body":{"category":"telemetry","output":"VS/Diagnostics/Debugger/Launch","data":{"VS.Diagnostics.Debugger.ImplementationName":"Microsoft.MIDebugEngine","VS.Diagnostics.Debugger.EngineVersion":"14.0.51030.1","VS.Diagnostics.Debugger.HostVersion":"14.0.51030.1","VS.Diagnostics.Debugger.AdapterId":"cppdbg","VS.Diagnostics.Debugger.Launch.Duration":1040,"VS.Diagnostics.Debugger.Launch.IsCoreDump":false,"VS.Diagnostics.Debugger.VisualizerFileUsed":false,"VS.Diagnostics.Debugger.SourceFileMappings":0}},"seq":138,"type":"event"}
--> R (launch-2): {"request_seq":2,"success":true,"command":"launch","body":{},"seq":140,"type":"response"}
--> E (initialized): {"event":"initialized","body":{},"seq":142,"type":"event"}
<--   R (runInTerminal-28) [794 ms]: {"type":"response","seq":3,"command":"runInTerminal","request_seq":28,"success":true,"body":{}}
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1218) ShellPid=20225\n"},"seq":145,"type":"event"}
1: (1218) ShellPid=20225
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1219) DebuggerPid=20227\n"},"seq":147,"type":"event"}
1: (1219) DebuggerPid=20227
<--   C (setBreakpoints-4): {"command":"setBreakpoints","arguments":{"source":{"name":"hello-world.c","path":"/home/divyanshu/programming/learn-c/hello-world.c"},"lines":[5,6],"breakpoints":[{"line":5},{"line":6}],"sourceModified":false},"type":"request","seq":4}
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1250) <-1011-break-insert -f hello-world.c:5\n"},"seq":150,"type":"event"}
1: (1250) <-1011-break-insert -f hello-world.c:5
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1250) ->&\"No symbol table is loaded.  Use the \\\"file\\\" command.\\n\"\n"},"seq":152,"type":"event"}
1: (1250) ->&"No symbol table is loaded.  Use the \"file\" command.\n"
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1251) ->1011^done,bkpt={number=\"2\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"<PENDING>\",pending=\"hello-world.c:5\",times=\"0\",original-location=\"hello-world.c:5\"}\n"},"seq":154,"type":"event"}
1: (1251) ->1011^done,bkpt={number="2",type="breakpoint",disp="keep",enabled="y",addr="<PENDING>",pending="hello-world.c:5",times="0",original-location="hello-world.c:5"}
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1252) ->(gdb)\n"},"seq":156,"type":"event"}
1: (1252) ->(gdb)
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1252) 1011: elapsed time 1\n"},"seq":158,"type":"event"}
1: (1252) 1011: elapsed time 1
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1263) <-1012-break-insert -f hello-world.c:6\n"},"seq":160,"type":"event"}
1: (1263) <-1012-break-insert -f hello-world.c:6
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1264) ->&\"No symbol table is loaded.  Use the \\\"file\\\" command.\\n\"\n"},"seq":162,"type":"event"}
1: (1264) ->&"No symbol table is loaded.  Use the \"file\" command.\n"
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1264) ->1012^done,bkpt={number=\"3\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"<PENDING>\",pending=\"hello-world.c:6\",times=\"0\",original-location=\"hello-world.c:6\"}\n"},"seq":164,"type":"event"}
1: (1264) ->1012^done,bkpt={number="3",type="breakpoint",disp="keep",enabled="y",addr="<PENDING>",pending="hello-world.c:6",times="0",original-location="hello-world.c:6"}
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1264) ->(gdb)\n"},"seq":166,"type":"event"}
1: (1264) ->(gdb)
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1264) 1012: elapsed time 1\n"},"seq":168,"type":"event"}
1: (1264) 1012: elapsed time 1
--> R (setBreakpoints-4): {"request_seq":4,"success":true,"command":"setBreakpoints","body":{"breakpoints":[{"id":1,"verified":true,"line":5},{"id":2,"verified":true,"line":6}]},"seq":170,"type":"response"}
--> E (breakpoint): {"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":5}},"seq":172,"type":"event"}
--> E (breakpoint): {"event":"breakpoint","body":{"reason":"changed","breakpoint":{"id":2,"verified":false,"message":"Module containing this breakpoint has not yet loaded or the breakpoint address could not be obtained.","line":6}},"seq":174,"type":"event"}
<--   C (setFunctionBreakpoints-5): {"command":"setFunctionBreakpoints","arguments":{"breakpoints":[]},"type":"request","seq":5}
--> R (setFunctionBreakpoints-5): {"request_seq":5,"success":true,"command":"setFunctionBreakpoints","body":{"breakpoints":[]},"seq":177,"type":"response"}
<--   C (setExceptionBreakpoints-6): {"command":"setExceptionBreakpoints","arguments":{"filters":[]},"type":"request","seq":6}
--> R (setExceptionBreakpoints-6): {"request_seq":6,"success":true,"command":"setExceptionBreakpoints","body":{},"seq":180,"type":"response"}
<--   C (configurationDone-7): {"command":"configurationDone","type":"request","seq":7}
--> R (configurationDone-7): {"request_seq":7,"success":true,"command":"configurationDone","body":{},"seq":183,"type":"response"}
--> E (output): {"event":"output","body":{"category":"stdout","output":"=thread-group-added,id=\"i1\"\nGNU gdb (Ubuntu 7.11.1-0ubuntu1~16.5) 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 \"x86_64-linux-gnu\".\nType \"show configuration\" for configuration details.\nFor bug reporting instructions, please see:\n<http://www.gnu.org/software/gdb/bugs/>.\nFind the GDB manual and other documentation resources online at:\n<http://www.gnu.org/software/gdb/documentation/>.\nFor help, type \"help\".\nType \"apropos word\" to search for commands related to \"word\".\nWarning: Debuggee TargetArchitecture not detected, assuming x86_64.\n=cmd-param-changed,param=\"pagination\",value=\"off\"\n"},"seq":185,"type":"event"}
=thread-group-added,id="i1"
GNU gdb (Ubuntu 7.11.1-0ubuntu1~16.5) 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 "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word".
Warning: Debuggee TargetArchitecture not detected, assuming x86_64.
=cmd-param-changed,param="pagination",value="off"
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1312) <-1013-exec-run\n"},"seq":187,"type":"event"}
1: (1312) <-1013-exec-run
<--   C (threads-8): {"command":"threads","type":"request","seq":8}
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1314) ->=thread-group-started,id=\"i1\",pid=\"20238\"\n"},"seq":190,"type":"event"}
1: (1314) ->=thread-group-started,id="i1",pid="20238"
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1314) ->=thread-created,id=\"1\",group-id=\"i1\"\n"},"seq":192,"type":"event"}
1: (1314) ->=thread-created,id="1",group-id="i1"
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1325) <-1014-thread-info 1\n"},"seq":195,"type":"event"}
1: (1325) <-1014-thread-info 1
--> R (threads-8): {"request_seq":8,"success":true,"command":"threads","body":{"threads":[]},"seq":194,"type":"response"}
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1336) ->=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\"\n"},"seq":198,"type":"event"}
1: (1336) ->=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"
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1350) ->1013^running\n"},"seq":200,"type":"event"}
1: (1350) ->1013^running
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1350) ->*running,thread-id=\"all\"\n"},"seq":202,"type":"event"}
1: (1350) ->*running,thread-id="all"
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1350) 1013: elapsed time 38\n"},"seq":204,"type":"event"}
1: (1350) 1013: elapsed time 38
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1351) ->(gdb)\n"},"seq":206,"type":"event"}
1: (1351) ->(gdb)
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1351) ->1014^done,threads=[{id=\"1\",target-id=\"process 20238\",name=\"hello-world\",state=\"running\",core=\"1\"}]\n"},"seq":208,"type":"event"}
1: (1351) ->1014^done,threads=[{id="1",target-id="process 20238",name="hello-world",state="running",core="1"}]
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1352) ->(gdb)\n"},"seq":210,"type":"event"}
1: (1352) ->(gdb)
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1353) ->~\"Stopped due to shared library event (no libraries added or removed)\\n\"\n"},"seq":212,"type":"event"}
1: (1353) ->~"Stopped due to shared library event (no libraries added or removed)\n"
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1353) 1014: elapsed time 28\n"},"seq":214,"type":"event"}
1: (1353) 1014: elapsed time 28
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1353) ->*stopped,reason=\"solib-event\",thread-id=\"1\",stopped-threads=\"all\",core=\"1\"\n"},"seq":216,"type":"event"}
1: (1353) ->*stopped,reason="solib-event",thread-id="1",stopped-threads="all",core="1"
--> E (thread): {"event":"thread","body":{"reason":"started","threadId":20238},"seq":218,"type":"event"}
--> E (output): {"event":"output","body":{"category":"stdout","output":"Stopped due to shared library event (no libraries added or removed)\n"},"seq":220,"type":"event"}
Stopped due to shared library event (no libraries added or removed)
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1365) <-1015-interpreter-exec console \"shell echo -e \\\\\\\\033c 1>&2\"\n"},"seq":222,"type":"event"}
1: (1365) <-1015-interpreter-exec console "shell echo -e \\\\033c 1>&2"
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1370) ->1015^done\n"},"seq":224,"type":"event"}
1: (1370) ->1015^done
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1371) ->(gdb)\n"},"seq":226,"type":"event"}
1: (1371) ->(gdb)
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1372) 1015: elapsed time 6\n"},"seq":228,"type":"event"}
1: (1372) 1015: elapsed time 6
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1372) <-1016-gdb-set stop-on-solib-events 0\n"},"seq":230,"type":"event"}
1: (1372) <-1016-gdb-set stop-on-solib-events 0
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1373) ->1016^done\n"},"seq":232,"type":"event"}
1: (1373) ->1016^done
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1373) ->(gdb)\n"},"seq":234,"type":"event"}
1: (1373) ->(gdb)
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1373) 1016: elapsed time 1\n"},"seq":236,"type":"event"}
1: (1373) 1016: elapsed time 1
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1387) <-1017-break-info 2\n"},"seq":238,"type":"event"}
1: (1387) <-1017-break-info 2
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1387) ->1017^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>\",pending=\"hello-world.c:5\",times=\"0\",original-location=\"hello-world.c:5\"}]}\n"},"seq":240,"type":"event"}
1: (1387) ->1017^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>",pending="hello-world.c:5",times="0",original-location="hello-world.c:5"}]}
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1389) ->(gdb)\n"},"seq":242,"type":"event"}
1: (1389) ->(gdb)
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1391) 1017: elapsed time 4\n"},"seq":244,"type":"event"}
1: (1391) 1017: elapsed time 4
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1395) <-1018-break-info 3\n"},"seq":246,"type":"event"}
1: (1395) <-1018-break-info 3
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1396) ->1018^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>\",pending=\"hello-world.c:6\",times=\"0\",original-location=\"hello-world.c:6\"}]}\n"},"seq":248,"type":"event"}
1: (1396) ->1018^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>",pending="hello-world.c:6",times="0",original-location="hello-world.c:6"}]}
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1397) ->(gdb)\n"},"seq":250,"type":"event"}
1: (1397) ->(gdb)
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1397) 1018: elapsed time 1\n"},"seq":252,"type":"event"}
1: (1397) 1018: elapsed time 1
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1399) <-1019-interpreter-exec console \"info sharedlibrary\"\n"},"seq":254,"type":"event"}
1: (1399) <-1019-interpreter-exec console "info sharedlibrary"
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1400) ->~\"From                To                  Syms Read   Shared Object Library\\n\"\n"},"seq":256,"type":"event"}
1: (1400) ->~"From                To                  Syms Read   Shared Object Library\n"
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1400) ->~\"0x00007ffff7dd7ac0  0x00007ffff7df5850  Yes         /lib64/ld-linux-x86-64.so.2\\n\"\n"},"seq":258,"type":"event"}
1: (1400) ->~"0x00007ffff7dd7ac0  0x00007ffff7df5850  Yes         /lib64/ld-linux-x86-64.so.2\n"
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1401) ->1019^done\n"},"seq":260,"type":"event"}
1: (1401) ->1019^done
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1401) ->(gdb)\n"},"seq":262,"type":"event"}
1: (1401) ->(gdb)
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1401) 1019: elapsed time 2\n"},"seq":264,"type":"event"}
1: (1401) 1019: elapsed time 2
--> E (output): {"event":"output","body":{"category":"console","output":"Loaded '/lib64/ld-linux-x86-64.so.2'. Symbols loaded.\n"},"seq":266,"type":"event"}
Loaded '/lib64/ld-linux-x86-64.so.2'. Symbols loaded.
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1406) <--exec-continue\n"},"seq":268,"type":"event"}
1: (1406) <--exec-continue
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1406) ->^running\n"},"seq":270,"type":"event"}
1: (1406) ->^running
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1407) ->*running,thread-id=\"all\"\n"},"seq":272,"type":"event"}
1: (1407) ->*running,thread-id="all"
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1407) ->(gdb)\n"},"seq":274,"type":"event"}
1: (1407) ->(gdb)
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1407) ->=library-loaded,id=\"/lib/x86_64-linux-gnu/libc.so.6\",target-name=\"/lib/x86_64-linux-gnu/libc.so.6\",host-name=\"/lib/x86_64-linux-gnu/libc.so.6\",symbols-loaded=\"0\",thread-group=\"i1\"\n"},"seq":276,"type":"event"}
1: (1407) ->=library-loaded,id="/lib/x86_64-linux-gnu/libc.so.6",target-name="/lib/x86_64-linux-gnu/libc.so.6",host-name="/lib/x86_64-linux-gnu/libc.so.6",symbols-loaded="0",thread-group="i1"
<--   C (threads-9): {"command":"threads","type":"request","seq":9}
--> R (threads-9): {"request_seq":9,"success":true,"command":"threads","body":{"threads":[{"id":20238,"name":"hello-world"}]},"seq":279,"type":"response"}
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1559) ->=breakpoint-modified,bkpt={number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"0x000000000040052a\",at=\"<main+4>\",thread-groups=[\"i1\"],times=\"1\",original-location=\"main\"}\n"},"seq":281,"type":"event"}
1: (1559) ->=breakpoint-modified,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x000000000040052a",at="<main+4>",thread-groups=["i1"],times="1",original-location="main"}
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1560) ->~\"\\n\"\n"},"seq":283,"type":"event"}
1: (1560) ->~"\n"
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1560) ->~\"Breakpoint 1, 0x000000000040052a in main ()\\n\"\n"},"seq":285,"type":"event"}
1: (1560) ->~"Breakpoint 1, 0x000000000040052a in main ()\n"
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1561) ->*stopped,reason=\"breakpoint-hit\",disp=\"keep\",bkptno=\"1\",frame={addr=\"0x000000000040052a\",func=\"main\",args=[]},thread-id=\"1\",stopped-threads=\"all\",core=\"1\"\n"},"seq":287,"type":"event"}
1: (1561) ->*stopped,reason="breakpoint-hit",disp="keep",bkptno="1",frame={addr="0x000000000040052a",func="main",args=[]},thread-id="1",stopped-threads="all",core="1"
--> E (output): {"event":"output","body":{"category":"stdout","output":"\n"},"seq":289,"type":"event"}

--> E (output): {"event":"output","body":{"category":"stdout","output":"Breakpoint 1, 0x000000000040052a in main ()\n"},"seq":291,"type":"event"}
Breakpoint 1, 0x000000000040052a in main ()
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1574) <-1020-thread-info\n"},"seq":293,"type":"event"}
1: (1574) <-1020-thread-info
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1575) ->1020^done,threads=[{id=\"1\",target-id=\"process 20238\",name=\"hello-world\",frame={level=\"0\",addr=\"0x000000000040052a\",func=\"main\",args=[]},state=\"stopped\",core=\"1\"}],current-thread-id=\"1\"\n"},"seq":295,"type":"event"}
1: (1575) ->1020^done,threads=[{id="1",target-id="process 20238",name="hello-world",frame={level="0",addr="0x000000000040052a",func="main",args=[]},state="stopped",core="1"}],current-thread-id="1"
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1576) ->(gdb)\n"},"seq":297,"type":"event"}
1: (1576) ->(gdb)
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1577) 1020: elapsed time 2\n"},"seq":299,"type":"event"}
1: (1577) 1020: elapsed time 2
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1587) <-1021-stack-list-frames 0 1000\n"},"seq":301,"type":"event"}
1: (1587) <-1021-stack-list-frames 0 1000
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1587) ->1021^done,stack=[frame={level=\"0\",addr=\"0x000000000040052a\",func=\"main\"}]\n"},"seq":303,"type":"event"}
1: (1587) ->1021^done,stack=[frame={level="0",addr="0x000000000040052a",func="main"}]
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1588) ->(gdb)\n"},"seq":305,"type":"event"}
1: (1588) ->(gdb)
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1589) 1021: elapsed time 2\n"},"seq":307,"type":"event"}
1: (1589) 1021: elapsed time 2
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1596) <-1022-break-delete 1\n"},"seq":309,"type":"event"}
1: (1596) <-1022-break-delete 1
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1597) ->1022^done\n"},"seq":311,"type":"event"}
1: (1597) ->1022^done
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1597) ->(gdb)\n"},"seq":313,"type":"event"}
1: (1597) ->(gdb)
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1598) 1022: elapsed time 1\n"},"seq":315,"type":"event"}
1: (1598) 1022: elapsed time 1
--> E (output): {"event":"output","body":{"category":"console","output":"Execute debugger commands using \"-exec <command>\", for example \"-exec info registers\" will list registers in use (when GDB is the debugger)\n"},"seq":317,"type":"event"}
Execute debugger commands using "-exec <command>", for example "-exec info registers" will list registers in use (when GDB is the debugger)
--> E (stopped): {"event":"stopped","body":{"reason":"step","threadId":20238,"allThreadsStopped":true},"seq":319,"type":"event"}
<--   C (threads-10): {"command":"threads","type":"request","seq":10}
--> R (threads-10): {"request_seq":10,"success":true,"command":"threads","body":{"threads":[{"id":20238,"name":"hello-world"}]},"seq":322,"type":"response"}
<--   C (stackTrace-11): {"command":"stackTrace","arguments":{"threadId":20238,"startFrame":0,"levels":20},"type":"request","seq":11}
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1620) <-1023-stack-list-arguments 0 0 0\n"},"seq":325,"type":"event"}
1: (1620) <-1023-stack-list-arguments 0 0 0
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1621) ->1023^done,stack-args=[frame={level=\"0\",args=[]}]\n"},"seq":327,"type":"event"}
1: (1621) ->1023^done,stack-args=[frame={level="0",args=[]}]
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1621) ->(gdb)\n"},"seq":329,"type":"event"}
1: (1621) ->(gdb)
--> E (output): {"event":"output","body":{"category":"console","output":"1: (1622) 1023: elapsed time 1\n"},"seq":331,"type":"event"}
1: (1622) 1023: elapsed time 1
--> R (stackTrace-11): {"request_seq":11,"success":true,"command":"stackTrace","body":{"stackFrames":[{"id":1000,"name":"main","line":0,"column":0}],"totalFrames":1},"seq":333,"type":"response"}
pieandcakes commented 5 years ago

@dsinecos Can you make sure your binary is up to date by recompiling?

gdb is showing that it has not bound the breakpoint when we issue a break info request.:

body=[bkpt={number="2",type="breakpoint",disp="keep",enabled="y",addr="<PENDING>",pending="hello-world.c:5",times="0",original-location="hello-world.c:5"}]}

We set one by default at main. This is what a correct one looks like:

1: (1137) <-1010-break-insert -f main
1: (1138) ->1010^done,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x000000000040052a",at="<main+4>",thread-groups=["i1"],times="0",original-location="main"}

Notice the memory address of the breakpoint as this is how gdb binds the breakpoint. In the case of your breakpoints, I'm seeing:

1: (1250) <-1011-break-insert -f hello-world.c:5
1: (1250) ->&"No symbol table is loaded.  Use the \"file\" command.\n"
1: (1251) ->1011^done,bkpt={number="2",type="breakpoint",disp="keep",enabled="y",addr="<PENDING>",pending="hello-world.c:5",times="0",original-location="hello-world.c:5"}

Which is telling me a few things. First, gdb isn't loading the symbol table. This is usually an indication that debug symbols aren't included, which -g in your compile flags should be resolving. Second, the address shows as <PENDING> which means that gdb can't determine where this breakpoint actually lies and it isn't being bound. This is why its not getting hit but i don't know why gdb isn't binding the breakpoint.

My suggestion would be to make sure you run the task that you created again or include it in your launch.json as a preLaunchTask so it gets run every time you start debugging.

dsinecos commented 5 years ago

Thanks a lot @pieandcakes.

Problemo solved. I added the preLaunchTask field to launch.json to run the task before debugging.

clark-hive commented 2 years ago

I had this issue due to trying to debug inside a docker container. I had to run the container with:

docker run -it  --cap-add=SYS_PTRACE --security-opt seccomp=unconfined

following https://leimao.github.io/blog/Debug-CPP-In-Docker-Container/.
This gives the container access to the system calls needed for gdb. Note there's security implications from allowing the container access to all syscalls.