[cgl_discussion] Why KDB does not take advantage of Kerntypes information?

Howell, David P david.p.howell at intel.com
Mon Oct 14 08:59:37 PDT 2002


Whatever kdb uses would have to be within the kernel's vm map, lcrash reads
Kerntypes from a user session as it's a utility. As Kerntypes was invented 
for lcrash, this is why it's used there and not in kdb.

So, there would have to be a way to get access to the struct/type definitions
in kernel mode, either by mapping them into the kernel, loading them as a module,
or using another method like compiling the kernel with -g to get them. This can
be done and likely should, unless there is some mechanism that I'm not aware of
for doing this already.

Dave Howell

-----Original Message-----
From: Pan, Deng 
Sent: Monday, October 14, 2002 5:19 AM
To: cgl_discussion at lists.osdl.org
Subject: [cgl_discussion] Why KDB does not take advantage of Kerntypes information?


lcrash takes advantage of the type information in Kerntypes, so it can
display  detailed information about any kernel structure and print the whole
structure and any member in the structure. For example, 
>>whatis task_struct
>>print *(task_struct*)0xc5436000
>>print (task_struct*)0xc5436000->uid

However, in KDB, to access a structure member, we have to use the annoying
offset, instead of the structure member name. Just like this:
kdb> md 0xc5436000+0x2c

In KDB, to display a kernel structure(for example, page_t and mm_struct) a
special kdb module (kdbm_pg.o, kdbm_vm.o)has to be inserted into kernel.
Since 
there are large number of data structure in the kernel, we cannot provide a
module for each of the data structure. Even worse, if the data structure in
the kernel have been changed, the kdb module have to be changed accordingly.


Since lcrash have already set a good example, why does KDB not take
advantage of Kerntypes information?


Pan, Deng 
Intel China Software Lab 

======================================
This email message contains solely my own personal views, and not
necessarily those of my employer

_______________________________________________
cgl_discussion mailing list
cgl_discussion at lists.osdl.org
http://lists.osdl.org/mailman/listinfo/cgl_discussion



More information about the cgl_discussion mailing list