Clean up usage of printf() vs db_printf(): The diagnostic messages

when symbol tables are loaded don't belong to the user interaction,
their output lines should not be counted by ddb's builtin pager.
This commit is contained in:
drochner 1997-11-30 15:49:34 +00:00
parent 123570c713
commit 9d7d537acb
2 changed files with 11 additions and 11 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: db_aout.c,v 1.17 1997/06/26 01:11:00 thorpej Exp $ */ /* $NetBSD: db_aout.c,v 1.18 1997/11/30 15:49:34 drochner Exp $ */
/* /*
* Mach Operating System * Mach Operating System
@ -114,7 +114,7 @@ X_db_sym_init(vsymtab, vesymtab, name)
(((vm_offset_t)(x) + sizeof(vm_size_t) - 1) & ~(sizeof(vm_size_t) - 1)) (((vm_offset_t)(x) + sizeof(vm_size_t) - 1) & ~(sizeof(vm_size_t) - 1))
if (round_to_size(estrtab) != round_to_size(esymtab)) { if (round_to_size(estrtab) != round_to_size(esymtab)) {
db_printf("[ %s symbol table not valid ]\n", name); printf("[ %s symbol table not valid ]\n", name);
return; return;
} }
#undef round_to_size #undef round_to_size
@ -126,7 +126,7 @@ X_db_sym_init(vsymtab, vesymtab, name)
strx = sp->n_un.n_strx; strx = sp->n_un.n_strx;
if (strx != 0) { if (strx != 0) {
if (strx > slen) { if (strx > slen) {
db_printf("Bad string table index (%#x)\n", strx); printf("Bad string table index (%#x)\n", strx);
sp->n_un.n_name = 0; sp->n_un.n_name = 0;
continue; continue;
} }
@ -137,8 +137,8 @@ X_db_sym_init(vsymtab, vesymtab, name)
if (db_add_symbol_table((char *)sym_start, (char *)sym_end, name, if (db_add_symbol_table((char *)sym_start, (char *)sym_end, name,
(char *)symtab) != -1) { (char *)symtab) != -1) {
#ifndef SYMTAB_SPACE #ifndef SYMTAB_SPACE
db_printf("[ preserving %d bytes of %s symbol table ]\n", printf("[ preserving %d bytes of %s symbol table ]\n",
esymtab - (char *)symtab, name); esymtab - (char *)symtab, name);
#endif #endif
} }
} }

View File

@ -1,4 +1,4 @@
/* $NetBSD: db_elf.c,v 1.2 1997/09/05 21:46:59 thorpej Exp $ */ /* $NetBSD: db_elf.c,v 1.3 1997/11/30 15:49:35 drochner Exp $ */
/*- /*-
* Copyright (c) 1997 The NetBSD Foundation, Inc. * Copyright (c) 1997 The NetBSD Foundation, Inc.
@ -179,20 +179,20 @@ X_db_sym_init(symtab, esymtab, name)
*/ */
if (db_add_symbol_table((char *)symtab_start, if (db_add_symbol_table((char *)symtab_start,
(char *)symtab_end, name, (char *)symtab) != -1) (char *)symtab_end, name, (char *)symtab) != -1)
db_printf("[ preserving %lu bytes of %s symbol table ]\n", printf("[ preserving %lu bytes of %s symbol table ]\n",
(u_long)roundup((esymtab - symtab), sizeof(u_long)), name); (u_long)roundup((esymtab - symtab), sizeof(u_long)), name);
return; return;
badheader: badheader:
db_printf("[ %s symbol table not valid ]\n", name); printf("[ %s symbol table not valid ]\n", name);
return; return;
multiple_strtab: multiple_strtab:
db_printf("[ %s has multiple string tables ]\n", name); printf("[ %s has multiple string tables ]\n", name);
return; return;
multiple_symtab: multiple_symtab:
db_printf("[ %s has multiple symbol tables ]\n", name); printf("[ %s has multiple symbol tables ]\n", name);
return; return;
} }