Attaching to /dev/kmem with gdb
Attaching to /dev/kmem with gdb
- Subject: Attaching to /dev/kmem with gdb
- From: Brian Tabone <email@hidden>
- Date: Thu, 3 Apr 2003 23:42:07 -0600
List,
I have heard of old school UNIX hacks attaching to live kernels with
gdb, allowing them to see values of variables and changing those values
on the fly. I am curious as to how one could do this on Darwin. I
attempted to attach to /dev/kmem via gdb, as root. All I would get back
was a complaint that /dev/kmem could not be found (I looked and its
there all-right). What I can gather is that /dev/kmem is a character
special file, and is not visible to gdb in a direct fashion. I used the
following
gdb -s /mach.sym /dev/kmem
Now I know you can't attach directly to a running kernel as you would a
program, since halting the kernel would halt you. But, from what I
understand you can attach to the running image to examine the memory,
without halting that image. Perhaps I am mistaken?
-Sincerely
Brian Tabone
_______________________________________________
darwin-kernel mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/darwin-kernel
Do not post admin requests to the list. They will be ignored.