Subject: Re: Building a custom kernel -- trying to debug
To: matthew green <>
From: Jan Danielsson <>
List: tech-kern
Date: 12/24/2007 10:05:21
Hash: SHA512

matthew green wrote:
>       It's not an actual crash I want to debug. I want to use ddb to track
>    down some inconsistent behavior. (See the PR link for more information).
>     Hmm... How huge are we talking about here? I have constraints, since
>    I'm booting from a memory disk (loaded from an USB memory stick).
> ddb doesn't use much debugging info.  it won't give you
> sources or line info like gdb does.  you don't want to
> boot the netbsd.gdb.

   I have a pretty good idea of what function I want to debug, and I
only need some very basic functions to set break points, and to be able
to print some data. I've done this in the past with OS/2, so I'm not
unaware of how painful it can be.

> perhaps you want to use kgdb with a serial port?

   The problem is that I don't have a serial port on my other computer.
Nor do I run NetBSD on it.

   But if push comes to shove, I may install NetBSD on a memory stick
and boot from it from my laptop. But it leaves an important question:
Will I be able to use one of those ugle USB<->RS232 converters?

> or
> simply plug numbers into gdb while driving them from ddb.
> i do the latter a lot -- inspecting the pc addresses etc
> from gdb that i found in ddb.

   How is this accomplished? Would it be possible to run..

   # gdb /netbsd

   ..and simply point out /dev/mem as a core file?

- --
Kind regards,
Jan Danielsson

Version: GnuPG v1.4.7 (NetBSD)