Use not-so-new printf formats %r and/or %z instead of %n and/or %+x.

This commit is contained in:
Bruce Evans 1998-07-08 10:53:58 +00:00
parent e0c38587af
commit 596dfc04ed
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=37506
9 changed files with 44 additions and 44 deletions

View File

@ -23,7 +23,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
* $Id: db_disasm.c,v 1.19 1997/02/22 09:32:12 peter Exp $
* $Id: db_disasm.c,v 1.20 1997/04/01 16:22:31 bde Exp $
*/
/*
@ -1327,43 +1327,43 @@ db_disasm(loc, altfmt)
case I:
len = db_lengths[size];
get_value_inc(imm, loc, len, FALSE);
db_printf("$%#n", imm);
db_printf("$%#r", imm);
break;
case Is:
len = db_lengths[size];
get_value_inc(imm, loc, len, FALSE);
db_printf("$%+#n", imm);
db_printf("$%+#r", imm);
break;
case Ib:
get_value_inc(imm, loc, 1, FALSE);
db_printf("$%#n", imm);
db_printf("$%#r", imm);
break;
case Iba:
get_value_inc(imm, loc, 1, FALSE);
if (imm != 0x0a)
db_printf("$%#n", imm);
db_printf("$%#r", imm);
break;
case Ibs:
get_value_inc(imm, loc, 1, TRUE);
if (size == WORD)
imm &= 0xFFFF;
db_printf("$%+#n", imm);
db_printf("$%+#r", imm);
break;
case Iw:
get_value_inc(imm, loc, 2, FALSE);
db_printf("$%#n", imm);
db_printf("$%#r", imm);
break;
case O:
len = (short_addr ? 2 : 4);
get_value_inc(displ, loc, len, FALSE);
if (seg)
db_printf("%s:%+#n",seg, displ);
db_printf("%s:%+#r",seg, displ);
else
db_printsym((db_addr_t)displ, DB_STGY_ANY);
break;
@ -1397,7 +1397,7 @@ db_disasm(loc, altfmt)
len = db_lengths[size];
get_value_inc(imm, loc, len, FALSE); /* offset */
get_value_inc(imm2, loc, 2, FALSE); /* segment */
db_printf("$%#n,%#n", imm2, imm);
db_printf("$%#r,%#r", imm2, imm);
break;
}
}

View File

@ -23,7 +23,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
* $Id: db_trace.c,v 1.28 1998/06/07 17:09:59 dfr Exp $
* $Id: db_trace.c,v 1.29 1998/07/08 09:11:43 bde Exp $
*/
#include <sys/param.h>
@ -128,7 +128,7 @@ db_print_stack_entry(name, narg, argnp, argp, callpc)
while (narg) {
if (argnp)
db_printf("%s=", *argnp++);
db_printf("%n", db_get_value((int)argp, 4, FALSE));
db_printf("%r", db_get_value((int)argp, 4, FALSE));
argp++;
if (--narg != 0)
db_printf(",");
@ -197,7 +197,7 @@ db_nextframe(fp, ip)
eip = tf->tf_eip;
ebp = tf->tf_ebp;
db_printf(
"--- trap %#n, eip = %#n, esp = %#n, ebp = %#n ---\n",
"--- trap %#r, eip = %#r, esp = %#r, ebp = %#r ---\n",
tf->tf_trapno, eip, esp, ebp);
}
break;
@ -206,7 +206,7 @@ db_nextframe(fp, ip)
eip = tf->tf_eip;
ebp = tf->tf_ebp;
db_printf(
"--- syscall %#n, eip = %#n, esp = %#n, ebp = %#n ---\n",
"--- syscall %#r, eip = %#r, esp = %#r, ebp = %#r ---\n",
tf->tf_eax, eip, esp, ebp);
}
break;
@ -216,7 +216,7 @@ db_nextframe(fp, ip)
eip = tf->tf_eip;
ebp = tf->tf_ebp;
db_printf(
"--- interrupt, eip = %#n, esp = %#n, ebp = %#n ---\n",
"--- interrupt, eip = %#r, esp = %#r, ebp = %#r ---\n",
eip, esp, ebp);
}
break;

View File

@ -23,7 +23,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
* $Id: db_command.c,v 1.26 1998/05/19 11:02:22 phk Exp $
* $Id: db_command.c,v 1.27 1998/05/19 18:42:03 phk Exp $
*/
/*
@ -530,7 +530,7 @@ db_fncall(dummy1, dummy2, dummy3, dummy4)
retval = (*func)(args[0], args[1], args[2], args[3], args[4],
args[5], args[6], args[7], args[8], args[9] );
db_printf("%#n\n", retval);
db_printf("%#r\n", retval);
}
/* Enter GDB remote protocol debugger on the next trap. */

View File

@ -23,7 +23,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
* $Id: db_examine.c,v 1.22 1998/07/05 10:10:33 dfr Exp $
* $Id: db_examine.c,v 1.23 1998/07/08 06:27:22 bde Exp $
*/
/*
@ -120,7 +120,7 @@ db_examine(addr, fmt, count)
case 'r': /* signed, current radix */
value = db_get_value(addr, size, TRUE);
addr += size;
db_printf("%+-*n", width, value);
db_printf("%+-*r", width, value);
break;
case 'x': /* unsigned hex */
value = db_get_value(addr, size, FALSE);
@ -130,7 +130,7 @@ db_examine(addr, fmt, count)
case 'z': /* signed hex */
value = db_get_value(addr, size, TRUE);
addr += size;
db_printf("%+-*x", width, value);
db_printf("%-*z", width, value);
break;
case 'd': /* signed decimal */
value = db_get_value(addr, size, TRUE);
@ -208,13 +208,13 @@ db_print_cmd(addr, have_addr, count, modif)
db_printsym((db_addr_t)addr, DB_STGY_ANY);
break;
case 'r':
db_printf("%+11ln", (long)addr);
db_printf("%+11lr", (long)addr);
break;
case 'x':
db_printf("%8lx", (unsigned long)addr);
break;
case 'z':
db_printf("%+8lx", (long)addr);
db_printf("%8lz", (long)addr);
break;
case 'd':
db_printf("%11ld", (long)addr);

View File

@ -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.21 1998/07/08 06:43:54 bde Exp $
* $Id: db_print.c,v 1.22 1998/07/08 09:11:37 bde Exp $
*/
/*
@ -53,13 +53,13 @@ db_show_regs(dummy1, dummy2, dummy3, dummy4)
for (regp = db_regs; regp < db_eregs; regp++) {
db_read_variable(regp, &value);
db_printf("%-12s%#10ln", regp->name, (unsigned long)value);
db_printf("%-12s%#10lr", regp->name, (unsigned long)value);
db_find_xtrn_sym_and_offset((db_addr_t)value, &name, &offset);
if (name != 0 && offset <= (unsigned long)db_maxoff &&
offset != value) {
db_printf("\t%s", name);
if (offset != 0)
db_printf("+%+#n", offset);
db_printf("+%+#r", offset);
}
db_printf("\n");
}

View File

@ -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.24 1998/07/08 06:43:56 bde Exp $
* $Id: db_sym.c,v 1.25 1998/07/08 09:11:38 bde Exp $
*/
/*
@ -300,16 +300,16 @@ db_printsym(off, strategy)
if (name == 0)
value = off;
if (value >= DB_SMALL_VALUE_MIN && value <= DB_SMALL_VALUE_MAX) {
db_printf("%+#ln", (long)off);
db_printf("%+#lr", (long)off);
return;
}
if (name == 0 || d >= (unsigned long)db_maxoff) {
db_printf("%#ln", (unsigned long)off);
db_printf("%#lr", (unsigned long)off);
return;
}
db_printf("%s", name);
if (d)
db_printf("+%+#n", d);
db_printf("+%+#r", d);
if (strategy == DB_STGY_PROC) {
if (db_line_at_pc(cursym, &filename, &linenum, off))
db_printf(" [%s:%d]", filename, linenum);

View File

@ -23,7 +23,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
* $Id: db_write_cmd.c,v 1.9 1997/02/22 09:28:34 peter Exp $
* $Id: db_write_cmd.c,v 1.10 1997/06/14 11:52:37 bde Exp $
*/
/*
@ -78,7 +78,7 @@ db_write_cmd(address, have_addr, count, modif)
while (db_expression(&new_value)) {
old_value = db_get_value(addr, size, FALSE);
db_printsym(addr, DB_STGY_ANY);
db_printf("\t\t%#8n\t=\t%#8n\n", old_value, new_value);
db_printf("\t\t%#8r\t=\t%#8r\n", old_value, new_value);
db_put_value(addr, size, new_value);
addr += size;

View File

@ -23,7 +23,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
* $Id: db_disasm.c,v 1.19 1997/02/22 09:32:12 peter Exp $
* $Id: db_disasm.c,v 1.20 1997/04/01 16:22:31 bde Exp $
*/
/*
@ -1327,43 +1327,43 @@ db_disasm(loc, altfmt)
case I:
len = db_lengths[size];
get_value_inc(imm, loc, len, FALSE);
db_printf("$%#n", imm);
db_printf("$%#r", imm);
break;
case Is:
len = db_lengths[size];
get_value_inc(imm, loc, len, FALSE);
db_printf("$%+#n", imm);
db_printf("$%+#r", imm);
break;
case Ib:
get_value_inc(imm, loc, 1, FALSE);
db_printf("$%#n", imm);
db_printf("$%#r", imm);
break;
case Iba:
get_value_inc(imm, loc, 1, FALSE);
if (imm != 0x0a)
db_printf("$%#n", imm);
db_printf("$%#r", imm);
break;
case Ibs:
get_value_inc(imm, loc, 1, TRUE);
if (size == WORD)
imm &= 0xFFFF;
db_printf("$%+#n", imm);
db_printf("$%+#r", imm);
break;
case Iw:
get_value_inc(imm, loc, 2, FALSE);
db_printf("$%#n", imm);
db_printf("$%#r", imm);
break;
case O:
len = (short_addr ? 2 : 4);
get_value_inc(displ, loc, len, FALSE);
if (seg)
db_printf("%s:%+#n",seg, displ);
db_printf("%s:%+#r",seg, displ);
else
db_printsym((db_addr_t)displ, DB_STGY_ANY);
break;
@ -1397,7 +1397,7 @@ db_disasm(loc, altfmt)
len = db_lengths[size];
get_value_inc(imm, loc, len, FALSE); /* offset */
get_value_inc(imm2, loc, 2, FALSE); /* segment */
db_printf("$%#n,%#n", imm2, imm);
db_printf("$%#r,%#r", imm2, imm);
break;
}
}

View File

@ -23,7 +23,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
* $Id: db_trace.c,v 1.28 1998/06/07 17:09:59 dfr Exp $
* $Id: db_trace.c,v 1.29 1998/07/08 09:11:43 bde Exp $
*/
#include <sys/param.h>
@ -128,7 +128,7 @@ db_print_stack_entry(name, narg, argnp, argp, callpc)
while (narg) {
if (argnp)
db_printf("%s=", *argnp++);
db_printf("%n", db_get_value((int)argp, 4, FALSE));
db_printf("%r", db_get_value((int)argp, 4, FALSE));
argp++;
if (--narg != 0)
db_printf(",");
@ -197,7 +197,7 @@ db_nextframe(fp, ip)
eip = tf->tf_eip;
ebp = tf->tf_ebp;
db_printf(
"--- trap %#n, eip = %#n, esp = %#n, ebp = %#n ---\n",
"--- trap %#r, eip = %#r, esp = %#r, ebp = %#r ---\n",
tf->tf_trapno, eip, esp, ebp);
}
break;
@ -206,7 +206,7 @@ db_nextframe(fp, ip)
eip = tf->tf_eip;
ebp = tf->tf_ebp;
db_printf(
"--- syscall %#n, eip = %#n, esp = %#n, ebp = %#n ---\n",
"--- syscall %#r, eip = %#r, esp = %#r, ebp = %#r ---\n",
tf->tf_eax, eip, esp, ebp);
}
break;
@ -216,7 +216,7 @@ db_nextframe(fp, ip)
eip = tf->tf_eip;
ebp = tf->tf_ebp;
db_printf(
"--- interrupt, eip = %#n, esp = %#n, ebp = %#n ---\n",
"--- interrupt, eip = %#r, esp = %#r, ebp = %#r ---\n",
eip, esp, ebp);
}
break;