Re: KP / gdb debug question...
Re: KP / gdb debug question...
- Subject: Re: KP / gdb debug question...
- From: Ronnie Misra <email@hidden>
- Date: Fri, 3 Dec 2004 19:15:56 -0800
On Dec 3, 2004, at 6:54 PM, Marek Kozubal wrote:
This is probably documented somewhere, but I've not found the answer
to this.
I have a KP log from a user, its a simple data access problem (so a
NULL pointer deference or something like). However, how do I figure
out which line of code its in? I know its 68 bytes into my function,
but there's no Disassemble in XCode like there is in CodeWarriror that
let me figure such things out. So how do I figure out what line of
code is the offender without become awesome at reading PPC asm code
(and who knows how the optimiser might have changed orders of things
and etc).
Key parts from the KP:
Proceeding back via exception chain:
Exception state (sv=0x1C79C280)
PC=0x1C808CD8; MSR=0x00009030; DAR=0x00000060; DSISR=0x40000000;
LR=0x1C80A5F4; R1=0x0A103BF0; XCP=0x0000000C (0x300 - Data access)
Backtrace:
0x00093D70 0x1C80A5F4 0x000CE2E0 0x002218C8 0x00221764
0x002452B4
0x00094200 0x40B73B71
Kernel version:
Darwin Kernel Version 7.5.0:
Thu Aug 5 19:26:16 PDT 2004; root:xnu/xnu-517.7.21.obj~3/RELEASE_PPC
Now the function the PC is at starts at 0x1c808c94. So 0x1C808CD8 -
0x1c808c94 = 0x44 = 68 bytes.
You can do this if your binary has debugging symbols.
Before the kext crashes, figure out where it loaded on the target:
% kextstat | grep org.samoconnor.driver.NetworkAudioDriver
117 0 0x20781000 0x4000 0x3000
org.samoconnor.driver.NetworkAudioDriver (0.1) <82>
The third number is the load address of the kext.
Now after you get your panic, do the following:
% gdb
(gdb) add-symbol-file
/path/to/NetworkAudioDriver.kext/ts/MacOS/NetworkAudioDriver -s
LC_SEGMENT. 0x20782000 <- add 0x1000 here, I'm not sure exactly why
though :)
(gdb) l *0x20782a7c
0x20782a7c is in org_samoconnor_driver_NetworkAudioEngine::init()
(NetworkAudioEngine.cpp:153).
148
149 if (!IOAudioEngine::init(NULL)) {
150 return false;
...
Incidentally, how did you figure out that the function starts at
0x1c808c94?
Ronnie
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden