vscode-cpptools icon indicating copy to clipboard operation
vscode-cpptools copied to clipboard

Unable to debug with GDB

Open chrmarti opened this issue 8 years ago • 24 comments

From @Dreace on November 6, 2018 9:20

Issue Type: Bug

Appears when debugging with GDB ERROR: Unable to start debugging. Unexpected GDB output from command "-exec-run". There are some codes that have this problem and some have no such problem. This is my code

#include <bits/stdc++.h>
using namespace std;
typedef struct Line {
    double left, right;
    Line(double a, double b) {
        left = a;
        right = b;
    }
} Line;
bool cmp(Line a, Line b) {
    return a.left < b.left;
}
int main() {
    int n, m;
    int cas = 0;
    while (cin >> n >> m) {
        if (n == 0 && m == 0) {
            break;
        }
        cas++;
        int res = 1;
        vector<Line> v;
        for (int i = 0; i < n; i++) {
            int x, y;
            double d;
            cin >> x >> y;
            if (y > m) {
                res = -1;
            } else {
                d = sqrt(m * m - y * y);
                v.push_back(Line(x - d, x + d));
            }
        }
        if (res == -1) {
            cout << "Case " << cas << ": " << res << endl;
            continue;
        }
        sort(v.begin(), v.end(), cmp);
        Line l = v[0];
        for (int i = 1; (unsigned)i < v.size(); i++) {
            if (v[i].left > l.right) {
                l = v[i];
                res++;
            } else {
                l = l.right < v[i].right ? l : v[i];
            }
        }
        cout << "Case " << cas << ": " << res << endl;
    }
    return 0;
}

VS Code version: Code - Insiders 1.29.0-insider (bdfe4fd41f6a5fe538197b3cba937230249a563a, 2018-11-04T13:04:20.759Z) OS version: Windows_NT x64 10.0.17134

System Info
Item Value
CPUs Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz (4 x 2712)
GPU Status 2d_canvas: enabled
checker_imaging: disabled_off
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: disabled_software
rasterization: enabled
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled
Memory (System) 7.92GB (3.92GB free)
Process Argv
Screen Reader no
VM 50%
Extensions (6)
Extension Author (truncated) Version
include-autocomplete ajs 0.0.4
code-runner for 0.9.5
vscode-language-pack-zh-hans MS- 1.29.1
cpptools ms- 0.20.1
material-icon-theme PKi 3.6.0
vscode-icons rob 7.28.0

Copied from original issue: Microsoft/vscode#62647

chrmarti avatar Nov 06 '18 09:11 chrmarti

@dreace can you post what your error in the output window is? gdb is reporting an error when it tries to run your program .

pieandcakes avatar Nov 06 '18 21:11 pieandcakes

@Dreace can you post what your error in the output window is? gdb is reporting an error when it tries to run your program . This is the output of the debug window

ghost avatar Nov 07 '18 07:11 ghost

That tells me gdb is having a problem creating the process. If you want to see more detail from gdb, you can add "logging": { "engineLogging": true } to your launch.json and try again and see if gdb gives you more information.

If this is mingw, can you make sure the bin folder has been set as part of your path on Windows? I know with thier executables they are expecting to load libraries from that folder as part of program execution. I imagine from a regular command prompt you would get an error also trying to run the program.

pieandcakes avatar Nov 07 '18 18:11 pieandcakes

I looked at the details of GDB but didn't get any useful information. I can debug other programs normally. The code mentioned earlier can be debugged normally in Dev-C++. Is it a bug?

1: (122) LaunchOptions<LocalLaunchOptions xmlns='http://schemas.microsoft.com/vstudio/MDDDebuggerOptions/2014'

1: (132) LaunchOptions  ExePath='c:\WorkSpace\C++\POJ\1328 - Radar Installation.exe'

1: (132) LaunchOptions  WorkingDirectory='C:\WorkSpace\C++'

1: (132) LaunchOptions  ExeArguments=''

1: (132) LaunchOptions  MIMode='gdb'

1: (132) LaunchOptions  MIDebuggerPath='C:/LLVM/bin/gdb.exe'

1: (132) LaunchOptions  WaitDynamicLibLoad='false'

1: (133) LaunchOptions  ExternalConsole='true'

1: (133) LaunchOptions>

1: (133) LaunchOptions    <SetupCommands>

1: (134) LaunchOptions        <Command IgnoreFailures='true' Description='Enable pretty-printing for gdb'>-enable-pretty-printing</Command>

1: (134) LaunchOptions        <Command IgnoreFailures='true' Description='Do not disable ASLR for WSL'>set disable-randomization off</Command>

1: (134) LaunchOptions    </SetupCommands>

1: (134) LaunchOptions</LocalLaunchOptions>

1: (218) Starting: "C:/LLVM/bin/gdb.exe" --interpreter=mi

1: (233) DebuggerPid=7304

1: (1374) ->=thread-group-added,id="i1"

1: (1388) ->~"GNU gdb (GDB) 8.1\n"

1: (1388) ->~"Copyright (C) 2018 Free Software Foundation, Inc.\n"

1: (1388) ->~"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: (1388) ->~"This GDB was configured as \"x86_64-w64-mingw32\".\nType \"show configuration\" for configuration details."

1: (1388) ->~"\nFor bug reporting instructions, please see:\n"

1: (1389) ->~"<http://www.gnu.org/software/gdb/bugs/>.\n"

1: (1389) ->~"Find the GDB manual and other documentation resources online at:\n<http://www.gnu.org/software/gdb/documentation/>.\n"

1: (1389) ->~"For help, type \"help\".\n"

1: (1389) ->~"Type \"apropos word\" to search for commands related to \"word\".\n"

1: (1418) ->(gdb)

1: (1424) <-1001-gdb-set target-async on

1: (1431) ->1001^done

1: (1432) ->(gdb)

1: (1433) 1001: elapsed time 9

1: (1433) ->&"\n"

1: (1436) ->^done

1: (1436) ->(gdb)

1: (1454) <-1002-enable-pretty-printing

1: (1457) ->1002^done

1: (1457) ->(gdb)

1: (1458) 1002: elapsed time 3

1: (1473) ->&"\n"

1: (1473) <-1003-interpreter-exec console "set disable-randomization off"

1: (1474) ->^done

1: (1474) ->(gdb)

1: (1485) ->&"Disabling randomization of debuggee's virtual address space is unsupported on\n"

1: (1487) ->&"this platform.\n"

1: (1489) ->1003^error,msg="Disabling randomization of debuggee's virtual address space is unsupported on\nthis platform."

1: (1490) ->(gdb)

1: (1495) 1003: elapsed time 22

1: (1496) <-1004-interpreter-exec console "set pagination off"

1: (1498) ->&"\n"

1: (1499) ->^done

1: (1502) ->(gdb)

1: (1503) ->=cmd-param-changed,param="pagination",value="off"

1: (1503) ->1004^done

1: (1504) ->(gdb)

1: (1504) 1004: elapsed time 7

1: (1504) <-1005-gdb-set auto-solib-add on

1: (1504) ->&"\n"

1: (1505) ->^done

1: (1505) ->(gdb)

1: (1516) ->1005^done

1: (1516) ->(gdb)

1: (1516) 1005: elapsed time 12

1: (1516) <-1006-gdb-set solib-search-path c:\\WorkSpace\\C++\\POJ;

1: (1519) ->&"\n"

1: (1519) ->^done

1: (1520) ->(gdb)

1: (1520) ->1006^done

1: (1521) ->(gdb)

1: (1521) ->&"\n"

1: (1521) ->^done

1: (1521) ->(gdb)

1: (1521) 1006: elapsed time 5

1: (1524) <-1007-environment-cd C:\\WorkSpace\\C++

1: (1531) ->1007^done

1: (1531) ->(gdb)

1: (1531) 1007: elapsed time 7

1: (1531) <-1008-gdb-set new-console on

1: (1533) ->&"\n"

1: (1535) ->^done

1: (1535) ->(gdb)

1: (1538) ->1008^done

1: (1538) ->(gdb)

1: (1538) 1008: elapsed time 7

1: (1538) <-1009-interpreter-exec console "show configuration"

1: (1539) ->&"\n"

1: (1541) ->^done

1: (1543) ->(gdb)

1: (1543) ->~"This GDB was configured as follows:\n   configure --host=x86_64-w64-mingw32 --target=x86_64-w64-mingw32\n"

1: (1544) ->~"             --with-auto-load-dir=$debugdir:$datadir/auto-load\n             --with-auto-load-safe-path=$debugdir:$datadir/auto-load\n"

1: (1544) ->~"             --with-expat\n"

1: (1545) ->~"             --with-gdb-datadir=/c/mingw810/x86_64-810-posix-seh-rt_v6-rev0/mingw64/share/gdb (relocatable)\n"

1: (1546) ->~"             --with-jit-reader-dir=/c/mingw810/x86_64-810-posix-seh-rt_v6-rev0/mingw64/lib/gdb (relocatable)\n"

1: (1549) ->~"             --without-libunwind-ia64\n"

1: (1549) ->~"             --without-lzma\n"

1: (1549) ->~"             --with-python=/c/mingw810/x86_64-810-posix-seh-rt_v6-rev0/mingw64/opt (relocatable)\n"

1: (1549) ->~"             --without-guile\n"

1: (1549) ->~"             --with-separate-debug-dir=/c/mingw810/x86_64-810-posix-seh-rt_v6-rev0/mingw64/lib/debug (relocatable)\n"

1: (1549) ->~"             --with-system-gdbinit=/c/mingw810/x86_64-810-posix-seh-rt_v6-rev0/mingw64/etc/gdbinit (relocatable)\n"

1: (1550) ->~"             --without-babeltrace\n"

1: (1550) ->~"\n(\"Relocatable\" means the directory can be moved with the GDB installation\ntree, and GDB will still find it.)\n"

1: (1550) ->1009^done

1: (1550) ->(gdb)

1: (1551) ->&"\n"

1: (1551) ->^done

1: (1551) ->(gdb)

1: (1551) 1009: elapsed time 12

1: (1556) <-1010-file-exec-and-symbols "c:\\WorkSpace\\C++\\POJ\\1328 - Radar Installation.exe"

1: (1596) ->1010^done

1: (1596) ->(gdb)

1: (1597) 1010: elapsed time 40

1: (1597) <-1011-interpreter-exec console "show architecture"

1: (1601) ->&"\n"

1: (1603) ->^done

1: (1604) ->(gdb)

1: (1605) ->~"The target architecture is set automatically (currently i386)\n"

1: (1607) ->1011^done

1: (1608) ->(gdb)

1: (1608) ->&"\n"

1: (1608) ->^done

1: (1608) ->(gdb)

1: (1608) 1011: elapsed time 11

1: (1610) <-1012-break-insert -f main

1: (1616) ->1012^done,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x004014bd",func="main()",file="c:\\WorkSpace\\C++\\POJ\\1328 - Radar Installation.cpp",fullname="c:\\WorkSpace\\C++\\POJ\\1328 - Radar Installation.cpp",line="15",thread-groups=["i1"],times="0",original-location="main"}

1: (1617) ->(gdb)

1: (1618) ->&"\n"

1: (1619) ->^done

1: (1619) ->(gdb)

1: (1620) 1012: elapsed time 10

1: (1707) <-1013-break-insert -f "1328 - Radar Installation.cpp:16"

1: (1709) ->1013^error,msg="malformed linespec error: unexpected number, \"-\""

1: (1709) ->(gdb)

1: (1710) 1013: elapsed time 2

1: (1714) ->&"\n"

1: (1722) ->^done

1: (1722) ->(gdb)

=thread-group-added,id="i1"
GNU gdb (GDB) 8.1
Copyright (C) 2018 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-w64-mingw32".
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"
1: (1817) <-1014-exec-run

1: (2032) ->1014^error,msg="Error creating process c:\\WorkSpace\\C++\\POJ\\1328 - Radar Installation.exe, (error 740)."

1: (2032) ->(gdb)

1: (2032) 1014: elapsed time 215

1: (2032) ->&"\n"

1: (2032) ->^done

1: (2033) ->(gdb)

ERROR: Unable to start debugging. Unexpected GDB output from command "-exec-run". Error creating process c:\WorkSpace\C++\POJ\1328 - Radar Installation.exe, (error 740).

1: (2069) <--gdb-exit

1: (2076) ->^exit

1: (2080) <-logout

The program 'c:\WorkSpace\C++\POJ\1328 - Radar Installation.exe' has exited with code 42 (0x0000002a).

ghost avatar Nov 08 '18 11:11 ghost

I see:

1: (1707) <-1013-break-insert -f "1328 - Radar Installation.cpp:16" 1: (1709) ->1013^error,msg="malformed linespec error: unexpected number, "-""

and

1: (1817) <-1014-exec-run 1: (2032) ->1014^error,msg="Error creating process c:\WorkSpace\C++\POJ\1328 - Radar Installation.exe, (error 740)."

Its gdb that has the issue, not our extension. It would be interesting to see if your program name with the spaces is causing the conflict or not.

The code mentioned earlier can be debugged normally in Dev-C++

I assume that if it can be compiled, it can be run. I'm not familiar with Dev-C++. Can you share your compilation command? Also does it work when you run the program from a regular command prompt?

pieandcakes avatar Nov 08 '18 19:11 pieandcakes

HI GDB does not work

OS: Arch Linux 64bit EXT: C/C++ IntelliSense && clang-format VsCode-Version: 1.29.1

Video: https://ufile.io/86mnx

HamedMohsenavi avatar Nov 26 '18 16:11 HamedMohsenavi

@HamedMohsenavi Can you provide a log? Are you seeing the same thing in the log?

pieandcakes avatar Nov 26 '18 20:11 pieandcakes

@pieandcakes It doesn't actually giving me a log.. Or maybe I just can't find it

log

HamedMohsenavi avatar Nov 27 '18 06:11 HamedMohsenavi

@HamedMohsenavi does changing your setting of externalConsole to false allow it to work?

pieandcakes avatar Nov 27 '18 21:11 pieandcakes

@pieandcakes No it doesn't. it's okay with NodeJS or Python Debuggers, Only GDB doesn't work

HamedMohsenavi avatar Nov 28 '18 05:11 HamedMohsenavi

@HamedMohsenavi It sounds like you have the same issue as #2787. Please use that issue as the root issue. .

pieandcakes avatar Nov 28 '18 19:11 pieandcakes

Hi, I'm having a similar problem. Was able to debug a C++ application for mingw just now, and suddenly got an error saying that it the targetArchitecture was missing. Set this to x64, and tried again. Now it keeps saying ERROR: Unable to start debugging. Unexpected GDB output from command "-exec-run". No executable specified, use `target exec'.

After enabling the logging: 1: (412) ->&"No symbol table is loaded. Use the "file" command.\n" 1: (412) ->1006^done,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="",pending="main.cpp:50",times="0",original-location="main.cpp:50"} 1: (412) ->(gdb) 1: (412) ->&"\n" 1: (412) ->^done 1: (412) ->(gdb) 1: (415) 1006: elapsed time 5 1: (422) Send Event AD7BreakpointErrorEvent 1: (440) Send Event AD7LoadCompleteEvent =thread-group-added,id="i1" GNU gdb (GDB) 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-w64-mingw32". 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". =cmd-param-changed,param="pagination",value="off" 1: (444) <-1007-exec-run 1: (452) ->1007^error,msg="No executable specified, use target exec'." 1: (452) ->&"\n" 1: (452) 1007: elapsed time 8 1: (454) Send Event AD7MessageEvent ERROR: Unable to start debugging. Unexpected GDB output from command "-exec-run". No executable specified, use target exec'. 1: (459) <--gdb-exit 1: (462) ->^done 1: (462) ->^exit 1: (464) <-logout 1: (465) Send Event AD7ProgramDestroyEvent The program 'F:\My_Projects\unittest-cpp\output\debug\bin\unittest-cpp.test.exe' has exited with code 42 (0x0000002a).

Using 1.33.1 on Win 7 with C/C++ plugin 0.22.2

renebarto avatar Apr 18 '19 22:04 renebarto

1: (91) LaunchOptions<LocalLaunchOptions xmlns='http://schemas.microsoft.com/vstudio/MDDDebuggerOptions/2014' 1: (98) LaunchOptions ExePath='F:\My_Projects\unittest-cpp\output\debug\bin\unittest-cpp.test.exe' 1: (98) LaunchOptions WorkingDirectory='F:\My_Projects\unittest-cpp' 1: (98) LaunchOptions TargetArchitecture='x64' 1: (98) LaunchOptions ExeArguments='' 1: (98) LaunchOptions MIMode='gdb' 1: (98) LaunchOptions MIDebuggerPath='C:/Program Files/mingw-w64/x86_64-6.3.0-posix-seh-rt_v5-rev2/mingw64/bin/gdb.exe' 1: (98) LaunchOptions WaitDynamicLibLoad='false' 1: (98) LaunchOptions ExternalConsole='true' 1: (99) LaunchOptions> 1: (99) LaunchOptions 1: (99) LaunchOptions -enable-pretty-printing 1: (99) LaunchOptions 1: (99) LaunchOptions 1: (99) LaunchOptions 1: (99) LaunchOptions 1: (139) Starting: "C:/Program Files/mingw-w64/x86_64-6.3.0-posix-seh-rt_v5-rev2/mingw64/bin/gdb.exe" --interpreter=mi 1: (148) DebuggerPid=12308 1: (216) ->=thread-group-added,id="i1" 1: (217) ->~"GNU gdb (GDB) 7.11.1\n" 1: (217) ->~"Copyright (C) 2016 Free Software Foundation, Inc.\n" 1: (218) ->~"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: (218) ->~"This GDB was configured as "x86_64-w64-mingw32".\nType "show configuration" for configuration details." 1: (218) ->~"\nFor bug reporting instructions, please see:\n" 1: (218) ->~"http://www.gnu.org/software/gdb/bugs/.\n" 1: (218) ->~"Find the GDB manual and other documentation resources online at:\nhttp://www.gnu.org/software/gdb/documentation/.\n" 1: (218) ->~"For help, type "help".\n" 1: (218) ->~"Type "apropos word" to search for commands related to "word".\n" 1: (228) ->(gdb) 1: (239) <-1001-gdb-set target-async on 1: (240) ->1001^done 1: (240) ->(gdb) 1: (240) ->&"\n" 1: (240) ->^done 1: (240) ->(gdb) 1: (240) 1001: elapsed time 2 1: (245) <-1002-enable-pretty-printing 1: (250) ->1002^done 1: (250) ->(gdb) 1: (250) ->&"\n" 1: (250) ->^done 1: (250) ->(gdb) 1: (250) 1002: elapsed time 5 1: (251) <-1003-interpreter-exec console "set pagination off" 1: (260) ->=cmd-param-changed,param="pagination",value="off" 1: (260) ->1003^done 1: (260) ->(gdb) 1: (260) ->&"\n" 1: (261) ->^done 1: (261) ->(gdb) 1: (260) 1003: elapsed time 9 1: (261) <-1004-gdb-set auto-solib-add on 1: (270) ->1004^done 1: (270) ->(gdb) 1: (270) ->&"\n" 1: (270) ->^done 1: (270) ->(gdb) 1: (270) 1004: elapsed time 9 1: (270) <-1005-gdb-set solib-search-path F:\My_Projects\unittest-cpp\output\debug\bin; 1: (280) ->1005^done 1: (280) ->(gdb) 1: (280) 1005: elapsed time 10 1: (281) ->&"\n" 1: (281) ->^done 1: (281) ->(gdb) 1: (285) Send Event AD7EngineCreateEvent 1: (287) Send Event AD7ProgramCreateEvent 1: (410) <-1006-break-insert -f main.cpp:50 1: (412) ->&"No symbol table is loaded. Use the "file" command.\n" 1: (412) ->1006^done,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="",pending="main.cpp:50",times="0",original-location="main.cpp:50"} 1: (412) ->(gdb) 1: (412) ->&"\n" 1: (412) ->^done 1: (412) ->(gdb) 1: (415) 1006: elapsed time 5 1: (422) Send Event AD7BreakpointErrorEvent 1: (440) Send Event AD7LoadCompleteEvent =thread-group-added,id="i1" GNU gdb (GDB) 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-w64-mingw32". 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". =cmd-param-changed,param="pagination",value="off" 1: (444) <-1007-exec-run 1: (452) ->1007^error,msg="No executable specified, use target exec'." 1: (452) ->&"\n" 1: (452) 1007: elapsed time 8 1: (454) Send Event AD7MessageEvent ERROR: Unable to start debugging. Unexpected GDB output from command "-exec-run". No executable specified, use target exec'. 1: (459) <--gdb-exit 1: (462) ->^done 1: (462) ->^exit 1: (464) <-logout 1: (465) Send Event AD7ProgramDestroyEvent The program 'F:\My_Projects\unittest-cpp\output\debug\bin\unittest-cpp.test.exe' has exited with code 42 (0x0000002a).

Seemed to have lost part of the log

renebarto avatar Apr 18 '19 22:04 renebarto

I hit this problem and solved it as follows:

  1. Installed Cygwin64 including gcc and gdb. I did not add them to the windows path to avoid contaminating other workflows. Note that these tools apparently cannot tolerate any spaces in the paths to any files that they are debugging or compiling.
  2. Created a working directory with NO SPACES in the path name: C:\Users\garyk\Documents\VSCode\test-break
  3. Opened a Cygwin64 terminal (which DOES have gcc and gdb on its path) and ran VS code: "/cygdrive/C/Users/garyk/AppData/Local/Programs/Microsoft VS Code\Code.exe"
  4. Opened my file C:\Users\garyk\Documents\VSCode\test-break\test-break.c in VS code and saved a workspace called test-break.code-workspace there.
  5. Command Pallette->Build and Debug Active File Single-stepping, breakpoints, and watched variables now worked as expected.

gkenaley avatar Apr 20 '19 22:04 gkenaley

@renebarto The issue is that when your program runs, it isn't able to find the dependent runtime .dlls that it needs that are part of your toolset (Cygwin, Mingw, etc). @gkenaley 's fix one way to resolve it because it makes sure that the lib and toolset is within the searchpath of Windows when it needs to resolve the dependencies.

pieandcakes avatar May 02 '19 19:05 pieandcakes

Well, if you can build & debug in command line ,maybe you set wrong g++ path, check the task.json

dkqkxx avatar Jul 17 '19 04:07 dkqkxx

gdb @pieandcakes what can i do when i see this dialogue

Stiffjobs avatar Jul 28 '19 12:07 Stiffjobs

@Stiffjobs for some reason, gdb does not like Chinese characters in its file paths. Please rename the working directory or change the cwd setting in your launch.json to a path without those characters.

pieandcakes avatar Oct 28 '19 22:10 pieandcakes

I also faced similar problem while trying to debug Cpp code on VSCode.

ERROR: Unable to start debugging. Unexpected GDB output from command "-exec-run". During startup program exited with code 0xc0000135

For me adding "C:\cygwin64\bin" to PATH in environment variables did the trick. Although VSCode launch.json had miDebuggerPath set to "C:\cygwin64\bin\gdb.exe" it didn't work. Manually adding to PATH in environment variables fixed the error.

tripsus avatar Nov 01 '19 07:11 tripsus

Or, in my case using mingw, I needed: { // add the directory which contains gdb // to stop the 0xc0000135 error "name": "PATH", "value": "%PATH%;C:\Program Files\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\bin" }

lextrounce avatar Sep 14 '20 19:09 lextrounce