在64位Ubuntu(18.04)系统上运行32位可执行文件时,如何修复ld-linux.so.2中gdb的挂起?

Chr*_*ner 5 c++ gdb ubuntu-18.04

我正在尝试在64位Ubuntu系统上调试32位可执行文件。它本身可以从命令行正常运行,但是当我尝试使用gdb时,它挂在ld-linux.so.2中。另外,gdb适用于可执行文件的64位版本。有人知道我应该尝试什么吗?

我只是将计算机重新映像到Ubuntu 18.04.3,然后安装了glib和g ++的multilib版本。

提前致谢。

gdb <executable>
GNU gdb ...
This GDB was configured as "x86_64-linux-gnu"
...
Reading symbols from <executable>...done.
(gdb) show archi
The target architecture is set automatically (currently i386)
(gdb) break main
Breakpoint 1 at ...
(gdb) run
Starting program...
warning: Breakpoint address adjusted from 0xf7fd9be0 to 0xfffffffff7fd9be0.
...
(7 of these)
[hangs...]
[In another terminal, ran 'kill -CONT <pid>']
Program received signal SIGCONT, Continued.
0xf7fd9be0 in ?? () from /lib/ld-linux.so.2
(gdb) cont
[hangs again...]
Run Code Online (Sandbox Code Playgroud)

Mel*_*ius 7

更新:此问题已在gdb软件包版本8.1-0ubuntu3.2中为Ubuntu 修复,因此,仅升级软件包(sudo apt update && sudo apt upgrade)当前应会有所帮助。


原始答案:

@EmployedRussian他对问题的编辑中建议:

通过从gdb = 8.1-0ubuntu3.1降级到gdb = 8.1-0ubuntu3,调试器开始为我重新工作。

这在Ubuntu 18.04.3。上也对我有用。您应该发出以下命令:

sudo apt install gdb=8.1-0ubuntu3  # downgrade GDB to the working version
sudo apt-mark hold gdb  # prevent upgrading (until the repository version is fixed)
Run Code Online (Sandbox Code Playgroud)

我为Ubuntu创建了一个错误报告:https : //bugs.launchpad.net/ubuntu/+source/gdb/+bug/1848200如果您有Ubuntu帐户,
可以单击Does this bug affect you?以便尽快修复。