我需要异步调试程序,因为它停止了,并且Ctrl+ Ckilled gdb
,而不是中断程序(这是在 MinGW/MSYS 上)。
有人暗示这gdb
在异步模式下在 Windows 上不起作用,实际上它没有(带有Asynchronous execution not supported on this target.
消息),但那gdbserver
会。
所以我尝试:
$ gdbserver localhost:60000 ./a_.exe 0
Process ./a_.exe created; pid = 53644
Listening on port 60000
(0
根据联机帮助页的说明,提供作为参数。)
然后在另一个终端:
$ gdb ./a_.exe
(gdb) target remote localhost:60000
Remote debugging using localhost:60000
0x76fa878f in ntdll!DbgBreakPoint () from C:\Windows\system32\ntdll.dll
(gdb) continue
Continuing.
[Inferior 1 (Remote target) exited with code 01]
虽然原来的现在看起来像:
$ gdbserver localhost:60000 ./a_.exe 0
Process ./a_.exe created; pid = 53484
Listening on port 60000
Remote debugging from host 127.0.0.1
Expecting 1 argument: test case number to run.
Child exited with status 1
GDBserver exiting
也就是说,我的程序认为它没有参数。
手册页错了吗?