|
From: Greatwolf <gma...@ma...> - 2010-10-15 02:28:39
|
When debugging some executable files under this platform, gdb has trouble debugging certain executable formats. For example, try loading gdb notepad.exe under windows 7. gdb will give an error message not in executable format: File format not recognized Similarly, executables compiled and linked with digital mars C++ tools have the same problems as well as borland object files that are linked with the unilinker.exe. The demo program from pelib also fails to load under gdb. All in these cases gdb issues the same error message. The error message of course doesn't make any sense, how could the binary not be a valid executable format?? The windows loader certainly has no issues loading and running it. Other debuggers and disassemblies have no problems opening/attaching to it. On a similar note, using objdump on those above cases gives a similar error: File format not recognized Any ideas what the issue might be? I have a feeling it's probably an issue with binutils bfd. Thanks |
|
From: Chris S. <ir0...@gm...> - 2010-10-15 15:25:25
|
On 14 October 2010 22:28, Greatwolf wrote: > Any ideas what the issue might be? I have a feeling it's probably an > issue with binutils bfd. Are you mixing 32-bit and 64-bit executables (i.e. are you trying to use a 32-bit GDB to debug a 64-bit exe)? I've seen this kind of behaviour in this scenario. Chris -- Chris Sutcliffe http://emergedesktop.org http://www.google.com/profiles/ir0nh34d |
|
From: Greatwolf <gma...@ma...> - 2010-10-16 08:34:02
|
On 15 Oct 2010, you wrote in gmane.comp.gnu.mingw.user: > > Are you mixing 32-bit and 64-bit executables (i.e. are you trying to > use a 32-bit GDB to debug a 64-bit exe)? I've seen this kind of > behaviour in this scenario. > > Chris > That's a good point. I am using Win7 64bit but out of those executes I fed into gdb only notepad.exe is a portable executable 64. All the others were compiled as a 32bit PE executable. What I found is that gdb handles VC9 compiled 32bit executables and borland compiled 32-bit executables using its default ilink32 linker. gdb gives erros on executables compiled with digital mars compiler(32-bit) and executables compiled with borland but linked with unilinker instead of ilink32. So from that, 32-bit vs 64-bit shouldn't be the issue. What are the other possibilities? |
|
From: Chris S. <ir0...@gm...> - 2010-10-16 12:33:51
|
On 16 October 2010 04:33, Greatwolf wrote: > What I found is that gdb handles VC9 compiled 32bit executables and > borland compiled 32-bit executables using its default ilink32 linker. gdb > gives erros on executables compiled with digital mars compiler(32-bit) > and executables compiled with borland but linked with unilinker instead > of ilink32. > > So from that, 32-bit vs 64-bit shouldn't be the issue. What are the other > possibilities? I'd recommend following up on the gdb mailing list (http://www.gnu.org/software/gdb/mailing-lists/), perhaps the gdb developers might have some additional ideas as to what the issue could be. Chris -- Chris Sutcliffe http://emergedesktop.org http://www.google.com/profiles/ir0nh34d |
|
From: Charles W. <cwi...@us...> - 2010-10-16 18:33:38
|
On 10/16/2010 8:33 AM, Chris Sutcliffe wrote: > On 16 October 2010 04:33, Greatwolf wrote: >> What I found is that gdb handles VC9 compiled 32bit executables and >> borland compiled 32-bit executables using its default ilink32 linker. gdb >> gives erros on executables compiled with digital mars compiler(32-bit) >> and executables compiled with borland but linked with unilinker instead >> of ilink32. >> >> So from that, 32-bit vs 64-bit shouldn't be the issue. What are the other >> possibilities? > > I'd recommend following up on the gdb mailing list > (http://www.gnu.org/software/gdb/mailing-lists/), perhaps the gdb > developers might have some additional ideas as to what the issue could > be. guys, the odds are very low than the GNU debugger is going to work optimally with object code compiled with other proprietary compilers. The debugging information is in a different format (stabs, stabs++, dwarf2, dwarf2+, ...). If it works at all with object code compiled with foreign compilers, consider yourself lucky. Use the GNU debugger with stuff compiled using the GNU compiler. Use the proprietary debugger with stuff compiled using proprietary compilers. -- Chuck |
|
From: Greatwolf <gma...@ma...> - 2010-10-16 23:20:56
|
Charles Wilson <cwi...@us...> wrote in news:4CB...@us...: > On 10/16/2010 8:33 AM, Chris Sutcliffe wrote: > > guys, the odds are very low than the GNU debugger is going to work > optimally with object code compiled with other proprietary compilers. > The debugging information is in a different format (stabs, stabs++, > dwarf2, dwarf2+, ...). I am aware that the debug format will obviously not be supported by gdb. But I should be able to at least perform debugging at the assembly level for a given executable. A PE executable is a PE executable right? Whether that executable contains a different object format isn't relevant. All executables runnable on the windows platform must conform to the PE32 specs for it to even be loadable and executable at all. Otherwise how would the windows loader know how to handle it? That should also mean any win32 disassembliers should be able to open and treat that executable in the same way. Take for example ollydbg and even the dated turbo debugger from borland. I haven't ran into any issues of them opening any kind of PE32 executables regardless of which compiler tools were used for this platform. I will inquire about this on the gdb mailing too and hopefully get more info. Thanks |