我很乐意用ECLIPSE调试我的软件作为GDB的前端.我们的构建如下.
我没有选择改变我的构建环境,它有太多的努力,而且与Linux相比,Cygwin太慢了.
我可以访问服务器的唯一方法是使用ssh.服务器只有基本的X-Window管理器,因此VNC不是一个选项.
有什么方法可以将ECLIPSE用作IDE而不是编辑器?我主要对利用其远程调试功能感兴趣.
编辑
错误建立沟通
目标
#./mipsel-linux-gdbserver-7.1 :1234 hello
Run Code Online (Sandbox Code Playgroud)
主办
$ gdb hello
(gdb) target remote 10.201.122.177:1234
Remote debugging using 10.201.122.177:1234
warning: while parsing target description (at line 10): Target description speci
fied unknown architecture "mips"
warning: Could not load XML target description; ignoring
Reply contains invalid hex digit 59
Run Code Online (Sandbox Code Playgroud)
我也尝试从cygwin源代码中为我的目标重新编译gdb服务器,但结果没有什么不同.我的目标架构是MIPS.
可能的另一种方法
是RSE(远程系统资源管理器)的替代品是什么,我想达到什么目的?
我正在尝试使用gdbserver ...
我有一个/user/bin/foo使用pid运行二进制路径的应用程序19767。
在远程启动gdbserver:
gdbserver --remote-debug --multi 0:12347
Run Code Online (Sandbox Code Playgroud)
在客户端上启动gdb并将其连接以删除服务器
target extended-remote 192.168.1.84:12347
Run Code Online (Sandbox Code Playgroud)
在pid上附加了gdb
attach 19767
Run Code Online (Sandbox Code Playgroud)
表明:
warning: Could not load vsyscall page because no executable was specified
try using the "file" command first.
0x00007f207550043c in ?? ()
Run Code Online (Sandbox Code Playgroud)
另外,它显示的当前线程信息不正确。像信息线程显示1个线程,但我的应用程序有10个线程-
(gdb) info threads
* 1 Thread 19767.19767 0x00007f207550043c in ?? ()
Run Code Online (Sandbox Code Playgroud)
如何要求gdb从远程文件加载符号/user/bin/foo?如何使其显示正确的信息?
使用Qt Creator 2.7.1和Qt 4.8.4,我创建了一个Qt库和一个简单的Qt应用程序,可以动态链接到这个库.我正在尝试远程部署和调试我的应用程序,并在调用它时进入我的库函数.我可以成功设置断点并远程调试,但我不能使用调试器(gdb)进入我的库函数.当我第一次在调试模式下使用QtCreator远程启动我的应用程序时,我遇到以下警告:
Could not load shared library symbols for 7 libraries, e.g. libcustom-stuff.so.1.
Use the "info sharedlibrary" command to see the complete listing.
Do you need "set solib-search-path" or "set sysroot"?
Run Code Online (Sandbox Code Playgroud)
我的调试器是使用QtCreator设置的,如这些图像所示(注意我在图像#3中切换了'目标路径'和'路径',但它没有帮助:

我的"套件"设置如下:

在Qt Creator中的'Debugger Log'中,我输入了'Command':
info sharedlibrary
Run Code Online (Sandbox Code Playgroud)
我收到了回复:
>~"From To Syms Read Shared Object Library\n"
>~"0x400007e0 0x40011bf0 Yes /home/user/proj/output/buildroot/host/usr/arm-buildroot-linux-gnueabi/sysroot/lib/ld-linux.so.3\n"
>~" No libcustom-stuff.so.1\n"
>~"0x4006d018 0x400d7124 Yes /home/user/proj/output/buildroot/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib/libQtDBus.so.4\n"
>~"0x401065c4 0x4013dd18 Yes /home/user/proj/output/buildroot/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib/libQtXml.so.4\n"
>~"0x40172430 0x4024c1b4 Yes /home/user/proj/output/buildroot/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib/libQtNetwork.so.4\n"
Run Code Online (Sandbox Code Playgroud)
我还确保库和应用程序都是用以下内容构建的:
CONFIG+=declarative_debug
Run Code Online (Sandbox Code Playgroud)
在库和应用程序的"编译输出"窗格中,我看到'-g'标志.
它们都驻留在文件系统的同一目录中,所以发生了什么!如何在App中调试和设置断点,但不能进入库调用?任何想法都非常感谢.
更新:
根据kikeenrique的建议,我尝试从我的Ubuntu主机(而不是ARM目标)加载调试符号:
GNU gdb (Ubuntu/Linaro 7.4-0~69~lucid1) 7.4
Copyright (C) …Run Code Online (Sandbox Code Playgroud) 我正在研究嵌入式Linux应用程序,我想使用GDB来调试它.问题是,尽管Kit配置看起来很好(调试器选项正确指向与设备的GCC相对应的GDB - 设备是Linux ARM),当我要求Qt Creator在调试模式下运行时,它会返回错误"申请表":
sh: gdbserver: not found
Run Code Online (Sandbox Code Playgroud)
这看起来很奇怪,因为我很遗憾,配置很好,Qt Creator在启动调试模式之前的任何时刻都没有报告错误.
我在网上做了一些研究,找到了使用GDB从Qt Creator中调试嵌入式Linux应用程序的确切步骤(使用断点等),最接近我得到的答案是Tobias Hunger的评论:
您需要在主板上安装ssh和gdbserver才能使其正常工作.然后你需要在Creator中设置你的主板[qt-project.org].之后,您需要使用此设备设置套件[qt-project.org].
我想,这些步骤对我来说并不清楚.
ssh我的设备上是否有这个?当然,这本手册是我的托比亚斯完成的还是我需要为此工作做些其他事情?
我想从我的主机盒调试远程盒子上运行的进程(我在主机上构建了代码).两者都有linux类型的操作系统.
我似乎只能通过ssh(我使用telnet测试)从主机盒与远程盒通信.
我已按照以下步骤进行设置:
在远程框上:
停止防火墙服务:
service firewall_service stop
将进程附加到gdbserver
--attach:remote_port process_id
在主机框上:
通过ssh设置端口转发
sudo ssh remote_username @ remote_ip -L host_port:localhost:remote_port -f sleep 60m
设置gdb以附加到远程进程:
gdb file.debug
(gdb)target remote remote_ip:remote_port
当我尝试通过在主机框上运行'target remote remote_ip:remote_port'来启动主机上的调试时,我收到"连接超时"错误.
你们可以看到我做错了什么,要检查什么或者通过ssh远程调试的替代方法我将不胜感激.谢谢
我一直在尝试在Alpine Docker映像上安装gdbserver包(https://hub.docker.com/_/alpine/)
apk添加gdbserver
给了我这个:
错误:不可满足的约束:gdbserver(缺失):所需:world [gdbserver]
同时,
apk添加gdb
工作得很好.那么,在Alpine上安装gdbserver包的正确方法是什么?
PS
apk更新已在其他所有内容之前执行.
我可以brew用来安装GBD或从源代码下载并编译GDB,但是无论哪种方式都不会安装GDBserver。如何使GDBserver在OSX中运行?
干杯
调试修改后的Linux-3.11.0内核时遇到问题.为了调试代码,我使用:
我的系统有运行Ubuntu 12.10的Intel(R)Core(TM)i7-2760QM CPU @ 2.40GHz
我使用'make menuconfig'创建的配置文件编译了修改后的内核.(修改了"内核黑客"类别)
这里引用了一些.config文件行(我发现相关):
CONFIG_DEBUG_INFO=y
CONFIG_DEBUG_KERNEL=y
CONFIG_MAGIC_SYSRQ=y
CONFIG_DEBUG_FS=y
CONFIG_HAVE_HW_BREAKPOINT=y
CONFIG_HAVE_MIXED_BREAKPOINTS_REGS=y
Run Code Online (Sandbox Code Playgroud)
我使用qemu和"-S"选项来启动我的内核,并使用gdb我连接到qemu并恢复它的执行:
(gdb) target remote :1234
(gdb) continue
Run Code Online (Sandbox Code Playgroud)
设置断点时,例如:
break schedule我收到一条确认消息,例如:
Breakpoint 1 at 0xffffffff81736400: file kernel/sched/core.c, line 2509.
Run Code Online (Sandbox Code Playgroud)
所以到这里一切似乎都很好!
问题是gdb和qemu不会在断点处停止!他们都只是继续跑......
我尝试按照某些地方的建议设置硬件断点,但是我收到了消息:
No hardware breakpoint support in the target.
Run Code Online (Sandbox Code Playgroud)
这很奇怪,因为我设置了CONFIG_HAVE_HW_BREAKPOINT.
我也CONFIG_DEBUG_RODATA像其他地方的建议一样,但仍然没有结果......
我试图乱用.config文件,如下所示:qcmu中的gdbserver不会在断点上停止,但我无法弄清楚工作.config文件和我的.config文件之间的相关差异......(也有差异很大!)
谁能帮帮我吗?
谢谢!!
我正在使用 GDB 调试我的 msp430。我连接目标,然后加载程序的二进制文件,然后“继续”。
我的程序运行良好,但我想实时查看变量的某些值。实际上我想检查我的代码开始和代码结束的时间戳,这会给我总持续时间。
由于我对 GDB 完全陌生,因此目前我已将此行放在我的代码中
printf("Hello World\n");
Run Code Online (Sandbox Code Playgroud)
然而,没有打印任何内容,但我的代码工作正常,实际上是 LED 闪烁。
请指导我如何在调试模式下查看 GDB 中的变量值。
谢谢
我在QEMU中运行一些裸机AARCH64软件。我将GDB连接到它作为远程目标。GDB多体系结构显示了从x0到x30的通用寄存器,SP和PC。
但是,我找不到访问系统寄存器以检查DAIF系统寄存器,故障地址寄存器,故障综合症寄存器等内容的方法。这些对于调试至关重要。我已经在QEMU中使用info all-registers进行了尝试,但是输出似乎并不相关。
我是否缺少明显的东西?
PS,QEMU模型如下:
qemu-system-aarch64-机器病毒,gic_version = 3 -cpu cortex-a57 -smp 4 -m 4096
gdbserver ×10
gdb ×8
qemu ×2
qt ×2
alpine-linux ×1
arm ×1
arm64 ×1
c ×1
debugging ×1
docker ×1
eclipse ×1
eclipse-cdt ×1
eclipse-rse ×1
embedded ×1
linux-kernel ×1
macos ×1
msp430 ×1
qt-creator ×1
ssh ×1