gpt4 book ai didi

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

转载 作者:塔克拉玛干 更新时间:2023-11-03 06:52:04 26 4
gpt4 key购买 nike

我们使用 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).

像 next & step 这样的正常调试命令不起作用。

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

提前致谢。桑达尔·拉金德兰。

最佳答案

你基本上有三个选择 - 按照我的喜好顺序:

  1. 在机器上安装 64 位 GDB。
  2. 在 32 位模式下重建您的应用并以这种方式进行调试。
  3. 从源代码为 64 位目标构建您自己的 gdb 版本。

调试 64 位二进制文​​件的唯一方法是拥有一个为 64 位构建的 gdb [或其他一些调试器,但无论是哪种,都需要为 64 位目标构建]

关于c++ - 在 32 位 gdb 工具上调试 64 位 C++ 应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14646063/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com