From 7b83296f2249f4252acecdc5af64595d66daadbd Mon Sep 17 00:00:00 2001 From: Andrew Cagney Date: Sat, 1 Mar 2003 17:03:19 +0000 Subject: [PATCH] 2003-03-01 Andrew Cagney * Makefile.in (ax-gdb.o): Update dependencies. * ax-gdb.c: Include "regcache.h". (gen_expr): Use register_type instead of REGISTER_VIRTUAL_TYPE. * findvar.c (value_of_register): Ditto. * infcmd.c (default_print_registers_info): Ditto. Index: mi/ChangeLog 2003-03-01 Andrew Cagney * mi-main.c (get_register): Use register_type instead of REGISTER_VIRTUAL_TYPE. --- gdb/ChangeLog | 8 ++++++++ gdb/Makefile.in | 3 ++- gdb/ax-gdb.c | 3 ++- gdb/findvar.c | 6 +++--- gdb/infcmd.c | 12 ++++++------ gdb/mi/ChangeLog | 5 +++++ gdb/mi/mi-main.c | 5 +++-- 7 files changed, 29 insertions(+), 13 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 70e0be5e8f2..6048ffb2ff2 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,11 @@ +2003-03-01 Andrew Cagney + + * Makefile.in (ax-gdb.o): Update dependencies. + * ax-gdb.c: Include "regcache.h". + (gen_expr): Use register_type instead of REGISTER_VIRTUAL_TYPE. + * findvar.c (value_of_register): Ditto. + * infcmd.c (default_print_registers_info): Ditto. + 2003-03-01 Mark Kettenis * i386-linux-tdep.c (find_minsym_and_objfile): Replace usage of diff --git a/gdb/Makefile.in b/gdb/Makefile.in index c63f2fb69a0..e0e812e1372 100644 --- a/gdb/Makefile.in +++ b/gdb/Makefile.in @@ -1530,7 +1530,8 @@ avr-tdep.o: avr-tdep.c $(defs_h) $(gdbcmd_h) $(gdbcore_h) $(inferior_h) \ $(symfile_h) $(arch_utils_h) $(regcache_h) $(gdb_string_h) ax-gdb.o: ax-gdb.c $(defs_h) $(symtab_h) $(symfile_h) $(gdbtypes_h) \ $(value_h) $(expression_h) $(command_h) $(gdbcmd_h) $(frame_h) \ - $(target_h) $(ax_h) $(ax_gdb_h) $(gdb_string_h) $(block_h) + $(target_h) $(ax_h) $(ax_gdb_h) $(gdb_string_h) $(block_h) \ + $(regcache_h) ax-general.o: ax-general.c $(defs_h) $(ax_h) $(value_h) $(gdb_string_h) bcache.o: bcache.c $(defs_h) $(gdb_obstack_h) $(bcache_h) $(gdb_string_h) block.o: block.c $(defs_h) $(block_h) $(symtab_h) $(symfile_h) diff --git a/gdb/ax-gdb.c b/gdb/ax-gdb.c index 253636973d5..5692c35f990 100644 --- a/gdb/ax-gdb.c +++ b/gdb/ax-gdb.c @@ -34,6 +34,7 @@ #include "ax-gdb.h" #include "gdb_string.h" #include "block.h" +#include "regcache.h" /* To make sense of this file, you should read doc/agentexpr.texi. Then look at the types and enums in ax-gdb.h. For the code itself, @@ -1595,7 +1596,7 @@ gen_expr (union exp_element **pc, struct agent_expr *ax, (*pc) += 3; value->kind = axs_lvalue_register; value->u.reg = reg; - value->type = REGISTER_VIRTUAL_TYPE (reg); + value->type = register_type (current_gdbarch, reg); } break; diff --git a/gdb/findvar.c b/gdb/findvar.c index 973b99017f0..3147126a75b 100644 --- a/gdb/findvar.c +++ b/gdb/findvar.c @@ -288,7 +288,7 @@ store_typed_address (void *buf, struct type *type, CORE_ADDR addr) /* Return a `value' with the contents of (virtual or cooked) register REGNUM as found in the specified FRAME. The register's type is - determined by REGISTER_VIRTUAL_TYPE. + determined by register_type(). NOTE: returns NULL if register value is not available. Caller will check return value or die! */ @@ -320,13 +320,13 @@ value_of_register (int regnum, struct frame_info *frame) if (register_cached (regnum) < 0) return NULL; /* register value not available */ - reg_val = allocate_value (REGISTER_VIRTUAL_TYPE (regnum)); + reg_val = allocate_value (register_type (current_gdbarch, regnum)); /* Convert raw data to virtual format if necessary. */ if (REGISTER_CONVERTIBLE (regnum)) { - REGISTER_CONVERT_TO_VIRTUAL (regnum, REGISTER_VIRTUAL_TYPE (regnum), + REGISTER_CONVERT_TO_VIRTUAL (regnum, register_type (current_gdbarch, regnum), raw_buffer, VALUE_CONTENTS_RAW (reg_val)); } else if (REGISTER_RAW_SIZE (regnum) == REGISTER_VIRTUAL_SIZE (regnum)) diff --git a/gdb/infcmd.c b/gdb/infcmd.c index 0bdfc6ce2ad..19077b4a54d 100644 --- a/gdb/infcmd.c +++ b/gdb/infcmd.c @@ -1665,7 +1665,7 @@ default_print_registers_info (struct gdbarch *gdbarch, /* Convert raw data to virtual format if necessary. */ if (REGISTER_CONVERTIBLE (i)) { - REGISTER_CONVERT_TO_VIRTUAL (i, REGISTER_VIRTUAL_TYPE (i), + REGISTER_CONVERT_TO_VIRTUAL (i, register_type (current_gdbarch, i), raw_buffer, virtual_buffer); } else @@ -1676,11 +1676,11 @@ default_print_registers_info (struct gdbarch *gdbarch, /* If virtual format is floating, print it that way, and in raw hex. */ - if (TYPE_CODE (REGISTER_VIRTUAL_TYPE (i)) == TYPE_CODE_FLT) + if (TYPE_CODE (register_type (current_gdbarch, i)) == TYPE_CODE_FLT) { int j; - val_print (REGISTER_VIRTUAL_TYPE (i), virtual_buffer, 0, 0, + val_print (register_type (current_gdbarch, i), virtual_buffer, 0, 0, file, 0, 1, 0, Val_pretty_default); fprintf_filtered (file, "\t(raw 0x"); @@ -1698,14 +1698,14 @@ default_print_registers_info (struct gdbarch *gdbarch, else { /* Print the register in hex. */ - val_print (REGISTER_VIRTUAL_TYPE (i), virtual_buffer, 0, 0, + val_print (register_type (current_gdbarch, i), virtual_buffer, 0, 0, file, 'x', 1, 0, Val_pretty_default); /* If not a vector register, print it also according to its natural format. */ - if (TYPE_VECTOR (REGISTER_VIRTUAL_TYPE (i)) == 0) + if (TYPE_VECTOR (register_type (current_gdbarch, i)) == 0) { fprintf_filtered (file, "\t"); - val_print (REGISTER_VIRTUAL_TYPE (i), virtual_buffer, 0, 0, + val_print (register_type (current_gdbarch, i), virtual_buffer, 0, 0, file, 0, 1, 0, Val_pretty_default); } } diff --git a/gdb/mi/ChangeLog b/gdb/mi/ChangeLog index 6d2f685f182..a103802864e 100644 --- a/gdb/mi/ChangeLog +++ b/gdb/mi/ChangeLog @@ -1,3 +1,8 @@ +2003-03-01 Andrew Cagney + + * mi-main.c (get_register): Use register_type instead of + REGISTER_VIRTUAL_TYPE. + 2003-02-25 David Carlton * mi-cmd-stack.c: Replace all instances of SYMBOL_NAME with diff --git a/gdb/mi/mi-main.c b/gdb/mi/mi-main.c index 8a54108bca4..f08bd3f5b1c 100644 --- a/gdb/mi/mi-main.c +++ b/gdb/mi/mi-main.c @@ -534,7 +534,8 @@ get_register (int regnum, int format) if (REGISTER_CONVERTIBLE (regnum)) { - REGISTER_CONVERT_TO_VIRTUAL (regnum, REGISTER_VIRTUAL_TYPE (regnum), + REGISTER_CONVERT_TO_VIRTUAL (regnum, + register_type (current_gdbarch, regnum), raw_buffer, virtual_buffer); } else @@ -559,7 +560,7 @@ get_register (int regnum, int format) } else { - val_print (REGISTER_VIRTUAL_TYPE (regnum), virtual_buffer, 0, 0, + val_print (register_type (current_gdbarch, regnum), virtual_buffer, 0, 0, stb->stream, format, 1, 0, Val_pretty_default); ui_out_field_stream (uiout, "value", stb); ui_out_stream_delete (stb); -- 2.30.2