summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2002-05-16 19:08:05 +0000
committerAndrew Cagney <cagney@redhat.com>2002-05-16 19:08:05 +0000
commita08e2063b932efe324ccc57393daf8ea8e48e379 (patch)
tree9c810fc9d4187f27f8098b941f91ed3a3edd2025
parent2eb661c2c5184516c8d36d52aa9a177d3368d1a9 (diff)
downloadbinutils-gdb-a08e2063b932efe324ccc57393daf8ea8e48e379.tar.gz
regbuf->regcache
-rw-r--r--gdb/ChangeLog83
-rw-r--r--gdb/Makefile.in17
-rw-r--r--gdb/blockframe.c25
-rw-r--r--gdb/frame.h2
-rw-r--r--gdb/gdbarch.c16
-rw-r--r--gdb/gdbarch.h16
-rwxr-xr-xgdb/gdbarch.sh6
-rw-r--r--gdb/infcmd.c6
-rw-r--r--gdb/inferior.h4
-rw-r--r--gdb/infrun.c23
-rw-r--r--gdb/mi/ChangeLog6
-rw-r--r--gdb/mi/mi-main.c9
-rw-r--r--gdb/regbuf.c5
-rw-r--r--gdb/regcache.c285
-rw-r--r--gdb/regcache.h28
-rw-r--r--gdb/rs6000-tdep.c8
-rw-r--r--gdb/valops.c2
-rw-r--r--gdb/value.h4
-rw-r--r--gdb/values.c2
19 files changed, 431 insertions, 116 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 0bb5a004bc5..11bcf3d77f7 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,86 @@
+2002-05-16 Andrew Cagney <ac131313@redhat.com>
+
+
+ * blockframe.c, regbuf.c, rs6000-tdep.c: Include "regcache.h".
+
+** REMEMBER TO FIX DEPENDENCIES
+
+ * regcache.c: Update copyright.
+
+ * regbuf.c (regbuf_descr): gdbarch_data finally takes a gdbarch
+ parameter.
+
+ * rs6000-tdep.c (rs6000_extract_return_value): Update.
+ (rs6000_extract_struct_value_address): Update.
+
+ * infrun.c (write_inferior_status_register): Update.
+ (save_inferior_status): Update.
+ (discard_inferior_status): Update.
+ (build_infrun): Update.
+
+2002-05-15 Andrew Cagney <ac131313@redhat.com>
+
+ * infcmd.c: Include "regcache.h" instead of "regbuf.h".
+
+ * infrun.c (save_inferior_status): Update.
+ (struct inferior_status): Change type of stop_registers and
+ registers to `struct regcache'.
+ (restore_inferior_status):
+
+ * regcache.h (regcache_dup): Declare.
+
+ * valops.c (hand_function_call): Update.
+
+ * gdbarch.sh (struct regcache): Declare opaque.
+ (EXTRACT_STRUCT_VALUE_ADDRESS): Ditto.
+ (EXTRACT_RETURN_VALUE): Ditto.
+ * gdbarch.h, gdbarch.c: Regenerate.
+
+ * values.c (value_being_returned): Change retbuf parameter to a
+ `struct regcache'.
+
+ * inferior.h (run_stack_dummy): Change retbuf to a `struct
+ regcache'.
+ * value.h (value_being_returned): Ditto.
+
+ * infcmd.c (run_stack_dummy): Update.
+ (run_stack_dummy): Change parameter to regcache.
+
+ * infrun.c (stop_registers): Change type to ``struct regcache''.
+ * inferior.h (stop_registers): Ditto.
+
+ * regcache.c (build_regcache): Update.
+ (regcache_restore): Ditto.
+ (regcache_save): Ditto.
+ (_initialize_regcache): Swap current_regcache instead of
+ regcache_regbuf.
+
+ * blockframe.c (generic_get_saved_register):
+
+ * regcache.h (regcache_read_as_address): Declare.
+ (regcache_xfree, regcache_xmalloc):
+
+ * blockframe.c (generic_read_register_dummy): Update.
+ (generic_push_dummy_frame): Update.
+
+ * frame.h (generic_find_dummy_frame): Change return type to
+ ``struct regcache''.
+
+ * blockframe.c (struct dummy_frame): Replace regbuf with regcache.
+ (generic_find_dummy_frame): Update.
+
+ * regcache.h (struct regbuf): Delete declaration.
+ (current_regcache): Declare.
+ (struct regcache): Declare opaque.
+ (struct regbuf): Delete.
+
+ * regcache.c (regcache_write): Add regcache parameter. Only pass
+ through to target code when backed by a real target.
+ (regcache_read): Ditto.
+ (struct regcache): define.
+ (current_regcache): New global variable.
+ (regcache_regbuf): Delete.
+
2002-05-16 Richard Earnshaw <rearnsha@arm.com>
* regbuf.c (regbuf_descr): gdbarch_data() now takes a gdbarch
diff --git a/gdb/Makefile.in b/gdb/Makefile.in
index 5407285d62b..e6d43ad25af 100644
--- a/gdb/Makefile.in
+++ b/gdb/Makefile.in
@@ -530,7 +530,7 @@ SFILES = ax-general.c ax-gdb.c bcache.c blockframe.c breakpoint.c \
demangle.c dwarfread.c dwarf2read.c elfread.c environ.c eval.c \
event-loop.c event-top.c \
expprint.c f-exp.y f-lang.c f-typeprint.c f-valprint.c \
- findvar.c regcache.c regbuf.c gdbarch.c arch-utils.c gdbtypes.c \
+ findvar.c regcache.c gdbarch.c arch-utils.c gdbtypes.c \
inf-loop.c infcmd.c inflow.c infrun.c language.c \
kod.c kod-cisco.c \
ui-out.c cli-out.c \
@@ -643,7 +643,6 @@ memattr_h = memattr.h
monitor_h = monitor.h
objfiles_h = objfiles.h
parser_defs_h = parser-defs.h $(doublest_h)
-regbuf_h = regbuf.h
regcache_h = regcache.h
remote_h = remote.h
remote_utils_h = remote-utils.h $(target_h)
@@ -726,7 +725,7 @@ COMMON_OBS = version.o blockframe.o breakpoint.o findvar.o regcache.o \
gdbarch.o arch-utils.o gdbtypes.o copying.o $(DEPFILES) \
memattr.o mem-break.o target.o parse.o language.o $(YYOBJ) buildsym.o \
builtin-regs.o std-regs.o \
- signals.o regbuf.o \
+ signals.o \
kod.o kod-cisco.o \
gdb-events.o \
exec.o bcache.o objfiles.o minsyms.o maint.o demangle.o \
@@ -1300,7 +1299,7 @@ avr-tdep.o: avr-tdep.c $(defs_h) $(gdbcmd_h) $(gdbcore_h) $(inferior_h) \
bcache.o: bcache.c $(bcache_h) $(defs_h)
blockframe.o: blockframe.c $(defs_h) $(gdbcore_h) $(inferior_h) \
- $(objfiles_h) $(symfile_h) $(target_h) $(regcache_h) $(regbuf_h)
+ $(objfiles_h) $(symfile_h) $(target_h) $(regcache_h)
breakpoint.o: breakpoint.c $(defs_h) $(gdbcmd_h) $(gdbcore_h) \
$(inferior_h) $(language_h) $(target_h) $(gdbthread_h) \
@@ -1460,10 +1459,7 @@ findvar.o: findvar.c $(defs_h) $(gdbcore_h) $(inferior_h) $(target_h) \
frame.o: frame.c $(defs_h) $(frame_h) $(target_h) $(value_h) $(inferior_h) \
$(regcache_h)
-regbuf.o: regbuf.c $(defs_h) $(regbuf_h) gdb_assert.h
-
-regcache.o: regcache.c $(defs_h) $(inferior_h) $(target_h) $(regcache_h) \
- $(regbuf_h)
+regcache.o: regcache.c $(defs_h) $(inferior_h) $(target_h) $(regcache_h)
fork-child.o: fork-child.c $(gdb_wait_h) $(defs_h) $(gdbcore_h) \
$(inferior_h) $(target_h) $(terminal_h) $(gdbthread_h) $(gdb_string_h)
@@ -1679,7 +1675,7 @@ ia64-tdep.o: ia64-tdep.c $(defs_h) $(inferior_h) $(symfile_h) $(gdbcore_h) \
infcmd.o: infcmd.c $(defs_h) environ.h $(gdbcmd_h) $(gdbcore_h) \
$(inferior_h) $(target_h) $(language_h) $(symfile_h) $(gdb_string_h) \
- $(ui_out_h) $(completer_h) $(regbuf_h)
+ $(ui_out_h) $(completer_h)
inflow.o: inflow.c $(bfd_h) $(command_h) $(defs_h) $(inferior_h) \
$(target_h) $(terminal_h) $(gdbthread_h) $(gdb_string_h)
@@ -2025,8 +2021,7 @@ rs6000-nat.o: rs6000-nat.c $(bfd_h) $(defs_h) $(inferior_h) $(target_h) \
$(gdb_stabs_h) $(regcache_h) $(arch_utils_h)
rs6000-tdep.o: rs6000-tdep.c $(defs_h) $(gdbcore_h) $(inferior_h) \
- $(target_h) ppc-tdep.h $(regcache_h) $(value_h) $(parser_defs_h) \
- $(regbuf_h)
+ $(target_h) ppc-tdep.h $(regcache_h) $(value_h) $(parser_defs_h)
s390-tdep.o: s390-tdep.c $(defs_h) $(arch_utils_h) $(frame_h) $(inferior_h) \
$(symtab_h) $(target_h) $(gdbcore_h) $(gdbcmd_h) $(symfile_h) \
diff --git a/gdb/blockframe.c b/gdb/blockframe.c
index 06d958c6ca7..477a8a3e2f5 100644
--- a/gdb/blockframe.c
+++ b/gdb/blockframe.c
@@ -34,7 +34,6 @@
#include "inferior.h" /* for read_pc */
#include "annotate.h"
#include "regcache.h"
-#include "regbuf.h"
/* Prototypes for exported functions. */
@@ -1070,7 +1069,7 @@ struct dummy_frame
CORE_ADDR fp;
CORE_ADDR sp;
CORE_ADDR top;
- struct regbuf *regbuf;
+ struct regcache *regcache;
/* Address range of the call dummy code. Look for PC in the range
[LO..HI) (after allowing for DECR_PC_AFTER_BREAK). */
@@ -1087,7 +1086,7 @@ static struct dummy_frame *dummy_frame_stack = NULL;
adjust for DECR_PC_AFTER_BREAK. This is because it is only legal
to call this function after the PC has been adjusted. */
-struct regbuf *
+struct regcache *
generic_find_dummy_frame (CORE_ADDR pc, CORE_ADDR fp)
{
struct dummy_frame *dummyframe;
@@ -1099,7 +1098,7 @@ generic_find_dummy_frame (CORE_ADDR pc, CORE_ADDR fp)
|| fp == dummyframe->sp
|| fp == dummyframe->top))
/* The frame in question lies between the saved fp and sp, inclusive */
- return dummyframe->regbuf;
+ return dummyframe->regcache;
return 0;
}
@@ -1132,10 +1131,10 @@ generic_pc_in_call_dummy (CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR fp)
CORE_ADDR
generic_read_register_dummy (CORE_ADDR pc, CORE_ADDR fp, int regno)
{
- struct regbuf *dummy_regs = generic_find_dummy_frame (pc, fp);
+ struct regcache *dummy_regs = generic_find_dummy_frame (pc, fp);
if (dummy_regs)
- return regbuf_read_as_address (dummy_regs, regno);
+ return regcache_read_as_address (dummy_regs, regno);
else
return 0;
}
@@ -1162,7 +1161,7 @@ generic_push_dummy_frame (void)
if (INNER_THAN (dummy_frame->fp, fp)) /* stale -- destroy! */
{
dummy_frame_stack = dummy_frame->next;
- regbuf_xfree (dummy_frame->regbuf);
+ regcache_xfree (dummy_frame->regcache);
xfree (dummy_frame);
dummy_frame = dummy_frame_stack;
}
@@ -1170,8 +1169,8 @@ generic_push_dummy_frame (void)
dummy_frame = dummy_frame->next;
dummy_frame = xmalloc (sizeof (struct dummy_frame));
- dummy_frame->regbuf = regbuf_xmalloc (current_gdbarch);
- regcache_save (dummy_frame->regbuf);
+ dummy_frame->regcache = regcache_xmalloc (current_gdbarch);
+ regcache_save (dummy_frame->regcache);
dummy_frame->pc = read_pc ();
dummy_frame->sp = read_sp ();
@@ -1224,10 +1223,10 @@ generic_pop_dummy_frame (void)
if (!dummy_frame)
error ("Can't pop dummy frame!");
dummy_frame_stack = dummy_frame->next;
- regcache_restore (dummy_frame->regbuf);
+ regcache_restore (dummy_frame->regcache);
flush_cached_frames ();
- regbuf_xfree (dummy_frame->regbuf);
+ regcache_xfree (dummy_frame->regcache);
xfree (dummy_frame);
}
@@ -1320,8 +1319,8 @@ generic_get_saved_register (char *raw_buffer, int *optimized, CORE_ADDR *addrp,
if (lval) /* found it in a CALL_DUMMY frame */
*lval = not_lval;
if (raw_buffer)
- regbuf_read (generic_find_dummy_frame (frame->pc, frame->frame),
- regnum, raw_buffer);
+ regcache_read (generic_find_dummy_frame (frame->pc, frame->frame),
+ regnum, raw_buffer);
return;
}
diff --git a/gdb/frame.h b/gdb/frame.h
index bd615d42053..ff9e9cfbb2a 100644
--- a/gdb/frame.h
+++ b/gdb/frame.h
@@ -268,7 +268,7 @@ extern void generic_pop_dummy_frame (void);
extern int generic_pc_in_call_dummy (CORE_ADDR pc,
CORE_ADDR sp, CORE_ADDR fp);
-extern struct regbuf *generic_find_dummy_frame (CORE_ADDR pc, CORE_ADDR fp);
+extern struct regcache *generic_find_dummy_frame (CORE_ADDR pc, CORE_ADDR fp);
extern void generic_fix_call_dummy (char *dummy, CORE_ADDR pc, CORE_ADDR fun,
int nargs, struct value **args,
diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c
index bb3dfe0f780..5c57110c444 100644
--- a/gdb/gdbarch.c
+++ b/gdb/gdbarch.c
@@ -1118,8 +1118,8 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
/* Macro might contain `[{}]' when not multi-arch */
fprintf_unfiltered (file,
"gdbarch_dump: %s # %s\n",
- "EXTRACT_RETURN_VALUE(type, regbuf, valbuf)",
- XSTRING (EXTRACT_RETURN_VALUE (type, regbuf, valbuf)));
+ "EXTRACT_RETURN_VALUE(type, regcache, valbuf)",
+ XSTRING (EXTRACT_RETURN_VALUE (type, regcache, valbuf)));
#endif
if (GDB_MULTI_ARCH)
fprintf_unfiltered (file,
@@ -1130,8 +1130,8 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
#ifdef EXTRACT_STRUCT_VALUE_ADDRESS
fprintf_unfiltered (file,
"gdbarch_dump: %s # %s\n",
- "EXTRACT_STRUCT_VALUE_ADDRESS(regbuf)",
- XSTRING (EXTRACT_STRUCT_VALUE_ADDRESS (regbuf)));
+ "EXTRACT_STRUCT_VALUE_ADDRESS(regcache)",
+ XSTRING (EXTRACT_STRUCT_VALUE_ADDRESS (regcache)));
if (GDB_MULTI_ARCH)
fprintf_unfiltered (file,
"gdbarch_dump: EXTRACT_STRUCT_VALUE_ADDRESS = 0x%08lx\n",
@@ -3754,7 +3754,7 @@ set_gdbarch_return_value_on_stack (struct gdbarch *gdbarch,
}
void
-gdbarch_extract_return_value (struct gdbarch *gdbarch, struct type *type, struct regbuf *regbuf, char *valbuf)
+gdbarch_extract_return_value (struct gdbarch *gdbarch, struct type *type, struct regcache *regcache, char *valbuf)
{
gdb_assert (gdbarch != NULL);
if (gdbarch->extract_return_value == 0)
@@ -3762,7 +3762,7 @@ gdbarch_extract_return_value (struct gdbarch *gdbarch, struct type *type, struct
"gdbarch: gdbarch_extract_return_value invalid");
if (gdbarch_debug >= 2)
fprintf_unfiltered (gdb_stdlog, "gdbarch_extract_return_value called\n");
- gdbarch->extract_return_value (type, regbuf, valbuf);
+ gdbarch->extract_return_value (type, regcache, valbuf);
}
void
@@ -3901,7 +3901,7 @@ gdbarch_extract_struct_value_address_p (struct gdbarch *gdbarch)
}
CORE_ADDR
-gdbarch_extract_struct_value_address (struct gdbarch *gdbarch, struct regbuf *regbuf)
+gdbarch_extract_struct_value_address (struct gdbarch *gdbarch, struct regcache *regcache)
{
gdb_assert (gdbarch != NULL);
if (gdbarch->extract_struct_value_address == 0)
@@ -3909,7 +3909,7 @@ gdbarch_extract_struct_value_address (struct gdbarch *gdbarch, struct regbuf *re
"gdbarch: gdbarch_extract_struct_value_address invalid");
if (gdbarch_debug >= 2)
fprintf_unfiltered (gdb_stdlog, "gdbarch_extract_struct_value_address called\n");
- return gdbarch->extract_struct_value_address (regbuf);
+ return gdbarch->extract_struct_value_address (regcache);
}
void
diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h
index a7170fbd7e5..ce3f93c0612 100644
--- a/gdb/gdbarch.h
+++ b/gdb/gdbarch.h
@@ -46,7 +46,7 @@ struct frame_info;
struct value;
struct objfile;
struct minimal_symbol;
-struct regbuf;
+struct regcache;
extern struct gdbarch *current_gdbarch;
@@ -1473,15 +1473,15 @@ extern void set_gdbarch_return_value_on_stack (struct gdbarch *gdbarch, gdbarch_
#endif
#endif
-typedef void (gdbarch_extract_return_value_ftype) (struct type *type, struct regbuf *regbuf, char *valbuf);
-extern void gdbarch_extract_return_value (struct gdbarch *gdbarch, struct type *type, struct regbuf *regbuf, char *valbuf);
+typedef void (gdbarch_extract_return_value_ftype) (struct type *type, struct regcache *regcache, char *valbuf);
+extern void gdbarch_extract_return_value (struct gdbarch *gdbarch, struct type *type, struct regcache *regcache, char *valbuf);
extern void set_gdbarch_extract_return_value (struct gdbarch *gdbarch, gdbarch_extract_return_value_ftype *extract_return_value);
#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (EXTRACT_RETURN_VALUE)
#error "Non multi-arch definition of EXTRACT_RETURN_VALUE"
#endif
#if GDB_MULTI_ARCH
#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (EXTRACT_RETURN_VALUE)
-#define EXTRACT_RETURN_VALUE(type, regbuf, valbuf) (gdbarch_extract_return_value (current_gdbarch, type, regbuf, valbuf))
+#define EXTRACT_RETURN_VALUE(type, regcache, valbuf) (gdbarch_extract_return_value (current_gdbarch, type, regcache, valbuf))
#endif
#endif
@@ -1609,18 +1609,18 @@ extern int gdbarch_extract_struct_value_address_p (struct gdbarch *gdbarch);
/* Default (function) for non- multi-arch platforms. */
#if (!GDB_MULTI_ARCH) && !defined (EXTRACT_STRUCT_VALUE_ADDRESS)
-#define EXTRACT_STRUCT_VALUE_ADDRESS(regbuf) (internal_error (__FILE__, __LINE__, "EXTRACT_STRUCT_VALUE_ADDRESS"), 0)
+#define EXTRACT_STRUCT_VALUE_ADDRESS(regcache) (internal_error (__FILE__, __LINE__, "EXTRACT_STRUCT_VALUE_ADDRESS"), 0)
#endif
-typedef CORE_ADDR (gdbarch_extract_struct_value_address_ftype) (struct regbuf *regbuf);
-extern CORE_ADDR gdbarch_extract_struct_value_address (struct gdbarch *gdbarch, struct regbuf *regbuf);
+typedef CORE_ADDR (gdbarch_extract_struct_value_address_ftype) (struct regcache *regcache);
+extern CORE_ADDR gdbarch_extract_struct_value_address (struct gdbarch *gdbarch, struct regcache *regcache);
extern void set_gdbarch_extract_struct_value_address (struct gdbarch *gdbarch, gdbarch_extract_struct_value_address_ftype *extract_struct_value_address);
#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (EXTRACT_STRUCT_VALUE_ADDRESS)
#error "Non multi-arch definition of EXTRACT_STRUCT_VALUE_ADDRESS"
#endif
#if GDB_MULTI_ARCH
#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (EXTRACT_STRUCT_VALUE_ADDRESS)
-#define EXTRACT_STRUCT_VALUE_ADDRESS(regbuf) (gdbarch_extract_struct_value_address (current_gdbarch, regbuf))
+#define EXTRACT_STRUCT_VALUE_ADDRESS(regcache) (gdbarch_extract_struct_value_address (current_gdbarch, regcache))
#endif
#endif
diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh
index 8c322c6fab3..fd5ff659c92 100755
--- a/gdb/gdbarch.sh
+++ b/gdb/gdbarch.sh
@@ -531,7 +531,7 @@ f:2:ADDRESS_TO_POINTER:void:address_to_pointer:struct type *type, void *buf, COR
F:2:INTEGER_TO_ADDRESS:CORE_ADDR:integer_to_address:struct type *type, void *buf:type, buf
#
f:2:RETURN_VALUE_ON_STACK:int:return_value_on_stack:struct type *type:type:::generic_return_value_on_stack_not::0
-f:2:EXTRACT_RETURN_VALUE:void:extract_return_value:struct type *type, struct regbuf *regbuf, char *valbuf:type, regbuf, valbuf::0:0
+f:2:EXTRACT_RETURN_VALUE:void:extract_return_value:struct type *type, struct regcache *regcache, char *valbuf:type, regcache, valbuf::0:0
f:2:PUSH_ARGUMENTS:CORE_ADDR:push_arguments:int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr:nargs, args, sp, struct_return, struct_addr:::default_push_arguments::0
f:2:PUSH_DUMMY_FRAME:void:push_dummy_frame:void:-:::0
F:2:PUSH_RETURN_ADDRESS:CORE_ADDR:push_return_address:CORE_ADDR pc, CORE_ADDR sp:pc, sp:::0
@@ -539,7 +539,7 @@ f:2:POP_FRAME:void:pop_frame:void:-:::0
#
f:2:STORE_STRUCT_RETURN:void:store_struct_return:CORE_ADDR addr, CORE_ADDR sp:addr, sp:::0
f:2:STORE_RETURN_VALUE:void:store_return_value:struct type *type, char *valbuf:type, valbuf:::0
-F:2:EXTRACT_STRUCT_VALUE_ADDRESS:CORE_ADDR:extract_struct_value_address:struct regbuf *regbuf:regbuf:::0
+F:2:EXTRACT_STRUCT_VALUE_ADDRESS:CORE_ADDR:extract_struct_value_address:struct regcache *regcache:regcache:::0
f:2:USE_STRUCT_CONVENTION:int:use_struct_convention:int gcc_p, struct type *value_type:gcc_p, value_type:::generic_use_struct_convention::0
#
f:2:FRAME_INIT_SAVED_REGS:void:frame_init_saved_regs:struct frame_info *frame:frame::0:0
@@ -765,7 +765,7 @@ struct frame_info;
struct value;
struct objfile;
struct minimal_symbol;
-struct regbuf;
+struct regcache;
extern struct gdbarch *current_gdbarch;
diff --git a/gdb/infcmd.c b/gdb/infcmd.c
index 99d86c36d56..14bb00bda49 100644
--- a/gdb/infcmd.c
+++ b/gdb/infcmd.c
@@ -40,7 +40,7 @@
#include "ui-out.h"
#include "event-top.h"
#include "parser-defs.h"
-#include "regbuf.h"
+#include "regcache.h"
/* Functions exported for general use: */
@@ -970,7 +970,7 @@ breakpoint_auto_delete_contents (PTR arg)
will eventually be popped when we do hit the dummy end breakpoint). */
int
-run_stack_dummy (CORE_ADDR addr, struct regbuf **buffer)
+run_stack_dummy (CORE_ADDR addr, struct regcache **buffer)
{
struct cleanup *old_cleanups = make_cleanup (null_cleanup, 0);
int saved_async = 0;
@@ -1043,7 +1043,7 @@ run_stack_dummy (CORE_ADDR addr, struct regbuf **buffer)
return 2;
/* On normal return, the stack dummy has been popped already. */
- *buffer = regbuf_dup (stop_registers);
+ *buffer = regcache_dup (stop_registers);
return 0;
}
diff --git a/gdb/inferior.h b/gdb/inferior.h
index 3359aca503b..c0674361593 100644
--- a/gdb/inferior.h
+++ b/gdb/inferior.h
@@ -154,7 +154,7 @@ extern void generic_mourn_inferior (void);
extern void terminal_ours (void);
-extern int run_stack_dummy (CORE_ADDR, struct regbuf **retbuf);
+extern int run_stack_dummy (CORE_ADDR, struct regcache **retbuf);
extern CORE_ADDR read_pc (void);
@@ -397,7 +397,7 @@ extern int proceed_to_finish;
Thus this contains the return value from the called function (assuming
values are returned in a register). */
-extern struct regbuf *stop_registers;
+extern struct regcache *stop_registers;
/* Nonzero if the child process in inferior_ptid was attached rather
than forked. */
diff --git a/gdb/infrun.c b/gdb/infrun.c
index 49b0506bfa4..b46779160ed 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -42,7 +42,6 @@
#include "inf-loop.h"
#include "regcache.h"
#include "value.h"
-#include "regbuf.h"
/* Prototypes for local functions */
@@ -338,7 +337,7 @@ int proceed_to_finish;
Thus this contains the return value from the called function (assuming
values are returned in a register). */
-struct regbuf *stop_registers;
+struct regcache *stop_registers;
/* Nonzero if program stopped due to error trying to insert breakpoints. */
@@ -3908,12 +3907,12 @@ struct inferior_status
int stop_after_trap;
int stop_soon_quietly;
CORE_ADDR selected_frame_address;
- struct regbuf *stop_registers;
+ struct regcache *stop_registers;
/* These are here because if call_function_by_hand has written some
registers and then decides to call error(), we better not have changed
any registers. */
- struct regbuf *registers;
+ struct regcache *registers;
int selected_level;
int breakpoint_proceeded;
@@ -3928,7 +3927,7 @@ write_inferior_status_register (struct inferior_status *inf_status, int regno,
int size = REGISTER_RAW_SIZE (regno);
void *buf = alloca (size);
store_signed_integer (buf, size, val);
- regbuf_write (inf_status->registers, regno, buf);
+ regcache_write (inf_status->registers, regno, buf);
}
/* Save all of the information associated with the inferior<==>gdb
@@ -3962,8 +3961,8 @@ save_inferior_status (int restore_stack_info)
inf_status->restore_stack_info = restore_stack_info;
inf_status->proceed_to_finish = proceed_to_finish;
- inf_status->stop_registers = regbuf_dup (stop_registers);
- inf_status->registers = regbuf_xmalloc (current_gdbarch);
+ inf_status->stop_registers = regcache_dup (stop_registers);
+ inf_status->registers = regcache_xmalloc (current_gdbarch);
regcache_save (inf_status->registers);
record_selected_frame (&(inf_status->selected_frame_address),
@@ -4029,14 +4028,14 @@ restore_inferior_status (struct inferior_status *inf_status)
proceed_to_finish = inf_status->proceed_to_finish;
/* FIXME: Is the restore of stop_registers always needed? */
- regbuf_xfree (stop_registers);
+ regcache_xfree (stop_registers);
stop_registers = inf_status->stop_registers;
/* The inferior can be gone if the user types "print exit(0)"
(and perhaps other times). */
if (target_has_execution)
regcache_restore (inf_status->registers);
- regbuf_xfree (inf_status->registers);
+ regcache_xfree (inf_status->registers);
/* FIXME: If we are being called after stopping in a function which
is called from gdb, we should not be trying to restore the
@@ -4084,8 +4083,8 @@ discard_inferior_status (struct inferior_status *inf_status)
{
/* See save_inferior_status for info on stop_bpstat. */
bpstat_clear (&inf_status->stop_bpstat);
- regbuf_xfree (inf_status->registers);
- regbuf_xfree (inf_status->stop_registers);
+ regcache_xfree (inf_status->registers);
+ regcache_xfree (inf_status->stop_registers);
xfree (inf_status);
}
@@ -4177,7 +4176,7 @@ save_inferior_ptid (void)
static void
build_infrun (void)
{
- stop_registers = regbuf_xmalloc (current_gdbarch);
+ stop_registers = regcache_xmalloc (current_gdbarch);
}
void
diff --git a/gdb/mi/ChangeLog b/gdb/mi/ChangeLog
index bbc7d4e70d2..bb529748feb 100644
--- a/gdb/mi/ChangeLog
+++ b/gdb/mi/ChangeLog
@@ -1,3 +1,9 @@
+2002-05-16 Andrew Cagney <ac131313@redhat.com>
+
+ * mi-main.c (register_changed_p): Update.
+ (setup_architecture_data): Update
+ (_initialize_mi_main): Don't call setup_architecture_data.
+
2002-05-11 Andrew Cagney <ac131313@redhat.com>
* mi-main.c: Include "regbuf.h".
diff --git a/gdb/mi/mi-main.c b/gdb/mi/mi-main.c
index a8b7e30cfaa..33f1cc723e9 100644
--- a/gdb/mi/mi-main.c
+++ b/gdb/mi/mi-main.c
@@ -56,7 +56,7 @@ struct ui_file *raw_stdout;
static char *last_async_command;
static char *previous_async_command;
static char *mi_error_message;
-static struct regbuf *old_regs;
+static struct regcache *old_regs;
extern void _initialize_mi_main (void);
static char *mi_input (char *);
@@ -372,12 +372,12 @@ register_changed_p (int regnum)
if (! frame_register_read (selected_frame, regnum, raw_buffer))
return -1;
- regbuf_read (old_regs, regnum, old_buffer);
+ regcache_read (old_regs, regnum, old_buffer);
if (memcmp (old_buffer, raw_buffer, REGISTER_RAW_SIZE (regnum)) == 0)
return 0;
/* Found a changed register. Update the buffer and return 1. */
- regbuf_write (old_regs, regnum, raw_buffer);
+ regcache_write (old_regs, regnum, raw_buffer);
return 1;
}
@@ -1471,7 +1471,7 @@ mi1_command_loop (void)
static void
setup_architecture_data (void)
{
- old_regs = regbuf_xmalloc (current_gdbarch);
+ old_regs = regcache_xmalloc (current_gdbarch);
}
static void
@@ -1497,7 +1497,6 @@ _initialize_mi_main (void)
return;
init_ui_hook = mi_init_ui;
- setup_architecture_data ();
register_gdbarch_swap (&old_regs, sizeof (old_regs), NULL);
register_gdbarch_swap (NULL, 0, setup_architecture_data);
if (event_loop_p)
diff --git a/gdb/regbuf.c b/gdb/regbuf.c
index 0ebfdd14b5b..79953540576 100644
--- a/gdb/regbuf.c
+++ b/gdb/regbuf.c
@@ -30,7 +30,7 @@ extern void _initialize_regbuf (void);
/* Per-architecture object describing the layout of a register buffer.
Computed once when the architecture is created */
-struct gdbarch_data *regbuf_data_handle;
+struct gdbarch_data *regcache_data_handle;
struct regbuf_descr
{
@@ -55,8 +55,7 @@ regbuf_descr (struct gdbarch *gdbarch)
int i;
/* FIXME: cagney/2002-05-11: gdbarch_data() should take that
``gdbarch'' as a parameter. */
- struct regbuf_descr *descr = gdbarch_data (gdbarch,
- regbuf_data_handle);
+ struct regbuf_descr *descr = gdbarch_data (gdbarch, regbuf_data_handle);
if (descr != NULL)
return descr;
diff --git a/gdb/regcache.c b/gdb/regcache.c
index 0cc0448dcc3..38f611c63c2 100644
--- a/gdb/regcache.c
+++ b/gdb/regcache.c
@@ -1,6 +1,7 @@
/* Cache and manage the values of registers for GDB, the GNU debugger.
- Copyright 1986, 1987, 1989, 1991, 1994, 1995, 1996, 1998, 2000, 2001
- Free Software Foundation, Inc.
+
+ Copyright 1986, 1987, 1989, 1991, 1994, 1995, 1996, 1998, 2000,
+ 2001, 2002 Free Software Foundation, Inc.
This file is part of GDB.
@@ -26,7 +27,6 @@
#include "gdbcmd.h"
#include "regcache.h"
#include "gdb_assert.h"
-#include "regbuf.h"
/*
* DATA STRUCTURE
@@ -34,11 +34,202 @@
* Here is the actual register cache.
*/
-/* Global structure containing the current regbuf. */
+/* Per-architecture object describing the layout of a register cache.
+ Computed once when the architecture is created */
+
+struct gdbarch_data *regcache_data_handle;
+
+struct regcache_descr
+{
+ /* The architecture this descriptor belongs to. */
+ struct gdbarch *gdbarch;
+ /* Total number of registers in the buffer. */
+ int nr_registers;
+ /* Size of the register buffer, over-allocate making room for both
+ real and pseudo-registers. */
+ /* FIXME: cagney/2002-05-11: This over-allocation shouldn't be
+ necessary. Unfortunatly, some targets store real values in
+ pseudo-registers and we want to be sure those targets don't crash
+ GDB. Once that code has been trashed this can be pruned down to
+ just raw registers. */
+ long sizeof_registers;
+ /* Offset into the register buffer for each register. */
+ long *register_offset;
+ /* Size, in bytes of the register valid array. */
+ long sizeof_register_valid_p;
+ /* Size, in ``bytes'', of a register. */
+ long *sizeof_register;
+};
+
+static struct regcache_descr *
+regcache_descr (struct gdbarch *gdbarch)
+{
+ int i;
+ struct regcache_descr *descr;
+ /* FIXME: cagney/2002-05-11: gdbarch_data() should take that
+ ``gdbarch'' as a parameter. */
+ gdb_assert (gdbarch != NULL);
+
+ descr = gdbarch_data (gdbarch, regcache_data_handle);
+ if (descr != NULL)
+ return descr;
+
+ descr = XMALLOC (struct regcache_descr);
+ descr->gdbarch = gdbarch;
+
+ /* FIXME: cagney/2002-05-11: Shouldn't be including pseudo-registers
+ in the register buffer. Unfortunatly some architectures do. */
+ descr->nr_registers = NUM_REGS + NUM_PSEUDO_REGS;
+ descr->sizeof_register_valid_p = NUM_REGS + NUM_PSEUDO_REGS;
+
+ /* FIXME: cagney/2002-05-11: Instead of using REGISTER_BYTE() this
+ code should compute the offets et.al. at runtime. This currently
+ isn't possible because some targets overlap register locations -
+ see the mess in read_register_bytes() and write_register_bytes()
+ registers. */
+ descr->sizeof_register = XCALLOC (descr->nr_registers, long);
+ descr->register_offset = XCALLOC (descr->nr_registers, long);
+ for (i = 0; i < descr->nr_registers; i++)
+ {
+ descr->register_offset[i] = REGISTER_BYTE (i);
+ descr->sizeof_register[i] = REGISTER_RAW_SIZE (i);
+ }
+
+ /* Come up with the real size of the registers buffer. */
+ descr->sizeof_registers = REGISTER_BYTES; /* OK use. */
+ for (i = 0; i < descr->nr_registers; i++)
+ {
+ long regend;
+ /* Keep extending the buffer so that there is always enough
+ space for all registers. The comparison is necessary since
+ legacy code is free to put registers in random places in the
+ buffer separated by holes. Once REGISTER_BYTE() is killed
+ this can be greatly simplified. */
+ /* FIXME: cagney/2001-12-04: This code shouldn't need to use
+ REGISTER_BYTE(). Unfortunatly, legacy code likes to lay the
+ buffer out so that certain registers just happen to overlap.
+ Ulgh! New targets use gdbarch's register read/write and
+ entirely avoid this uglyness. */
+ regend = descr->register_offset[i] + descr->sizeof_register[i];
+ if (descr->sizeof_registers < regend)
+ descr->sizeof_registers = regend;
+ }
+ set_gdbarch_data (gdbarch, regcache_data_handle, descr);
+ return descr;
+}
+
+static void
+xfree_regcache_descr (struct gdbarch *gdbarch, void *ptr)
+{
+ struct regcache_descr *descr = ptr;
+ if (descr == NULL)
+ return;
+ xfree (descr->register_offset);
+ xfree (descr->sizeof_register);
+ descr->register_offset = NULL;
+ descr->sizeof_register = NULL;
+ xfree (descr);
+}
+
+/* For moment, ``struct regcache'' is just a character buffer. */
+
+struct regcache
+{
+ struct regcache_descr *descr;
+ char *registers;
+ char *register_valid_p;
+ /* If a value isn't in the cache should the corresponding target be
+ queried for a value. */
+ int passthrough_p;
+};
+
+struct regcache *
+regcache_xmalloc (struct gdbarch *gdbarch)
+{
+ struct regcache_descr *descr;
+ struct regcache *regcache;
+ gdb_assert (gdbarch != NULL);
+ descr = regcache_descr (gdbarch);
+ regcache = XMALLOC (struct regcache);
+ regcache->descr = descr;
+ regcache->registers = XCALLOC (descr->sizeof_registers, char);
+ regcache->register_valid_p = XCALLOC (descr->sizeof_register_valid_p, char);
+ regcache->passthrough_p = 0;
+ return regcache;
+}
+
+void
+regcache_xfree (struct regcache *regcache)
+{
+ if (regcache == NULL)
+ return;
+ xfree (regcache->registers);
+ xfree (regcache->register_valid_p);
+ xfree (regcache);
+}
+
+void
+do_regcache_xfree (void *buf)
+{
+ regcache_xfree (buf);
+}
+
+struct regcache *
+regcache_xmalloc_with_cleanup (struct gdbarch *gdbarch)
+{
+ struct regcache *regcache = regcache_xmalloc (gdbarch);
+ make_cleanup (do_regcache_xfree, regcache);
+ return regcache;
+}
+
+struct regcache *
+regcache_dup (struct regcache *regcache)
+{
+ struct regcache *newbuf;
+ gdb_assert (current_regcache != NULL);
+ newbuf = regcache_xmalloc (regcache->descr->gdbarch);
+ memcpy (newbuf->registers, regcache->registers,
+ regcache->descr->sizeof_registers);
+ memcpy (newbuf->register_valid_p, regcache->register_valid_p,
+ regcache->descr->sizeof_register_valid_p);
+ return newbuf;
+}
+
+int
+regcache_valid_p (struct regcache *regcache, int regnum)
+{
+ gdb_assert (regcache != NULL);
+ gdb_assert (regnum >= 0 && regnum < regcache->descr->nr_registers);
+ return regcache->register_valid_p[regnum];
+}
+
+CORE_ADDR
+regcache_read_as_address (struct regcache *regcache, int regnum)
+{
+ char *buf;
+ gdb_assert (regcache != NULL);
+ gdb_assert (regnum >= 0 && regnum < regcache->descr->nr_registers);
+ buf = alloca (regcache->descr->sizeof_register[regnum]);
+ regcache_read (regcache, regnum, buf);
+ return extract_address (buf, regcache->descr->sizeof_register[regnum]);
+}
+
+char *
+grub_around_regcache_for_registers (struct regcache *regcache)
+{
+ return regcache->registers;
+}
+
+char *
+grub_around_regcache_for_register_valid (struct regcache *regcache)
+{
+ return regcache->register_valid_p;
+}
+
+/* Global structure containing the current regcache. */
/* FIXME: cagney/2002-05-11: The two global arrays registers[] and
register_valid[] currently point into this structure. */
-
-struct regbuf *regcache_regbuf;
+struct regcache *current_regcache;
/* NOTE: this is a write-through cache. There is no "dirty" bit for
recording if the register values have been changed (eg. by the
@@ -323,11 +514,21 @@ legacy_read_register_gen (int regnum, char *myaddr)
}
void
-regcache_read (int rawnum, char *buf)
+regcache_read (struct regcache *regcache, int regnum, char *buf)
{
- gdb_assert (rawnum >= 0 && rawnum < (NUM_REGS + NUM_PSEUDO_REGS));
- /* For moment, just use underlying legacy code. Ulgh!!! */
- legacy_read_register_gen (rawnum, buf);
+ gdb_assert (regcache != NULL && buf != NULL);
+ gdb_assert (regnum >= 0 && regnum < regcache->descr->nr_registers);
+ if (regcache->passthrough_p)
+ /* For moment, just use underlying legacy code. Ulgh!!! This
+ silently and very indirectly updates the regcache's regcache via
+ the global register_valid[]. */
+ legacy_read_register_gen (regnum, buf);
+ else
+ {
+ memcpy (buf, (regcache->registers
+ + regcache->descr->register_offset[regnum]),
+ regcache->descr->sizeof_register[regnum]);
+ }
}
void
@@ -382,11 +583,21 @@ legacy_write_register_gen (int regnum, char *myaddr)
}
void
-regcache_write (int rawnum, char *buf)
+regcache_write (struct regcache *regcache, int regnum, char *buf)
{
- gdb_assert (rawnum >= 0 && rawnum < (NUM_REGS + NUM_PSEUDO_REGS));
- /* For moment, just use underlying legacy code. Ulgh!!! */
- legacy_write_register_gen (rawnum, buf);
+ gdb_assert (regcache != NULL && buf != NULL);
+ gdb_assert (regnum >= 0 && regnum < regcache->descr->nr_registers);
+ if (regcache->passthrough_p)
+ /* For moment, just use underlying legacy code. Ulgh!!! This
+ silently and very indirectly updates the regcache's regcache via
+ the global register_valid[]. */
+ legacy_write_register_gen (regnum, buf);
+ else
+ {
+ memcpy (regcache->registers + regcache->descr->register_offset[regnum], buf,
+ regcache->descr->sizeof_register[regnum]);
+ regcache->register_valid_p[regnum] = 1;
+ }
}
void
@@ -762,40 +973,52 @@ reg_flush_command (char *command, int from_tty)
static void
build_regcache (void)
{
- regcache_regbuf = regbuf_xmalloc (current_gdbarch);
- registers = grub_around_regbuf_for_registers (regcache_regbuf);
- register_valid = grub_around_regbuf_for_register_valid (regcache_regbuf);
+ current_regcache = regcache_xmalloc (current_gdbarch);
+ current_regcache->passthrough_p = 1;
+ registers = grub_around_regcache_for_registers (current_regcache);
+ register_valid = grub_around_regcache_for_register_valid (current_regcache);
}
void
-regcache_save (struct regbuf *regbuf)
+regcache_save (struct regcache *regcache)
{
- /* FIXME: cagney/2002-05-11: This assumes that the current
- architecture and the regbuf architecture are identical. */
- char *regbuf_registers = grub_around_regbuf_for_registers (regbuf);
- char *regbuf_register_valid = grub_around_regbuf_for_register_valid (regbuf);
- memcpy (regbuf_registers, registers, REGISTER_BYTES);
- memcpy (regbuf_register_valid, register_valid, NUM_REGS + NUM_PSEUDO_REGS);
+ gdb_assert (current_regcache != NULL && regcache != NULL);
+ gdb_assert (current_regcache->descr->gdbarch == regcache->descr->gdbarch);
+ memcpy (grub_around_regcache_for_registers (regcache),
+ grub_around_regcache_for_registers (current_regcache),
+ regcache->descr->sizeof_registers);
+ memcpy (grub_around_regcache_for_register_valid (regcache),
+ grub_around_regcache_for_register_valid (current_regcache),
+ regcache->descr->sizeof_register_valid_p);
}
void
-regcache_restore (struct regbuf *regbuf)
+regcache_restore (struct regcache *regcache)
{
- char *regbuf_registers = grub_around_regbuf_for_registers (regbuf);
- write_register_bytes (0, regbuf_registers, REGISTER_BYTES);
+ char *regcache_registers;
+ gdb_assert (current_regcache != NULL && regcache != NULL);
+ gdb_assert (current_regcache->descr->gdbarch == regcache->descr->gdbarch);
+ regcache_registers = grub_around_regcache_for_registers (regcache);
+ /* NOTE: cagney, this should be regcache->sizeof_registers but,
+ again, things are screwed as it might copy pseudo registers. */
+ write_register_bytes (0, regcache_registers, REGISTER_BYTES);
}
void
-regcache_restore_no_writethrough (struct regbuf *regbuf)
+regcache_restore_no_writethrough (struct regcache *regcache)
{
- char *regbuf_registers = grub_around_regbuf_for_registers (regbuf);
- memcpy (registers, regbuf_registers, REGISTER_BYTES);
+ char *regcache_registers;
+ gdb_assert (current_regcache != NULL && regcache != NULL);
+ gdb_assert (current_regcache->descr->gdbarch == regcache->descr->gdbarch);
+ regcache_registers = grub_around_regcache_for_registers (regcache);
+ memcpy (registers, regcache_registers, REGISTER_BYTES);
}
void
_initialize_regcache (void)
{
- REGISTER_GDBARCH_SWAP (regcache_regbuf);
+ regcache_data_handle = register_gdbarch_data (NULL, xfree_regcache_descr);
+ REGISTER_GDBARCH_SWAP (current_regcache);
register_gdbarch_swap (&registers, sizeof (registers), NULL);
register_gdbarch_swap (&register_valid, sizeof (register_valid), NULL);
register_gdbarch_swap (NULL, 0, build_regcache);
diff --git a/gdb/regcache.h b/gdb/regcache.h
index 766862d5e0e..8a209d80553 100644
--- a/gdb/regcache.h
+++ b/gdb/regcache.h
@@ -1,6 +1,7 @@
/* Cache and manage the values of registers for GDB, the GNU debugger.
- Copyright 1986, 1987, 1989, 1991, 1994, 1995, 1996, 1998, 2000, 2001
- Free Software Foundation, Inc.
+
+ Copyright 1986, 1987, 1989, 1991, 1994, 1995, 1996, 1998, 2000,
+ 2001, 2002 Free Software Foundation, Inc.
This file is part of GDB.
@@ -22,13 +23,20 @@
#ifndef REGCACHE_H
#define REGCACHE_H
-struct regbuf;
+struct regcache;
+
+extern struct regcache *current_regcache;
+
+void regcache_xfree (struct regcache *regcache);
+struct regcache *regcache_xmalloc (struct gdbarch *gdbarch);
/* Transfer a raw register [0..NUM_REGS) between core-gdb and the
regcache. */
-void regcache_read (int rawnum, char *buf);
-void regcache_write (int rawnum, char *buf);
+void regcache_read (struct regcache *regcache, int rawnum, char *buf);
+void regcache_write (struct regcache *regcache, int rawnum, char *buf);
+int regcache_valid_p (struct regcache *regcache, int regnum);
+CORE_ADDR regcache_read_as_address (struct regcache *regcache, int rawnum);
/* Transfer a raw register [0..NUM_REGS) between the regcache and the
target. These functions are called by the target in response to a
@@ -53,9 +61,13 @@ extern signed char *register_valid;
write through - it is strictly for code that needs to restore the
target's registers to a previous state. */
-extern void regcache_save (struct regbuf *regbuf);
-extern void regcache_restore (struct regbuf *regbufx);
-extern void regcache_restore_no_writethrough (struct regbuf *regbufx);
+extern void regcache_save (struct regcache *regcache);
+extern void regcache_restore (struct regcache *regcache);
+extern void regcache_restore_no_writethrough (struct regcache *regcache);
+extern struct regcache *regcache_dup (struct regcache *regcache);
+
+extern char *grub_around_regcache_for_registers (struct regcache *);
+extern char *grub_around_regcache_for_register_valid (struct regcache *);
extern int register_cached (int regnum);
diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c
index c1b2060f42f..bd15da84700 100644
--- a/gdb/rs6000-tdep.c
+++ b/gdb/rs6000-tdep.c
@@ -46,7 +46,7 @@
#include "solib-svr4.h"
#include "ppc-tdep.h"
-#include "regbuf.h" /* For grub_around_regbuf_for_registers. */
+#include "regcache.h" /* For grub_around_regcache_for_registers. */
/* If the kernel has to deliver a signal, it pushes a sigcontext
structure on the stack and then calls the signal handler, passing
@@ -1145,12 +1145,12 @@ ppc_push_return_address (CORE_ADDR pc, CORE_ADDR sp)
REGBUF, and copy that return value into VALBUF in virtual format. */
static void
-rs6000_extract_return_value (struct type *valtype, struct regbuf *regs,
+rs6000_extract_return_value (struct type *valtype, struct regcache *regs,
char *valbuf)
{
int offset = 0;
struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
- char *regbuf = grub_around_regbuf_for_registers (regs);
+ char *regbuf = grub_around_regcache_for_registers (regs);
if (TYPE_CODE (valtype) == TYPE_CODE_FLT)
{
@@ -1951,7 +1951,7 @@ rs6000_store_return_value (struct type *type, char *valbuf)
as a CORE_ADDR (or an expression that can be used as one). */
static CORE_ADDR
-rs6000_extract_struct_value_address (struct regbuf *regs)
+rs6000_extract_struct_value_address (struct regcache *regs)
{
/* FIXME: cagney/2002-05-11: This global variable is just a hack! */
return rs6000_struct_return_address;
diff --git a/gdb/valops.c b/gdb/valops.c
index 408afb16279..5e51d1dd066 100644
--- a/gdb/valops.c
+++ b/gdb/valops.c
@@ -1672,7 +1672,7 @@ You must use a pointer to function type variable. Command ignored.", arg_name);
SAVE_DUMMY_FRAME_TOS (sp);
{
- struct regbuf *retbuf = NULL;
+ struct regcache *retbuf = NULL;
char *name;
struct symbol *symbol;
diff --git a/gdb/value.h b/gdb/value.h
index 4703b884162..19539b4fbc6 100644
--- a/gdb/value.h
+++ b/gdb/value.h
@@ -23,7 +23,7 @@
#if !defined (VALUE_H)
#define VALUE_H 1
-struct regbuf;
+struct regcache;
#include "doublest.h"
@@ -408,7 +408,7 @@ extern struct value *value_repeat (struct value *arg1, int count);
extern struct value *value_subscript (struct value *array, struct value *idx);
extern struct value *value_being_returned (struct type *valtype,
- struct regbuf *retbuf,
+ struct regcache *regcache,
int struct_return);
extern struct value *value_in (struct value *element, struct value *set);
diff --git a/gdb/values.c b/gdb/values.c
index 4de8a0a8a48..a799b595194 100644
--- a/gdb/values.c
+++ b/gdb/values.c
@@ -1224,7 +1224,7 @@ value_from_double (struct type *type, DOUBLEST num)
/* ARGSUSED */
struct value *
-value_being_returned (struct type *valtype, struct regbuf *retbuf,
+value_being_returned (struct type *valtype, struct regcache *retbuf,
int struct_return)
{
struct value *val;