Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 24 Aug 2008 20:01:24 +0000
From:      "Guillaume Ballet" <gballet@gmail.com>
To:        freebsd-hackers@freebsd.org
Cc:        Sam Leffler <sam@freebsd.org>
Subject:   Re: Extending the ddb command set
Message-ID:  <fd183dc60808241301p7bbc01c8tcd49d2d54ca8aea9@mail.gmail.com>
In-Reply-To: <200808181002.14885.jhb@freebsd.org>
References:  <fd183dc60808160203r3d90c26dq4d282d2ef153d2db@mail.gmail.com> <48A70B37.60401@freebsd.org> <fd183dc60808171017m7eabcef2xbe1845e54cda4c99@mail.gmail.com> <200808181002.14885.jhb@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Aug 18, 2008 at 2:02 PM, John Baldwin <jhb@freebsd.org> wrote:
> (snip)
> A simpler approach is probably to make DB_COMMAND() use a SYSINIT to register
> new functions instead of teaching DDB about that linker set.  You just need
> to write a shared "register_command()" function (and a deregister for
> SYSUNINIT for module unload) that the SYSINIT uses.  This also probably
> requires changing the structure of the DDB tables, though you might be able
> to make it simpler now.  You could probably just make the tables be sorted
> linked lists now instead of arrays.  This would also remove the whole "aux
> table" hack.
>

Following Sam and John's advice, I have rewritten the patch so as to
use SYS(UN)INIT. It uses a linked list instead of an array to store
commands.

As the patch is more than 400 lines long, it is available for reviewing at:

http://dl.free.fr/jQQQkB72h0

I used 7.0 ; 6.2 requires a bit more work.

Many thanks to Sam, John and Kostik for their suggestions. Feedback is
still welcome :)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?fd183dc60808241301p7bbc01c8tcd49d2d54ca8aea9>