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

Randy.Dunlap rddunlap at osdl.org
Mon Oct 14 09:29:21 PDT 2002

On Mon, 14 Oct 2002, Howell, David P wrote:

| 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

Along the same lines, kdb started out very small and was planned
to stay that way since it is in_the_kernel.

Have you already enabled kdb to use kerntypes?
if so, send patches.

| -----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
| _______________________________________________

  "In general, avoiding problems is better than solving them."
  -- from "#ifdef Considered Harmful", Spencer & Collyer, USENIX 1992.

More information about the cgl_discussion mailing list