From 1adad886b22cbd1788332c19aebfa9edd0a562dc Mon Sep 17 00:00:00 2001 From: Andrew Cagney Date: Wed, 21 Feb 2001 00:05:34 +0000 Subject: [PATCH] Fix printf fmt arguments. --- gdb/ChangeLog | 5 +++++ gdb/mips-tdep.c | 42 ++++++++++++++++++++++++++++++++---------- 2 files changed, 37 insertions(+), 10 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index f2662e23f2..5c2f674d95 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2001-02-20 Andrew Cagney + + * mips-tdep.c (do_fp_register_row, do_fp_register_row): Fix printf + formatting. + 2001-02-20 Kevin Buettner * solib-aix5.c (solib-svr4.h): Remove include. diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c index 94a255eace..569d076956 100644 --- a/gdb/mips-tdep.c +++ b/gdb/mips-tdep.c @@ -2677,12 +2677,25 @@ do_fp_register_row (int regnum) flt2 = unpack_double (builtin_type_float, raw_buffer[LO], &inv2); doub = unpack_double (builtin_type_double, dbl_buffer, &inv3); - printf_filtered (inv1 ? " %-5s: " : - " %-5s%-17.9g", REGISTER_NAME (regnum), flt1); - printf_filtered (inv2 ? " %-5s: " : - " %-5s%-17.9g", REGISTER_NAME (regnum + 1), flt2); - printf_filtered (inv3 ? " dbl: \n" : - " dbl: %-24.17g\n", doub); + printf_filtered (" %-5s", REGISTER_NAME (regnum)); + if (inv1) + printf_filtered (": "); + else + printf_filtered ("%-17.9g", flt1); + + printf_filtered (" %-5s", REGISTER_NAME (regnum + 1)); + if (inv2) + printf_filtered (": "); + else + printf_filtered ("%-17.9g", flt2); + + printf_filtered (" dbl: "); + if (inv3) + printf_filtered (""); + else + printf_filtered ("%-24.17g", doub); + printf_filtered ("\n"); + /* may want to do hex display here (future enhancement) */ regnum += 2; } @@ -2695,10 +2708,19 @@ do_fp_register_row (int regnum) &raw_buffer[HI][offset], &inv1); doub = unpack_double (builtin_type_double, dbl_buffer, &inv3); - printf_filtered (inv1 ? " %-5s: " : - " %-5s flt: %-17.9g", REGISTER_NAME (regnum), flt1); - printf_filtered (inv3 ? " dbl: \n" : - " dbl: %-24.17g\n", doub); + printf_filtered (" %-5s: ", REGISTER_NAME (regnum)); + if (inv1) + printf_filtered (""); + else + printf_filtered ("flt: %-17.9g", flt1); + + printf_filtered (" dbl: "); + if (inv3) + printf_filtered (""); + else + printf_filtered ("%-24.17g", doub); + + printf_filtered ("\n"); /* may want to do hex display here (future enhancement) */ regnum++; }