Mailing-List: contact cygwin-help@sourceware.cygnus.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@sourceware.cygnus.com>
List-Archive: <http://sourceware.cygnus.com/ml/cygwin/>
List-Post: <mailto:cygwin@sourceware.cygnus.com>
List-Help: <mailto:cygwin-help@sourceware.cygnus.com>, <http://sourceware.cygnus.com/ml/#faqs>
Sender: cygwin-owner@sourceware.cygnus.com
Delivered-To: mailing list cygwin@sourceware.cygnus.com
Date: Thu, 29 Jun 2000 23:37:54 -0400
Message-Id: <200006300337.XAA23859@envy.delorie.com>
From: DJ Delorie <dj@delorie.com>
To: Motohiko.Nagano@jp.sony.com
CC: cygwin@sourceware.cygnus.com, binutils@sourceware.cygnus.com
In-reply-to: <7840643F05B5D3119B9A0000F807175702BD85E0@SJP01014>
	(Motohiko.Nagano@jp.sony.com)
Subject: Re: Can gdb debug win32 native program?
References:  <7840643F05B5D3119B9A0000F807175702BD85E0@SJP01014>


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

