Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/c/63.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C 使用x64 gdb调试x32应用程序_C_Gdb - Fatal编程技术网

C 使用x64 gdb调试x32应用程序

C 使用x64 gdb调试x32应用程序,c,gdb,C,Gdb,我在x64机器上使用gcc(tdm-64-1)在C上构建了一个32位应用程序。我需要一个调试器,它是gdb。但问题是它不适用于x32。有什么办法使它起作用吗? 这是我调试gdb时的输出: Reading symbols from test.exe... (gdb) break 5 Breakpoint 1 at 0x401533: file d:\1\a\test.c, line 10. (gdb) start Temporary breakpoint 2 at 0x40156b: file d

我在x64机器上使用gcc(tdm-64-1)在C上构建了一个32位应用程序。我需要一个调试器,它是gdb。但问题是它不适用于x32。有什么办法使它起作用吗? 这是我调试gdb时的输出:

Reading symbols from test.exe...
(gdb) break 5
Breakpoint 1 at 0x401533: file d:\1\a\test.c, line 10.
(gdb) start
Temporary breakpoint 2 at 0x40156b: file d:\1\a\test.c, line 21.
Starting program: D:\1\a\test.exe
warning: `C:\WINDOWS\SYSTEM32\ntdll.dll': Shared library architecture i386:x86-64 is not compatible with target architecture i386.
warning: `C:\WINDOWS\System32\wow64.dll': Shared library architecture i386:x86-64 is not compatible with target architecture i386.
warning: `C:\WINDOWS\System32\wow64win.dll': Shared library architecture i386:x86-64 is not compatible with target architecture i386.
warning: `C:\WINDOWS\System32\wow64cpu.dll': Shared library architecture i386:x86-64 is not compatible with target architecture i386.
[New Thread 4784.0x31c4]
gdb: unknown target exception 0x4000001f at 0x40156b

Thread 1 received signal ?, Unknown signal.
0x0009df38 in ?? ()

根据GDB 10的规定,它是(将得到?)固定的。尝试
git克隆--branch gdb-10-branchgit://sourceware.org/git/binutils-gdb.git
并查看使用该分支构建的gdb在您的案例中是否有用。建议您需要使用“gdb32”来调试32位应用程序。如果可以的话,我必须下载一个完全不同的应用程序来调试x32,这有点奇怪-gcc中的m32。。。