Using gdb and gdbserver with a 32 bit binary on a 64 bit machine with Centos 5 complains about memory access or badly formatted data

后端 未结 1 990
旧巷少年郎
旧巷少年郎 2020-12-31 18:32

I have two identical 64 bit Centos 5 machines, that are networked, and share their /home mount. I compile a simple Hello World program on one, and then I have figured out h

相关标签:
1条回答
  • 2020-12-31 19:12

    If you want to debug 32-bit process using 64-bit gdb/gdbserver, you need a newer version of GDB. In particular, you need this:

    gdbserver/ChangeLog:
    
    2009-05-12  Doug Evans  <dje@google.com>
    
            Biarch support for i386/amd64 gdbserver.
    

    Alternatively, you can build gdb/gdbserver you already have from source in 32-bit mode by running

    ./configure CC='gcc -m32'
    

    and use gdb32/gdbserver32 to debug your processes. I don't see any advantage of doing this though -- newer versions of GDB have many fixes, speedups, and STL pretty printers are nice.

    0 讨论(0)
提交回复
热议问题