This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Can gdb debug win32 native program?



Warning: cross-posted to cygwin and binutils.  Remove at least one
when replying!

> bash-2.04$ objdump -p //E/WINNT/SYSTEM32/calc.exe
> objdump: //E/WINNT/SYSTEM32/calc.exe: File format not recognized

OK, I debugged it and I know why it's failing, but I don't have a fix.

To make it short: 99% of all PE programs have the same sized
structures at the beginning of the program file.  Some don't.  BFD
tries hard to adjust to the varying sizes, but it appears that in your
case it doesn't do it right, and ends up reading a structure from the
wrong place in the file.  If you care to debug it, look for
pe_bfd_object_p() in bfd/peicode.h; the test that fails is in
coff_bad_format_hook() in bfd/coffcode.h.  However, I suspect I will
be debugging this one myself :-( but not tonight.

I had to scan my whole system32 directory to find a program that
failed this way, too!

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]