Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 20 Mar 2002 15:55:03 -0500 (EST)
From:      John Baldwin <jhb@FreeBSD.org>
To:        Hiten Pandya <hiten@uk.FreeBSD.org>
Cc:        hackers@FreeBSD.org
Subject:   RE: Debugging BTX Faults
Message-ID:  <XFMail.20020320155503.jhb@FreeBSD.org>
In-Reply-To: <20020320193816.A1698@hpdi.ath.cx>

next in thread | previous in thread | raw e-mail | index | archive | help

On 20-Mar-2002 Hiten Pandya wrote:
> Hi all,
> 
> How does one debug faults in the BTX Loader?  I am currently trying
> to work on PR i386/21559, and after reading jhb's document on the
> loading process, I was curious to know..

Well, you need to be fairly familiar with how IA32 works.  The int= number is
the fault that was triggered.  Then, use a program to convert the hex dump at
cs:eip to binary and run that through ndisasm (or ndisasm -U depending on if
the code segment in cs is USE32 or not) to see what instruction it died on. 
You then look up that instruction in teh reference manual and see how the given
fault can be triggered.  Some faults are rather obvious just from the fault
number and don't require you to look up the instruction.  Sometimes it's not
the actual instruction that's the problem, but instead you managed to hose the
stack or some such in which case you just ahve to look at the register and
stack dumps to try and figure out what went wrong.

-- 

John Baldwin <jhb@FreeBSD.org>  <><  http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve!"  -  http://www.FreeBSD.org/

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?XFMail.20020320155503.jhb>