From owner-freebsd-hackers Wed Mar 20 12:55: 4 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from mail12.speakeasy.net (mail12.speakeasy.net [216.254.0.212]) by hub.freebsd.org (Postfix) with ESMTP id 7CE3837B400 for ; Wed, 20 Mar 2002 12:55:01 -0800 (PST) Received: (qmail 15763 invoked from network); 20 Mar 2002 20:55:00 -0000 Received: from unknown (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender ) by mail12.speakeasy.net (qmail-ldap-1.03) with DES-CBC3-SHA encrypted SMTP for ; 20 Mar 2002 20:55:00 -0000 Received: from laptop.baldwin.cx (gw1.twc.weather.com [216.133.140.1]) by server.baldwin.cx (8.11.6/8.11.6) with ESMTP id g2KKtXv63513; Wed, 20 Mar 2002 15:55:33 -0500 (EST) (envelope-from jhb@FreeBSD.org) Message-ID: X-Mailer: XFMail 1.5.2 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <20020320193816.A1698@hpdi.ath.cx> Date: Wed, 20 Mar 2002 15:55:03 -0500 (EST) From: John Baldwin To: Hiten Pandya Subject: RE: Debugging BTX Faults Cc: hackers@FreeBSD.org Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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 <>< 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