diff --git a/sys/ddb/db_aout.c b/sys/ddb/db_aout.c index 7e146b4f6709..b704ded2d648 100644 --- a/sys/ddb/db_aout.c +++ b/sys/ddb/db_aout.c @@ -23,7 +23,7 @@ * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. * - * $Id: db_aout.c,v 1.7 1994/08/13 03:49:14 wollman Exp $ + * $Id: db_aout.c,v 1.8 1994/09/05 14:04:56 bde Exp $ */ /* @@ -172,12 +172,14 @@ X_db_search_symbol(symtab, off, strategy, diffp) if (off - sp->n_value < diff) { diff = off - sp->n_value; symp = sp; - if (diff == 0 && - (strategy == DB_STGY_PROC && - sp->n_type == (N_TEXT|N_EXT) || - strategy == DB_STGY_ANY && - (sp->n_type & N_EXT))) - break; + if (diff == 0) { + if (strategy == DB_STGY_PROC && + sp->n_type == (N_TEXT|N_EXT)) + break; + if (strategy == DB_STGY_ANY && + (sp->n_type & N_EXT)) + break; + } } else if (off - sp->n_value == diff) { if (symp == 0) @@ -225,7 +227,6 @@ X_db_line_at_pc(symtab, cursym, filename, linenum, off) db_expr_t off; { register struct nlist *sp, *ep; - register struct nlist *sym = (struct nlist *)cursym; unsigned long sodiff = -1UL, lndiff = -1UL, ln = 0; char *fname = NULL; diff --git a/sys/ddb/db_output.c b/sys/ddb/db_output.c index f2b14e4789a2..5fa5cb80b873 100644 --- a/sys/ddb/db_output.c +++ b/sys/ddb/db_output.c @@ -23,7 +23,7 @@ * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. * - * $Id: db_output.c,v 1.7 1994/08/13 03:49:21 wollman Exp $ + * $Id: db_output.c,v 1.8 1994/08/27 16:14:09 davidg Exp $ */ /* @@ -251,13 +251,14 @@ reswitch: switch (ch = *(u_char *)fmt++) { case 'b': ul = va_arg(ap, int); p = va_arg(ap, char *); - for (p = db_ksprintn(ul, *p++, NULL); ch = *p--;) - db_putchar(ch); + for (p = db_ksprintn(ul, *p++, NULL); *p;p--) + db_putchar(*p); if (!ul) break; - for (tmp = 0; n = *p++;) { + for (tmp = 0; *p;) { + n = *p++; if (ul & (1 << (n - 1))) { db_putchar(tmp ? ',' : '<'); for (; (n = *p) > ' '; ++p) @@ -285,8 +286,8 @@ reswitch: switch (ch = *(u_char *)fmt++) { if (!ladjust && width > 0) while (width--) db_putchar (padc); - while (ch = *p++) - db_putchar(ch); + for (;*p;p++) + db_putchar(*p); if (ladjust && width > 0) while (width--) db_putchar (padc); @@ -361,8 +362,8 @@ number: p = (char *)db_ksprintn(ul, base, &tmp); while (width--) db_putchar(padc); - while (ch = *p--) - db_putchar(ch); + for (;*p;p--) + db_putchar(*p); break; default: db_putchar('%'); diff --git a/sys/ddb/db_output.h b/sys/ddb/db_output.h index 3969a3450ec4..2ce3a5ec8e0f 100644 --- a/sys/ddb/db_output.h +++ b/sys/ddb/db_output.h @@ -23,7 +23,7 @@ * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. * - * $Id: db_output.h,v 1.3 1993/11/07 17:39:24 wollman Exp $ + * $Id: db_output.h,v 1.4 1993/11/25 01:30:09 wollman Exp $ */ #ifndef _DDB_DB_OUTPUT_H_ @@ -41,4 +41,5 @@ extern void db_force_whitespace(); extern int db_print_position(); extern void db_end_line(); +extern void db_printf(char *,...); #endif /* _DDB_DB_OUTPUT_H_ */ diff --git a/sys/ddb/db_print.c b/sys/ddb/db_print.c index a0694b0c27c3..e9a9fd3e0181 100644 --- a/sys/ddb/db_print.c +++ b/sys/ddb/db_print.c @@ -23,7 +23,7 @@ * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. * - * $Id: db_print.c,v 1.4 1994/08/13 03:49:21 wollman Exp $ + * $Id: db_print.c,v 1.5 1994/08/18 22:34:25 wollman Exp $ */ /* @@ -47,7 +47,6 @@ void db_show_regs(db_expr_t dummy1, int dummy2, db_expr_t dummy3, char *dummy4) { - int (*func)(); register struct db_variable *regp; db_expr_t value, offset; char * name; diff --git a/sys/ddb/db_sym.c b/sys/ddb/db_sym.c index 5588c77671b8..0fd37f4a0c20 100644 --- a/sys/ddb/db_sym.c +++ b/sys/ddb/db_sym.c @@ -23,7 +23,7 @@ * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. * - * $Id: db_sym.c,v 1.5 1994/08/13 03:49:23 wollman Exp $ + * $Id: db_sym.c,v 1.6 1994/08/20 03:48:26 davidg Exp $ */ /* @@ -93,15 +93,11 @@ db_qualify(sym, symtabname) { char *symname; static char tmp[256]; - register char *s; db_symbol_values(sym, &symname, 0); - s = tmp; - while (*s++ = *symtabname++) { - } - s[-1] = ':'; - while (*s++ = *symname++) { - } + strcpy(tmp,symtabname); + strcat(tmp,":"); + strcat(tmp,symname); return tmp; } @@ -176,7 +172,8 @@ db_lookup(symstr) * Return on first match. */ for (i = symtab_start; i < symtab_end; i++) { - if (sp = X_db_lookup(&db_symtabs[i], symstr)) { + sp = X_db_lookup(&db_symtabs[i], symstr); + if (sp) { db_last_symtab = &db_symtabs[i]; return sp; } diff --git a/sys/ddb/db_sym.h b/sys/ddb/db_sym.h index 9b610c591e5a..661f16b8cbf3 100644 --- a/sys/ddb/db_sym.h +++ b/sys/ddb/db_sym.h @@ -23,7 +23,7 @@ * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. * - * $Id: db_sym.h,v 1.4 1994/08/18 22:34:26 wollman Exp $ + * $Id: db_sym.h,v 1.5 1994/08/20 03:48:27 davidg Exp $ */ #ifndef _DDB_DB_SYM_H_ @@ -97,6 +97,6 @@ extern int db_eqname(/* char*, char*, char */); extern void db_printsym(/* db_expr_t, db_strategy_t */); /* print closest symbol to a value */ extern boolean_t db_line_at_pc(db_sym_t, char **, int *, db_expr_t); -extern int X_db_sym_nymargs(db_symtab_t *, db_sym_t, int *, char **); +extern int X_db_sym_numargs(db_symtab_t *, db_sym_t, int *, char **); #endif /* _DDB_DB_SYM_H_ */ diff --git a/sys/ddb/db_variables.c b/sys/ddb/db_variables.c index 4a6acf2f6182..b803e5b34628 100644 --- a/sys/ddb/db_variables.c +++ b/sys/ddb/db_variables.c @@ -23,7 +23,7 @@ * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. * - * $Id: db_variables.c,v 1.4 1994/08/13 03:49:25 wollman Exp $ + * $Id: db_variables.c,v 1.5 1994/08/18 22:34:27 wollman Exp $ */ /* @@ -134,7 +134,6 @@ void db_set_cmd(db_expr_t dummy1, int dummy2, db_expr_t dummy3, char *dummy4) { db_expr_t value; - int (*func)(); struct db_variable *vp; int t;