This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[patch/Tcagney_regbuf-20020515-branch] merge head into branch
- From: Andrew Cagney <ac131313 at cygnus dot com>
- To: gdb-patches at sources dot redhat dot com
- Date: Sat, 15 Jun 2002 15:31:11 -0400
- Subject: [patch/Tcagney_regbuf-20020515-branch] merge head into branch
FYI,
I've merged the GDB head into the cagney_regbuf-20020515-branch. The
attached is the fixes needed after the merge.
Andrew
? bsp
? diffs
? new-gdbarch.log
? new-gdbarch.h
? new-gdbarch.c
? component
? gdbarch.log
? 2002-06-15-maint-set-internal-error
Index: ChangeLog
===================================================================
RCS file: /cvs/src/src/gdb/ChangeLog,v
retrieving revision 1.2646.2.6
diff -u -r1.2646.2.6 ChangeLog
--- ChangeLog 15 Jun 2002 16:42:49 -0000 1.2646.2.6
+++ ChangeLog 15 Jun 2002 19:22:28 -0000
@@ -1,3 +1,17 @@
+2002-06-15 Andrew Cagney <ac131313@redhat.com>
+
+ * regcache.c (regcache_descr): New function.
+ (init_legacy_regcache_descr): Replace legacy_regcache_descr.
+ (init_regcache_descr): Replace regcache_descr.
+ (_initialize_regcache): Pass init_regcache_descr to
+ register_gdbarch_data.
+
+ * arch-utils.h (legacy_extract_return_value): Declare.
+
+ * blockframe.c (generic_call_dummy_register_unwind): Use
+ deprecated_grub_regcache_for_registers to get register value.
+ * values.c (value_being_returned): Ditto. Include "regcache.h".
+
2002-05-23 Andrew Cagney <ac131313@redhat.com>
* regbuf.h, regbuf.c: Delete.
Index: arch-utils.c
===================================================================
RCS file: /cvs/src/src/gdb/arch-utils.c,v
retrieving revision 1.57.2.1
diff -u -r1.57.2.1 arch-utils.c
--- arch-utils.c 15 Jun 2002 16:42:50 -0000 1.57.2.1
+++ arch-utils.c 15 Jun 2002 19:22:29 -0000
@@ -91,6 +91,16 @@
return NULL;
}
+/* Implementation of extract return value that grubs around in the
+ register cache. */
+void
+legacy_extract_return_value (struct type *type, struct regcache *regcache,
+ char *valbuf)
+{
+ char *registers = deprecated_grub_regcache_for_registers (regcache);
+ DEPRECATED_EXTRACT_RETURN_VALUE (type, registers, valbuf);
+}
+
int
legacy_register_sim_regno (int regnum)
{
Index: arch-utils.h
===================================================================
RCS file: /cvs/src/src/gdb/arch-utils.h,v
retrieving revision 1.32.2.1
diff -u -r1.32.2.1 arch-utils.h
--- arch-utils.h 15 Jun 2002 16:42:50 -0000 1.32.2.1
+++ arch-utils.h 15 Jun 2002 19:22:29 -0000
@@ -39,6 +39,10 @@
targets that don't yet implement their own breakpoint_from_pc(). */
extern gdbarch_breakpoint_from_pc_ftype legacy_breakpoint_from_pc;
+/* Implementation of extract return value that grubs around in the
+ register cache. */
+extern gdbarch_extract_return_value_ftype legacy_extract_return_value;
+
/* Frameless functions not identifable. */
extern gdbarch_frameless_function_invocation_ftype generic_frameless_function_invocation_not;
Index: blockframe.c
===================================================================
RCS file: /cvs/src/src/gdb/blockframe.c,v
retrieving revision 1.27.4.4
diff -u -r1.27.4.4 blockframe.c
--- blockframe.c 15 Jun 2002 16:42:50 -0000 1.27.4.4
+++ blockframe.c 15 Jun 2002 19:22:30 -0000
@@ -1349,7 +1349,7 @@
/* If needed, find and return the value of the register. */
if (bufferp != NULL)
{
- char *registers;
+ struct regcache *registers;
#if 1
/* Get the address of the register buffer that contains all the
saved registers for this dummy frame. Cache that address. */
@@ -1366,7 +1366,9 @@
#endif
gdb_assert (registers != NULL);
/* Return the actual value. */
- memcpy (bufferp, registers + REGISTER_BYTE (regnum),
+ memcpy (bufferp,
+ (deprecated_grub_regcache_for_registers (registers)
+ + REGISTER_BYTE (regnum)),
REGISTER_RAW_SIZE (regnum));
}
}
Index: gdbarch.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbarch.c,v
retrieving revision 1.127.2.3
diff -u -r1.127.2.3 gdbarch.c
--- gdbarch.c 15 Jun 2002 16:42:51 -0000 1.127.2.3
+++ gdbarch.c 15 Jun 2002 19:22:32 -0000
@@ -516,6 +516,7 @@
current_gdbarch->pointer_to_address = unsigned_pointer_to_address;
current_gdbarch->address_to_pointer = unsigned_address_to_pointer;
current_gdbarch->return_value_on_stack = generic_return_value_on_stack_not;
+ current_gdbarch->extract_return_value = legacy_extract_return_value;
current_gdbarch->push_arguments = default_push_arguments;
current_gdbarch->use_struct_convention = generic_use_struct_convention;
current_gdbarch->prologue_frameless_p = generic_prologue_frameless_p;
@@ -700,9 +701,7 @@
/* Skip verify of address_to_pointer, invalid_p == 0 */
/* Skip verify of integer_to_address, has predicate */
/* Skip verify of return_value_on_stack, invalid_p == 0 */
- if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
- && (gdbarch->extract_return_value == 0))
- fprintf_unfiltered (log, "\n\textract_return_value");
+ /* Skip verify of extract_return_value, invalid_p == 0 */
if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
&& (gdbarch->deprecated_extract_return_value == 0))
fprintf_unfiltered (log, "\n\tdeprecated_extract_return_value");
Index: gdbarch.h
===================================================================
RCS file: /cvs/src/src/gdb/gdbarch.h,v
retrieving revision 1.95.2.3
diff -u -r1.95.2.3 gdbarch.h
--- gdbarch.h 15 Jun 2002 16:42:51 -0000 1.95.2.3
+++ gdbarch.h 15 Jun 2002 19:22:34 -0000
@@ -1461,6 +1461,11 @@
#endif
#endif
+/* Default (function) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (EXTRACT_RETURN_VALUE)
+#define EXTRACT_RETURN_VALUE(type, regcache, valbuf) (legacy_extract_return_value (type, regcache, valbuf))
+#endif
+
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);
Index: gdbarch.sh
===================================================================
RCS file: /cvs/src/src/gdb/gdbarch.sh,v
retrieving revision 1.138.2.3
diff -u -r1.138.2.3 gdbarch.sh
--- gdbarch.sh 15 Jun 2002 16:42:51 -0000 1.138.2.3
+++ gdbarch.sh 15 Jun 2002 19:22:40 -0000
@@ -528,7 +528,7 @@
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 regcache *regcache, char *valbuf:type, regcache, valbuf::0:0
+f:2:EXTRACT_RETURN_VALUE:void:extract_return_value:struct type *type, struct regcache *regcache, char *valbuf:type, regcache, valbuf:::legacy_extract_return_value::0
f:2:DEPRECATED_EXTRACT_RETURN_VALUE:void:deprecated_extract_return_value:struct type *type, char *regbuf, char *valbuf:type, regbuf, 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
Index: regcache.c
===================================================================
RCS file: /cvs/src/src/gdb/regcache.c,v
retrieving revision 1.36.2.5
diff -u -r1.36.2.5 regcache.c
--- regcache.c 23 May 2002 18:03:25 -0000 1.36.2.5
+++ regcache.c 15 Jun 2002 19:22:41 -0000
@@ -74,8 +74,8 @@
};
-static struct regcache_descr *
-legacy_regcache_descr (struct gdbarch *gdbarch)
+static void *
+init_legacy_regcache_descr (struct gdbarch *gdbarch)
{
int i;
struct regcache_descr *descr;
@@ -83,10 +83,6 @@
``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;
descr->legacy_p = 1;
@@ -136,23 +132,18 @@
return descr;
}
-static struct regcache_descr *
-regcache_descr (struct gdbarch *gdbarch)
+static void *
+init_regcache_descr (struct gdbarch *gdbarch)
{
int i;
struct regcache_descr *descr;
gdb_assert (gdbarch != NULL);
- /* If the value has previously been computed, just return that. */
- descr = gdbarch_data (gdbarch, regcache_data_handle);
- if (descr != NULL)
- return descr;
-
/* If an old style architecture, construct the register cache
description using all the register macros. */
if (!gdbarch_register_read_p (gdbarch)
&& !gdbarch_register_write_p (gdbarch))
- return legacy_regcache_descr (gdbarch);
+ return init_legacy_regcache_descr (gdbarch);
descr = XMALLOC (struct regcache_descr);
descr->gdbarch = gdbarch;
@@ -217,6 +208,12 @@
return descr;
}
+static struct regcache_descr *
+regcache_descr (struct gdbarch *gdbarch)
+{
+ return gdbarch_data (gdbarch, regcache_data_handle);
+}
+
static void
xfree_regcache_descr (struct gdbarch *gdbarch, void *ptr)
{
@@ -1238,7 +1235,8 @@
void
_initialize_regcache (void)
{
- regcache_data_handle = register_gdbarch_data (NULL, xfree_regcache_descr);
+ regcache_data_handle = register_gdbarch_data (init_regcache_descr,
+ xfree_regcache_descr);
REGISTER_GDBARCH_SWAP (current_regcache);
register_gdbarch_swap (®isters, sizeof (registers), NULL);
register_gdbarch_swap (®ister_valid, sizeof (register_valid), NULL);
Index: rs6000-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/rs6000-tdep.c,v
retrieving revision 1.64.2.4
diff -u -r1.64.2.4 rs6000-tdep.c
--- rs6000-tdep.c 15 Jun 2002 16:42:54 -0000 1.64.2.4
+++ rs6000-tdep.c 15 Jun 2002 19:22:44 -0000
@@ -2624,7 +2624,7 @@
set_gdbarch_register_convert_to_raw (gdbarch, rs6000_register_convert_to_raw);
set_gdbarch_stab_reg_to_regnum (gdbarch, rs6000_stab_reg_to_regnum);
- set_gdbarch_deprecated_extract_return_value (gdbarch, rs6000_extract_return_value);
+ set_gdbarch_extract_return_value (gdbarch, rs6000_extract_return_value);
/* Note: kevinb/2002-04-12: I'm not convinced that rs6000_push_arguments()
is correct for the SysV ABI when the wordsize is 8, but I'm also
@@ -2640,7 +2640,7 @@
set_gdbarch_store_struct_return (gdbarch, rs6000_store_struct_return);
set_gdbarch_store_return_value (gdbarch, rs6000_store_return_value);
- set_gdbarch_deprecated_extract_struct_value_address (gdbarch, rs6000_extract_struct_value_address);
+ set_gdbarch_extract_struct_value_address (gdbarch, rs6000_extract_struct_value_address);
set_gdbarch_pop_frame (gdbarch, rs6000_pop_frame);
set_gdbarch_skip_prologue (gdbarch, rs6000_skip_prologue);
Index: values.c
===================================================================
RCS file: /cvs/src/src/gdb/values.c,v
retrieving revision 1.35.2.3
diff -u -r1.35.2.3 values.c
--- values.c 15 Jun 2002 16:42:55 -0000 1.35.2.3
+++ values.c 15 Jun 2002 19:22:48 -0000
@@ -34,6 +34,7 @@
#include "demangle.h"
#include "doublest.h"
#include "gdb_assert.h"
+#include "regcache.h"
/* Prototypes for exported functions. */
@@ -1230,7 +1231,6 @@
struct value *val;
CORE_ADDR addr;
-#if 0
/* If this is not defined, just use EXTRACT_RETURN_VALUE instead. */
if (EXTRACT_STRUCT_VALUE_ADDRESS_P ())
if (struct_return)
@@ -1240,13 +1240,13 @@
error ("Function return value unknown.");
return value_at (valtype, addr, NULL);
}
-#endif
/* If this is not defined, just use EXTRACT_RETURN_VALUE instead. */
if (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P ())
if (struct_return)
{
- addr = DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS (retbuf);
+ char *registers = deprecated_grub_regcache_for_registers (retbuf);
+ addr = DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS (registers);
if (!addr)
error ("Function return value unknown.");
return value_at (valtype, addr, NULL);
@@ -1254,7 +1254,6 @@
val = allocate_value (valtype);
CHECK_TYPEDEF (valtype);
-#define EXTRACT_RETURN_VALUE DEPRECATED_EXTRACT_RETURN_VALUE
EXTRACT_RETURN_VALUE (valtype, retbuf, VALUE_CONTENTS_RAW (val));
return val;
Index: mi/ChangeLog
===================================================================
RCS file: /cvs/src/src/gdb/mi/ChangeLog,v
retrieving revision 1.65.4.3
diff -u -r1.65.4.3 ChangeLog
--- mi/ChangeLog 15 Jun 2002 16:43:13 -0000 1.65.4.3
+++ mi/ChangeLog 15 Jun 2002 19:22:49 -0000
@@ -1,3 +1,7 @@
+2002-06-15 Andrew Cagney <ac131313@redhat.com>
+
+ * mi-main.c: Do not include "regbuf.h".
+
2002-05-16 Andrew Cagney <ac131313@redhat.com>
* mi-main.c (register_changed_p): Update.
Index: mi/mi-main.c
===================================================================
RCS file: /cvs/src/src/gdb/mi/mi-main.c,v
retrieving revision 1.29.4.3
diff -u -r1.29.4.3 mi-main.c
--- mi/mi-main.c 15 Jun 2002 16:43:13 -0000 1.29.4.3
+++ mi/mi-main.c 15 Jun 2002 19:22:52 -0000
@@ -41,7 +41,6 @@
#include "gdb.h"
#include <ctype.h>
#include <sys/time.h>
-#include "regbuf.h"
enum
{