Re: KP / gdb debug question...
Re: KP / gdb debug question...
- Subject: Re: KP / gdb debug question...
- From: Shawn Erickson <email@hidden>
- Date: Sat, 4 Dec 2004 08:40:31 -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?
If you go to Apple's developer site and do a search on "kernel panic" you should find things like this...
<http://developer.apple.com/technotes/tn2002/tn2063.html>
<http://developer.apple.com/technotes/tn2004/tn2118.html>
<http://developer.apple.com/documentation/Darwin/Conceptual/KernelProgramming/build/chapter_18_section_5.html>
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.
As of at least Xcode 1.5 you can view assemble for source files if you are using native targets. Simply select the "Show Assembly Code" option from build menu or from the contextual menu when you have a source file selected. Also native target support exists now for IOKit drivers.
For example see the following... IIRC it differs from code warrior's output but it has been a while but I bet with a little parameter twiddling to gcc you could get something more helpful if something like the following doesn't cut. Anyway using symbols in gdb is the way to go since it can then intermix source with assemble, etc.
.stabs 0,Ltext0
.stabs 0,Ltext0
.section __TEXT,__text,regular,pure_instructions
.align 2
Ltext0:
.stabs 0
.align 2
.globl __ZN20com_ftsw_drv_qlc_hba18handleMissingTimerEv
.section __TEXT,__text,regular,pure_instructions
.align 2
__ZN20com_ftsw_drv_qlc_hba18handleMissingTimerEv:
.stabd 18
mflr r0
stmw r30,-8(r1)
mr r31,r3
stw r0,8(r1)
stwu r1,-80(r1)
.stabd 25
LBB2:
jbsr __ZN20com_ftsw_drv_qlc_hba25updateStateOfMissingPortsEv,L3
.stabd 27
lwz r0,256(r31)
andis. r2,r0,1024
beq- cr0,L1
.stabd 28
lwz r3,240(r31)
li r4,1000
lwz r0,88(r1)
addi r1,r1,80
lmw r30,-8(r1)
lwz r2,0(r3)
mtlr r0
lwz r12,300(r2)
mtctr r12
bctr
.stabd 29
L1:
lwz r0,88(r1)
addi r1,r1,80
lmw r30,-8(r1)
mtlr r0
blr
_______________________________________________
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