summaryrefslogtreecommitdiff
path: root/gdb/gdbarch.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/gdbarch.c')
-rw-r--r--gdb/gdbarch.c135
1 files changed, 83 insertions, 52 deletions
diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c
index 447e3c743fd..e930642f15f 100644
--- a/gdb/gdbarch.c
+++ b/gdb/gdbarch.c
@@ -210,14 +210,15 @@ struct gdbarch
gdbarch_address_to_pointer_ftype *address_to_pointer;
gdbarch_integer_to_address_ftype *integer_to_address;
gdbarch_return_value_on_stack_ftype *return_value_on_stack;
- gdbarch_extract_return_value_ftype *extract_return_value;
- gdbarch_deprecated_extract_return_value_ftype *deprecated_extract_return_value;
gdbarch_push_arguments_ftype *push_arguments;
gdbarch_push_dummy_frame_ftype *push_dummy_frame;
gdbarch_push_return_address_ftype *push_return_address;
gdbarch_pop_frame_ftype *pop_frame;
gdbarch_store_struct_return_ftype *store_struct_return;
+ gdbarch_extract_return_value_ftype *extract_return_value;
gdbarch_store_return_value_ftype *store_return_value;
+ gdbarch_deprecated_extract_return_value_ftype *deprecated_extract_return_value;
+ gdbarch_deprecated_store_return_value_ftype *deprecated_store_return_value;
gdbarch_extract_struct_value_address_ftype *extract_struct_value_address;
gdbarch_deprecated_extract_struct_value_address_ftype *deprecated_extract_struct_value_address;
gdbarch_use_struct_convention_ftype *use_struct_convention;
@@ -412,6 +413,7 @@ struct gdbarch startup_gdbarch =
0,
0,
0,
+ 0,
generic_in_function_epilogue_p,
construct_inferior_arguments,
0,
@@ -519,8 +521,9 @@ gdbarch_alloc (const struct gdbarch_info *info,
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->extract_return_value = legacy_extract_return_value;
+ current_gdbarch->store_return_value = legacy_store_return_value;
current_gdbarch->use_struct_convention = generic_use_struct_convention;
current_gdbarch->prologue_frameless_p = generic_prologue_frameless_p;
current_gdbarch->breakpoint_from_pc = legacy_breakpoint_from_pc;
@@ -703,10 +706,6 @@ verify_gdbarch (struct gdbarch *gdbarch)
/* 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 */
- /* 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");
/* Skip verify of push_arguments, invalid_p == 0 */
if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
&& (gdbarch->push_dummy_frame == 0))
@@ -718,9 +717,8 @@ verify_gdbarch (struct gdbarch *gdbarch)
if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
&& (gdbarch->store_struct_return == 0))
fprintf_unfiltered (log, "\n\tstore_struct_return");
- if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
- && (gdbarch->store_return_value == 0))
- fprintf_unfiltered (log, "\n\tstore_return_value");
+ /* Skip verify of extract_return_value, invalid_p == 0 */
+ /* Skip verify of store_return_value, invalid_p == 0 */
/* Skip verify of extract_struct_value_address, has predicate */
/* Skip verify of deprecated_extract_struct_value_address, has predicate */
/* Skip verify of use_struct_convention, invalid_p == 0 */
@@ -1073,6 +1071,20 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
(long) current_gdbarch->deprecated_extract_struct_value_address
/*DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS ()*/);
#endif
+#ifdef DEPRECATED_STORE_RETURN_VALUE
+#if GDB_MULTI_ARCH
+ /* Macro might contain `[{}]' when not multi-arch */
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "DEPRECATED_STORE_RETURN_VALUE(type, valbuf)",
+ XSTRING (DEPRECATED_STORE_RETURN_VALUE (type, valbuf)));
+#endif
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: DEPRECATED_STORE_RETURN_VALUE = 0x%08lx\n",
+ (long) current_gdbarch->deprecated_store_return_value
+ /*DEPRECATED_STORE_RETURN_VALUE ()*/);
+#endif
#ifdef DO_REGISTERS_INFO
#if GDB_MULTI_ARCH
/* Macro might contain `[{}]' when not multi-arch */
@@ -1940,8 +1952,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",
- "STORE_RETURN_VALUE(type, valbuf)",
- XSTRING (STORE_RETURN_VALUE (type, valbuf)));
+ "STORE_RETURN_VALUE(type, regcache, valbuf)",
+ XSTRING (STORE_RETURN_VALUE (type, regcache, valbuf)));
#endif
if (GDB_MULTI_ARCH)
fprintf_unfiltered (file,
@@ -3776,44 +3788,6 @@ set_gdbarch_return_value_on_stack (struct gdbarch *gdbarch,
gdbarch->return_value_on_stack = return_value_on_stack;
}
-void
-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)
- internal_error (__FILE__, __LINE__,
- "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, regcache, valbuf);
-}
-
-void
-set_gdbarch_extract_return_value (struct gdbarch *gdbarch,
- gdbarch_extract_return_value_ftype extract_return_value)
-{
- gdbarch->extract_return_value = extract_return_value;
-}
-
-void
-gdbarch_deprecated_extract_return_value (struct gdbarch *gdbarch, struct type *type, char *regbuf, char *valbuf)
-{
- gdb_assert (gdbarch != NULL);
- if (gdbarch->deprecated_extract_return_value == 0)
- internal_error (__FILE__, __LINE__,
- "gdbarch: gdbarch_deprecated_extract_return_value invalid");
- if (gdbarch_debug >= 2)
- fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_extract_return_value called\n");
- gdbarch->deprecated_extract_return_value (type, regbuf, valbuf);
-}
-
-void
-set_gdbarch_deprecated_extract_return_value (struct gdbarch *gdbarch,
- gdbarch_deprecated_extract_return_value_ftype deprecated_extract_return_value)
-{
- gdbarch->deprecated_extract_return_value = deprecated_extract_return_value;
-}
-
CORE_ADDR
gdbarch_push_arguments (struct gdbarch *gdbarch, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr)
{
@@ -3917,7 +3891,26 @@ set_gdbarch_store_struct_return (struct gdbarch *gdbarch,
}
void
-gdbarch_store_return_value (struct gdbarch *gdbarch, struct type *type, char *valbuf)
+gdbarch_extract_return_value (struct gdbarch *gdbarch, struct type *type, struct regcache *regcache, void *valbuf)
+{
+ gdb_assert (gdbarch != NULL);
+ if (gdbarch->extract_return_value == 0)
+ internal_error (__FILE__, __LINE__,
+ "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, regcache, valbuf);
+}
+
+void
+set_gdbarch_extract_return_value (struct gdbarch *gdbarch,
+ gdbarch_extract_return_value_ftype extract_return_value)
+{
+ gdbarch->extract_return_value = extract_return_value;
+}
+
+void
+gdbarch_store_return_value (struct gdbarch *gdbarch, struct type *type, struct regcache *regcache, const void *valbuf)
{
gdb_assert (gdbarch != NULL);
if (gdbarch->store_return_value == 0)
@@ -3925,7 +3918,7 @@ gdbarch_store_return_value (struct gdbarch *gdbarch, struct type *type, char *va
"gdbarch: gdbarch_store_return_value invalid");
if (gdbarch_debug >= 2)
fprintf_unfiltered (gdb_stdlog, "gdbarch_store_return_value called\n");
- gdbarch->store_return_value (type, valbuf);
+ gdbarch->store_return_value (type, regcache, valbuf);
}
void
@@ -3935,6 +3928,44 @@ set_gdbarch_store_return_value (struct gdbarch *gdbarch,
gdbarch->store_return_value = store_return_value;
}
+void
+gdbarch_deprecated_extract_return_value (struct gdbarch *gdbarch, struct type *type, char *regbuf, char *valbuf)
+{
+ gdb_assert (gdbarch != NULL);
+ if (gdbarch->deprecated_extract_return_value == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_deprecated_extract_return_value invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_extract_return_value called\n");
+ gdbarch->deprecated_extract_return_value (type, regbuf, valbuf);
+}
+
+void
+set_gdbarch_deprecated_extract_return_value (struct gdbarch *gdbarch,
+ gdbarch_deprecated_extract_return_value_ftype deprecated_extract_return_value)
+{
+ gdbarch->deprecated_extract_return_value = deprecated_extract_return_value;
+}
+
+void
+gdbarch_deprecated_store_return_value (struct gdbarch *gdbarch, struct type *type, char *valbuf)
+{
+ gdb_assert (gdbarch != NULL);
+ if (gdbarch->deprecated_store_return_value == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_deprecated_store_return_value invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_store_return_value called\n");
+ gdbarch->deprecated_store_return_value (type, valbuf);
+}
+
+void
+set_gdbarch_deprecated_store_return_value (struct gdbarch *gdbarch,
+ gdbarch_deprecated_store_return_value_ftype deprecated_store_return_value)
+{
+ gdbarch->deprecated_store_return_value = deprecated_store_return_value;
+}
+
int
gdbarch_extract_struct_value_address_p (struct gdbarch *gdbarch)
{