Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: GDB can't access kext code memory



Hi Harland,

I know that gdb has to "attach" to a process to access its memory.
I have tried the "attach" command with every PID listed in the PS command.
I have tried the "attach" command with the symbol file and the kext.
How do you attach to a kext?

You don't, directly. You attach to the panicked machine from a second machine attached via Ethernet or FireWire.


It sounds like you have a panic log but you want to view memory on the panicked machine. Is that right? If so, you need to set up two-machine debugging. The documentation on this is pretty good. The best place to start is "Kernel Extension Concepts", especially the section titled "Hello Debugger":

<http://developer.apple.com/documentation/Darwin/Conceptual/ KEXTConcept/index.html>.

HAS ANYONE EVER USED TN2063?

:-) I wrote it. And, yes, those techniques are being used every day by developers and Apple engineers.


Please send anything which might help

If you're still stuck after reviewing the docs, how about posting the sequence of commands you've tried?



thanks

Harland Harrison
2wire.com

Regards, --gc



-----Original Message-----
From: usb-bounces+hharrison=email@hidden on behalf of Jim Wintermyre
Sent: Tue 2/8/2005 4:43 PM
To: email@hidden
Subject: RE: GDB can't access kext code memory


The GDB tool always returns "Cannot access memory" for me, even on
valid addresses. I proved that with a panic.log from the same
machine and OS which is running GDB.

Using an "assert()" in my kext, I generated a panic.log on the same
machine. Then I ran kextstat and checked that the addresses in this
panic.log fell within the ranges of the kexts involved. Then I tried
to read those addresses with the GDB tool. GDB still returned
"Cannot access memory" for valid addresses in my kext, and also for
addresses within the ranges of several "com.apple.X" kexts.

If you're trying to access memory in your device's address space, you may need to use the kdp_read_io (mapped memory) and/or kdp_trans_off (phsical addresses) options.  Check here for more info:

http://developer.apple.com/documentation/Darwin/Conceptual/ KernelProgramming/build/chapter_18_section_5.html

Also, I have heard that kdp_trans_off will affect lots of things in
gdb, so its best to enable and then disable before attempting
anything else.

Jim
__________________________________________________________________
Garth Cummings				
Apple Developer Technical Support 	email@hidden

http://developer.apple.com/technicalsupport

Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Usb mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/usb/email@hidden

This email sent to email@hidden

References: 
 >RE: GDB can't access kext code memory (From: "Harland Harrison" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.