在MSYS上为GDBSERVER下的程序提供论点
Supply arguments to program under gdbserver on MSYS
我需要异步调试程序,因为它停滞不前, ctrl c 杀死了 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
(根据Manpage所说的方式提供0
作为参数。)
然后在另一个终端中:
$ gdb ./a_.exe
(gdb) target remote localhost:60000
Remote debugging using localhost:60000
0x76fa878f in ntdll!DbgBreakPoint () from C:Windowssystem32ntdll.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是错误的吗?
是!"误导"是一个更合适的术语。(至少适用于此平台上此版本的gdbserver
,误导了。)
第一个参数实际上是给出下等方的第一个参数(argv
)。通常这是可执行文件的名称。因此,以下工作有效:
$ gdbserver localhost:60000 ./a_.exe whatever 0
也就是说,曼页应该说,要保持一致:
target> gdbserver host:2345 emacs emacs foo.txt
我无法帮助您使用GDBSERVER,
但是,如果您只是在寻找一种中断在mingw/msys gdb
中运行的程序(类似于 ctrl c linux上的c )
看看Debugbreak
相关文章:
- Mongodb c++驱动程序:如何查询元素的数组
- C++,系统无法执行指定的程序
- 在C++程序中输入的文本文件将不起作用,除非文本被复制和粘贴
- 在VS代码中交叉编译Windows与Linux上的MinGW的SDL程序
- C++ Windows 驱动程序MSB3030无法复制该文件,因为它找不到
- 重载操作程序时出错>>用于类中的字符串 memebr
- 获取日期异步信号安全吗?如果在信号处理程序中使用,它会导致死锁吗
- 试图在visual studio上用C++创建一个桌面应用程序
- 模板元程序查找相似的连续类型名称
- FFmpeg:制作一个应用程序比直接使用ffmepg更好吗
- 如何通过cpp程序运行shell脚本
- 有没有什么方法可以使用一个函数中定义的常量变量,也可以由c++中同一程序中的其他函数使用
- IPC使用多个管道和分支进程来运行Python程序
- 如何将c++程序的一些输出传递给shell,以便在shell中使用
- 使用C++程序合并排序没有得到正确的输出
- 基于boost的程序的静态链接——zlib问题
- 程序崩溃并显示"std::out_of_range"错误
- 在MSYS上为GDBSERVER下的程序提供论点
- msys 和 tdm-gcc:配置错误 - 无法运行 C 编译的程序
- 如何从MSYS Makefile为c++程序定义路径?