Remove filename+line number from panic messages.

This commit is contained in:
Poul-Henning Kamp 2004-06-06 21:26:49 +00:00
parent cac4b14c12
commit 9a6dc4b647
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=130164
8 changed files with 17 additions and 50 deletions

View file

@ -680,10 +680,8 @@ LEAF(longjmp, 1)
longjmp_botch:
lda a0, longjmp_botchmsg
mov 0, a1
mov 0, a2
mov ra, a3
CALL(__panic)
mov ra, a1
CALL(panic)
call_pal PAL_bugchk
.data

View file

@ -65,14 +65,10 @@ AST_ALIGNMENT_FAULT_LOCALS
*/
ASENTRY_NP(reset_entry)
adr r0, Lreset_panicmsg
adr r1, Lfile
mov r2, #__LINE__
bl _C_LABEL(__panic)
bl _C_LABEL(panic)
/* NOTREACHED */
Lreset_panicmsg:
.asciz "Reset vector called, LR = 0x%08x"
Lfile:
.asciz __FILE__
.balign 4
/*
@ -122,12 +118,7 @@ _C_LABEL(prefetch_abort_handler_address):
.text
abortprefetch:
adr r0, abortprefetchmsg
adr r1, filee
mov r2, #__LINE__
b _C_LABEL(__panic)
filee:
.asciz __FILE__
b _C_LABEL(panic)
abortprefetchmsg:
.asciz "abortprefetch"
@ -164,14 +155,10 @@ _C_LABEL(data_abort_handler_address):
.text
abortdata:
adr r0, abortdatamsg
adr r1, file
mov r2, #__LINE__
b _C_LABEL(__panic)
b _C_LABEL(panic)
abortdatamsg:
.asciz "abortdata"
file:
.asciz __FILE__
.align 0
/*

View file

@ -221,11 +221,7 @@ ENTRY(in4_cksum)
.Lin4_cksum_whoops:
adr r0, .Lin4_cksum_whoops_str
adr r1, .LFile
mov r2, #__LINE__
bl _C_LABEL(__panic)
.LFile:
.asciz __FILE__
bl _C_LABEL(panic)
.Lin4_cksum_whoops_str:
.asciz "in4_cksum: out of mbufs\n"
.align 5

View file

@ -153,9 +153,7 @@ mmu_done:
bl _C_LABEL(mi_startup) /* call mi_startup()! */
adr r0, .Lmainreturned
adr r1, .LFile
mov r2, #__LINE__
b _C_LABEL(__panic)
b _C_LABEL(panic)
/* NOTEACHED */
#ifdef STARTUP_PAGETABLE_ADDR
#define MMU_INIT(va,pa,n_sec,attr) \
@ -181,8 +179,6 @@ mmu_init_table2:
.word _end
.word svcstk + INIT_ARM_STACK_SIZE
.LFile:
.asciz __FILE__
.Lmainreturned:
.asciz "main() returned"
.align 0

View file

@ -299,26 +299,20 @@ cpu_switch_load_gs:
#ifdef INVARIANTS
badsw1:
pushal
pushl $0
pushl $0
pushl $sw0_1
call __panic
call panic
sw0_1: .asciz "cpu_throw: no newthread supplied"
badsw2:
pushal
pushl $0
pushl $0
pushl $sw0_2
call __panic
call panic
sw0_2: .asciz "cpu_switch: no curthread supplied"
badsw3:
pushal
pushl $0
pushl $0
pushl $sw0_3
call __panic
call panic
sw0_3: .asciz "cpu_switch: no newthread supplied"
#endif

View file

@ -474,7 +474,7 @@ static u_int panic_cpu = NOCPU;
* MPSAFE
*/
void
__panic(const char *file, int line, const char *fmt, ...)
panic(const char *fmt, ...)
{
struct thread *td = curthread;
int bootopt, newpanic;
@ -508,11 +508,11 @@ __panic(const char *file, int line, const char *fmt, ...)
if (newpanic) {
(void)vsnprintf(buf, sizeof(buf), fmt, ap);
panicstr = buf;
printf("panic: %s\nat line %d in file %s\n", buf, line, file);
printf("panic: %s\n", buf);
} else {
printf("panic: ");
vprintf(fmt, ap);
printf("\nat line %d in file %s", line, file);
printf("\n");
}
va_end(ap);
#ifdef SMP

View file

@ -101,10 +101,8 @@
.sect .rodata ; \
9: .asciz msg ; \
.previous ; \
SET(9b, r1, %o2) ; \
clr %o1 ; \
clr %o0 ; \
call __panic ; \
SET(9b, r1, %o0) ; \
call panic ; \
nop
#ifdef INVARIANTS

View file

@ -132,13 +132,11 @@ void *hashinit(int count, struct malloc_type *type, u_long *hashmask);
void *phashinit(int count, struct malloc_type *type, u_long *nentries);
#ifdef RESTARTABLE_PANICS
void __panic(const char *file, int line, const char *, ...) __printflike(3, 4);
void panic(const char *, ...) __printflike(1, 2);
#else
void __panic(const char *file, int line, const char *, ...) __dead2 __printflike(3, 4);
void panic(const char *, ...) __dead2 __printflike(1, 2);
#endif
#define panic(...) __panic(__FILE__, __LINE__, __VA_ARGS__)
void backtrace(void);
void cpu_boot(int);
void cpu_rootconf(void);