32bit gdb debug 64bit二進制文件?可以32bit gdb調試64bit二進制文件嗎?
0
A
回答
0
是的。至少在最新版本上,32位gdb在Solaris上很好地調試了64位二進制文件。
$ cat /etc/release
Oracle Solaris 11 Express snv_151a X86
Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
Assembled 04 November 2010
$ file /usr/bin/gdb
/usr/bin/gdb: ELF 32-bit LSB executable 80386 Version 1 [FPU], dynamically linked, not stripped, no debugging information available
$ file a
a: ELF 64-bit LSB executable AMD64 Version 1, dynamically linked, not stripped
$ gdb a
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 "i386-pc-solaris2.11"...
(gdb) b main
Breakpoint 1 at 0x400e9c: file a.c, line 3.
(gdb) run
Starting program: /tmp/a
Breakpoint 1, main() at a.c:3
3 printf("hello world !");
(gdb) quit
The program is running. Exit anyway? (y or n) y
$
但是,如果你仔細看,這32 GDB的引擎蓋下推出了64位GDB:
$ truss -f -t execve /usr/bin/gdb a
1793: execve("/usr/bin/gdb", 0x0804755C, 0x08047568) argc = 2
1793: execve("/usr/bin/amd64/gdb", 0x0804755C, 0x08047568) argc = 2
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 "i386-pc-solaris2.11"...
(gdb)
它做它無論調試的二進制是32位還是64位。
我仍然認爲調試器與Solaris下的進程交互的方式與尺寸無關,因此從技術上講,只有32位二進制調試器應該能夠調試64位程序。
64位gdb能夠調試32位和64位二進制文件,但32位gdb無法調試64位二進制文件。這就是你正在經歷的。
2
以上答案不正確。您需要一個64位調試器來調試64位進程。這正是gdb爲什麼在後臺分配64位副本的原因。
相關問題
- 1. 爲Android編譯GDB二進制文件 - 有可能嗎?
- 2. JDK 64bit或32bit?
- 3. visual basic 2008 32bit/64bit?
- 4. eclipse:無需二進制文件調試
- 5. 我可以使用GDB調試正在運行的進程嗎?
- 6. 將64bit .so轉換爲32bit
- 7. ASP.Net MVC DllImport BadImageFormatException 32bit/64bit
- 8. Inno-setup 32bit和64bit in one
- 9. 可以將ruby腳本預編譯爲二進制文件嗎?
- 10. 我可以識別x86二進制文件中的「函數」嗎?
- 11. Can DirectSound可以播放原始二進制聲音文件嗎?
- 12. 我可以阻止用戶執行二進制文件嗎?
- 13. SAS可以將CSV文件轉換爲二進制格式嗎?
- 14. 我可以在二進制文件中使用fgetc()或fputc()嗎?
- 15. 可以從iOS二進制文件中提取iOS類嗎?
- 16. 可以將二進制文件放在nexus存儲庫上嗎?
- 17. 我可以使用perlbrew安裝perl二進制文件嗎?
- 18. 讓gdb自動從核心文件加載二進制文件
- 19. 是否可以在php 64bit上使用Nginx 32bit?
- 20. 當GDB調試核心文件時,是否可以將裝滿二進制數據的文件加載到GDB中?
- 21. 使用與二進制文件不同時生成的pdb文件進行調試。可能嗎?
- 22. 'to_yaml'時,我們可以強制渲染文本爲二進制文件嗎?
- 23. 文件大小計算,Int64的,而32bit和64bit
- 24. 您可以從調試編譯的二進制文件中檢索源代碼嗎?
- 25. 調試子進程 - GDB/DDD
- 26. 使用GDB進行調試
- 27. 我可以用cuda-gdb調試openACC嗎?還是其他的調試工具?
- 28. 使用junit測試從文本和二進制文件讀取以及寫入文本和二進制文件
- 29. 在i386架構下獲取BusyBox的gdb二進制文件
- 30. gdb可以用什麼樣的程序進行調試?
非常感謝。在我的環境中:/ usr/local/bin/gdb:ELF 32位LSB可執行文件80386版本1,動態鏈接,沒有被剝離,我得到這個錯誤:附加到程序`/ ****/sd',進程5139 /proc/5139:定義的數據類型的值太大。 do_attach:無法保存跟蹤的故障 – 2011-02-14 03:43:46
您應該在問題中提供額外的信息,而不是評論。如果您提供了有關Solaris和gdb發行版的更多信息,就像我一樣,這將有所幫助。 – jlliagre 2011-02-14 07:07:10