KDB_TRACE and no backend

2010-09-18 Thread Andriy Gapon
Here's a small patch that adds support for printing stack trace in form of frame addresses when KDB_TRACE is enabled, but there is no debugger backend configured. The patch is styled after cheap variant of stack_ktr. What do you think (useful/useless, correct, etc) ? --- a/sys/kern/subr_kdb.c

Re: KDB_TRACE and no backend

2010-09-18 Thread Attilio Rao
2010/9/18 Andriy Gapon a...@icyb.net.ua: Here's a small patch that adds support for printing stack trace in form of frame addresses when KDB_TRACE is enabled, but there is no debugger backend configured. The patch is styled after cheap variant of stack_ktr. What do you think

Re: KDB_TRACE and no backend

2010-09-18 Thread Andriy Gapon
on 18/09/2010 21:26 Attilio Rao said the following: You have to eventually wrap this logic within the 'STACK' option (opt_stack.h for the check) because stack_save() will be uneffective otherwise. STACK should be mandatory for DDB I guess, but it is not for KDB. Thank you for the tip! BTW,

Re: KDB_TRACE and no backend

2010-09-18 Thread Andriy Gapon
on 18/09/2010 21:41 Andriy Gapon said the following: on 18/09/2010 21:26 Attilio Rao said the following: You have to eventually wrap this logic within the 'STACK' option (opt_stack.h for the check) because stack_save() will be uneffective otherwise. STACK should be mandatory for DDB I guess,

Re: KDB_TRACE and no backend

2010-09-18 Thread Andriy Gapon
on 18/09/2010 22:00 Andriy Gapon said the following: Oh, wow, and I totally overlooked stack_print(). Should have read stack(9) from the start. New patch. Hope this is better. I don't like that the printf is duplicated, but couldn't figure out a way to combine pre-processor and C conditions.

Re: KDB_TRACE and no backend

2010-09-18 Thread Attilio Rao
2010/9/18 Andriy Gapon a...@freebsd.org: on 18/09/2010 22:00 Andriy Gapon said the following: Oh, wow, and I totally overlooked stack_print(). Should have read stack(9) from the start. New patch.  Hope this is better. I don't like that the printf is duplicated, but couldn't figure out a way

Re: KDB_TRACE and no backend

2010-09-18 Thread Andriy Gapon
on 18/09/2010 23:35 Attilio Rao said the following: It is still missing checking on opt_stack.h Yes, thanks, fixed it in my tree. Besides, I'd reconsider having KDB_TRACE explanation in ddb(4) manpage (right now it is rightly there because it is DDB specific only, as long as it offers the

Re: KDB_TRACE and no backend

2010-09-18 Thread Attilio Rao
2010/9/18 Andriy Gapon a...@freebsd.org: on 18/09/2010 23:35 Attilio Rao said the following: It is still missing checking on opt_stack.h Yes, thanks, fixed it in my tree. Besides, I'd reconsider having KDB_TRACE explanation in ddb(4) manpage (right now it is rightly there because it is DDB