cvs commit: src/sys/alpha/alpha support.s src/sys/i386/i386 swtch.s src/sys/kern kern_shutdown.c src/sys/sys systm.h

Bruce Evans bde at zeta.org.au
Mon Jan 19 23:11:30 PST 2004


On Mon, 19 Jan 2004, Poul-Henning Kamp wrote:

> phk         2004/01/19 13:27:11 PST
>
>   FreeBSD src repository
>
>   Modified files:
>     sys/alpha/alpha      support.s
>     sys/i386/i386        swtch.s
>     sys/kern             kern_shutdown.c
>     sys/sys              systm.h
>   Log:
>   Add linenumber and source filename to panic(9) output.

This was rejected in all reviews.  It gives less information than
grepping the sources, at some cost (grep at least gives correct line
numbers when the sources don't quite match the binary).

Please back this out.

>   Ideally a traceback should be printed too, any takers ?

This can be obtained by running a debugger on the panic dump.  Line
numbers and source file names can also be printed by the debugger
if the executable has at least line numbers in its debugging info.

I've thought of reducing the bloat for line numbers and source file
names in mutex debugging using debugger-like techniques or just a
debugger.  E.g., mtx_lock_sleep() is now implemented (in the INVARIANTS
case) using:

void	_mtx_lock_sleep(struct mtx *m, int opts, const char *file, int line);

`file' and `line' here are redundant, since they can be determined from
the program counter given enough debugging info (mainly line numbers).

Verbose panic messages, and lots of code to print out values of variables
just before panicing, are another mistake.  Short panic messages were
good enough when debuggers were primitive or nonexistent.  Verbose panic
messages are even less needed now.

Bruce


More information about the cvs-src mailing list