我需要異步調試程序,因爲它熄火了,按Ctrl +ç殺死gdb
,而不是中斷程序(這是對的MinGW/MSYS)。供應參數下gdbserver的程序上MSYS
Someone hinted是gdb
不會在異步模式下工作在Windows上,確實也沒有(與Asynchronous execution not supported on this target.
消息),但gdbserver
會。
所以我嘗試:(直供0
作爲參數,根據how the manpage says it's done)
$ gdbserver localhost:60000 ./a_.exe 0
Process ./a_.exe created; pid = 53644
Listening on port 60000
然後在另一個終端:
$ 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
也就是說,我的程序認爲它沒有任何參數。
manpage是錯的嗎?