From eb1167c65cbe8bedb5a81796da38d394985d0dfc Mon Sep 17 00:00:00 2001 From: Jeff Law Date: Fri, 25 Mar 1994 18:21:49 +0000 Subject: [PATCH] * tm-hppa.h (NUM_REGS): Bump to 128 registers. (REGISTER_NAMES): Add entries for "right-half" of FP registers. (REGISTER_RAW_SIZE, MAX_REGISTER_RAW_SIZE): Do not treat FP regs differently. All registers are four bytes. (REGISTER_BYTES, REGISTER_BYTE): Simplify now that all registers are the same size. (REGISTER_VIRTUAL_TYPE): Use builtin_type_float for all FP regs. * hppa-tdep.c (pa_print_fp_reg): Update to print even numbered FP registers as both single and double values (fetching 2nd 32bit half as necessary). Annotate each register printed with its precision. --- gdb/ChangeLog | 12 ++++++++++++ gdb/hppa-tdep.c | 39 ++++++++++++++++++++++++++------------- 2 files changed, 38 insertions(+), 13 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 68a65855b3..565e2bcbd4 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,17 @@ Fri Mar 25 10:14:03 1994 Jeffrey A. Law (law@snake.cs.utah.edu) + * tm-hppa.h (NUM_REGS): Bump to 128 registers. + (REGISTER_NAMES): Add entries for "right-half" of FP registers. + (REGISTER_RAW_SIZE, MAX_REGISTER_RAW_SIZE): Do not treat FP regs + differently. All registers are four bytes. + (REGISTER_BYTES, REGISTER_BYTE): Simplify now that all registers are + the same size. + (REGISTER_VIRTUAL_TYPE): Use builtin_type_float for all FP regs. + + * hppa-tdep.c (pa_print_fp_reg): Update to print even numbered FP + registers as both single and double values (fetching 2nd 32bit half + as necessary). Annotate each register printed with its precision. + * paread.c (read_unwind_info): Fix off-by-one error. Fri Mar 25 08:33:28 1994 Jim Kingdon (kingdon@lioth.cygnus.com) diff --git a/gdb/hppa-tdep.c b/gdb/hppa-tdep.c index ff046f32a0..42ae0b3dc4 100644 --- a/gdb/hppa-tdep.c +++ b/gdb/hppa-tdep.c @@ -1220,27 +1220,40 @@ pa_print_fp_reg (i) unsigned char raw_buffer[MAX_REGISTER_RAW_SIZE]; unsigned char virtual_buffer[MAX_REGISTER_VIRTUAL_SIZE]; - /* Get the data in raw format. */ + /* Get 32bits of data. */ read_relative_register_raw_bytes (i, raw_buffer); - /* Convert raw data to virtual format if necessary. */ -#ifdef REGISTER_CONVERTIBLE - if (REGISTER_CONVERTIBLE (i)) - { - REGISTER_CONVERT_TO_VIRTUAL (i, REGISTER_VIRTUAL_TYPE (i), - raw_buffer, virtual_buffer); - } - else -#endif - memcpy (virtual_buffer, raw_buffer, - REGISTER_VIRTUAL_SIZE (i)); + /* Put it in the buffer. No conversions are ever necessary. */ + memcpy (virtual_buffer, raw_buffer, REGISTER_RAW_SIZE (i)); fputs_filtered (reg_names[i], gdb_stdout); - print_spaces_filtered (15 - strlen (reg_names[i]), gdb_stdout); + print_spaces_filtered (8 - strlen (reg_names[i]), gdb_stdout); + fputs_filtered ("(single precision) ", gdb_stdout); val_print (REGISTER_VIRTUAL_TYPE (i), virtual_buffer, 0, gdb_stdout, 0, 1, 0, Val_pretty_default); printf_filtered ("\n"); + + /* If "i" is even, then this register can also be a double-precision + FP register. Dump it out as such. */ + if ((i % 2) == 0) + { + /* Get the data in raw format for the 2nd half. */ + read_relative_register_raw_bytes (i + 1, raw_buffer); + + /* Copy it into the appropriate part of the virtual buffer. */ + memcpy (virtual_buffer + REGISTER_RAW_SIZE (i), raw_buffer, + REGISTER_RAW_SIZE (i)); + + /* Dump it as a double. */ + fputs_filtered (reg_names[i], gdb_stdout); + print_spaces_filtered (8 - strlen (reg_names[i]), gdb_stdout); + fputs_filtered ("(double precision) ", gdb_stdout); + + val_print (builtin_type_double, virtual_buffer, 0, gdb_stdout, 0, + 1, 0, Val_pretty_default); + printf_filtered ("\n"); + } } /* Function calls that pass into a new compilation unit must pass through a