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

Pan, Deng deng.pan at intel.com
Mon Oct 14 02:18:57 PDT 2002


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




More information about the cgl_discussion mailing list