在32位gdb工具上调试64位C ++应用程序

时间:2013-02-01 12:13:45

标签: c++ solaris-10

我们使用Sun Solaris进行应用程序开发,并使用-m64编译64位应用程序。

但我的机器上安装了32位GDB工具,我们无法调试我们的64位应用程序。

输出为

$ gdb cxlog
GNU gdb 6.8
Copyright (C) 2008 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 "sparc-sun-solaris2.10"...
(gdb) break main
Breakpoint 1 at 0x100001464: file cxlogger.c, line 147.
(gdb) run
Starting program: /usr33/SIR07140/GTB_HOME/GoTx_HOME/samples/cxlog
procfs:4337 -- process not stopped.
procfs: ...giving up...
(gdb) n
procfs: couldn't find pid 12372 (kernel thread 1) in procinfo list.
(gdb).

正常的调试赞扬像下一个&amp;步骤不起作用。

如果我使用-m32编译我的应用程序,GDB就是工作文件。

先谢谢。 Sundar Rajendran。

1 个答案:

答案 0 :(得分:2)

您基本上有三种选择 - 按照我的偏好顺序:

  1. 在计算机上安装64位GDB。
  2. 以32位模式重建您的应用并以此方式进行调试。
  3. 从源代码为64位目标构建自己的gdb版本。
  4. 调试64位二进制文​​件的唯一方法是使用为64位[或其他一些调试器构建的gdb,但不论它是什么,都需要为64位目标构建] < / p>

相关问题