GDB——“不允许操作”当尝试定位本地主机时
由于某种原因,当我尝试在 cygwin 下在 Windows 计算机上使用 GDB 时,即使从最新源代码编译它之后,它也不会让我执行以下操作:
target remote localhost:1234
相反,当我尝试这样做时,它会说:
localhost:1234: Operation not permitted.
但是,相同的命令在我的 Arch Linux VM 和 OSX 10.5.8 计算机上运行得很好。据我所知,其中使用的是旧版本的 gdb。 “i586-pc-elf-gdb -v”报告:
GNU gdb (GDB) 7.2
Copyright (C) 2010 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 "--host=i686-pc-cygwin --target=i586-pc-elf".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
For some reason, when I attempt to use GDB on my windows machine under cygwin, even after compiling it from the latest source, it won't let me do a:
target remote localhost:1234
Instead, when I try that, it says:
localhost:1234: Operation not permitted.
However, the same command works just fine on my Arch Linux VM and my OSX 10.5.8 computer. Which, AFAIK, are using older versions of gdb. "i586-pc-elf-gdb -v" reports:
GNU gdb (GDB) 7.2
Copyright (C) 2010 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 "--host=i686-pc-cygwin --target=i586-pc-elf".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试使用 -ggdbx" 选项编译代码:
CFLAGS = -Wall -g -ggdb3 -O0
Try compiling your code also with the -ggdbx" option:
CFLAGS = -Wall -g -ggdb3 -O0
这可能听起来很愚蠢,但您确定您有一个在 1234 上运行的 gdbserver 吗?
This might sound dumb but are you certain that you have a gdbserver running on 1234?