【发布时间】:2018-07-18 20:16:19
【问题描述】:
我正在使用 WSL(Windows 上的 Bash = Linux 的 Windows 子系统)。 我写了一个简单的代码,a.c
#include <stdio.h>
int main(int argc, char *argv[]) {
printf("Hello\n");
return 0;
}
我编译了。
$ gcc -g -o a.exe a.c
$
效果很好。
$ ./a.exe
Hello
$
而且,我尝试在 gdb 中执行 a.exe。但是,我得到“在启动过程中程序正常退出。”
$ gdb ./a.exe
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"...
Reading symbols from ./a.exe...done.
(gdb) r
Starting program: /home/softgear/a.exe
During startup program exited normally.
(gdb)
如何在 WSL 中使用 gdb?请帮帮我。
【问题讨论】:
标签: gdb windows-subsystem-for-linux