本文介绍了GDB远程调试错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试远程调试x86_64 suse linux上的32位应用程序,但是得到这个远程注册格式错误错误。

I tried to remote debug an 32-bit application on x86_64 suse linux, but get this "remote register badly formatted" error.

我启动gdbserver as监听端口12345(gdbserver localhost:12345 my_prog)

I start up the gdbserver as listening on port 12345 (gdbserver localhost:12345 my_prog)

这是错误:

$ gdb
GNU gdb 6.6
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "x86_64-suse-linux".
(gdb) target remote <ip>:12345
Remote debugging using <ip>:12345
Remote register badly formatted: T0506:0000000000000000;07:80b8bcff00000000;10:4028f0f700000000;
here: 0000000;07:80b8bcff00000000;10:4028f0f700000000;
(gdb)

这是调试服务器机器(uname -a):

This is the debug server machine (uname -a):

Linux服务器2.6.16.60-0.31-smp#1 SMP Tue Oct 7 16:16:29 UTC 2008 x86_64 x86_64 x86_64 GNU / Linux

Linux server 2.6.16.60-0.31-smp #1 SMP Tue Oct 7 16:16:29 UTC 2008 x86_64 x86_64 x86_64 GNU/Linux

这是调试客户端机器(uname -a):

And this is the debug client machine (uname -a):

Linux客户端2.6.16.54-0.2.5默认#1 Mon Jan 21 13:29:51 UTC 2008 x86_64 x86_64 x86_64 GNU / Linux

Linux client 2.6.16.54-0.2.5-default #1 Mon Jan 21 13:29:51 UTC 2008 x86_64 x86_64 x86_64 GNU/Linux

这两台机器都在虚拟机中运行(VMWare)。 gdbserver二进制文件从客户端机器复制到服务器机器。

Both machines are running in virtual machines though (VMWare). The gdbserver binary is copied from the client machine to the server machine.

(远程调试,因为调试服务器上的运行时环境是类似于生产的,不会包含任何开发工具,访问源代码等。)

(I remote debug because the runtime environment on the debug server is production-like, and doesn't contain any development tools, access to the source code etc.)

欢迎任何建议。

更新:通过在gdb中发出以下命令,这对我有用:

UPDATE: this worked for me by issuing the following command in gdb:

设置架构i386:x86-64

set architecture i386:x86-64

推荐答案

也许您需要在(gdb)上执行类似设置架构i386 提示?连接到远程目标后,显示架构是什么?

Perhaps you need to execute something like set architecture i386 at the (gdb) prompt? What does show architecture say after you connect to the remote target?

这篇关于GDB远程调试错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-05 12:02