Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 20 Jan 2004 18:11:25 +1100 (EST)
From:      Bruce Evans <bde@zeta.org.au>
To:        Poul-Henning Kamp <phk@FreeBSD.org>
Cc:        cvs-all@FreeBSD.org
Subject:   Re: 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
Message-ID:  <20040120175334.W3279@gamplex.bde.org>
In-Reply-To: <200401192127.i0JLRBL3041817@repoman.freebsd.org>
References:  <200401192127.i0JLRBL3041817@repoman.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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



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