aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbarch.c
diff options
context:
space:
mode:
authorYao Qi <yao@codesourcery.com>2012-06-08 14:24:57 +0000
committerYao Qi <yao@codesourcery.com>2012-06-08 14:24:57 +0000
commit18648a37491f7c0a459750048611bd2e83aa54bf (patch)
tree4a5d0b3c65985e5982b2cbff9c4cc0a27940014e /gdb/gdbarch.c
parent16bdd41fc61515376a944d7e81b7adcb126bcb4e (diff)
downloadgdb-18648a37491f7c0a459750048611bd2e83aa54bf.zip
gdb-18648a37491f7c0a459750048611bd2e83aa54bf.tar.gz
gdb-18648a37491f7c0a459750048611bd2e83aa54bf.tar.bz2
gdb/
* arch-utils.c (default_return_in_first_hidden_param_p): New. * arch-utils.h: Declare. * gdbarch.sh: Add return_in_first_hidden_param_p. * gdbarch.c, gdbarch.h: Regenerated. * infcall.c (call_function_by_hand): Call gdbarch_return_in_first_hidden_param_p instead of language_pass_by_reference. * m68k-tdep.c (m68k_return_in_first_hidden_param_p): New. (m68k_gdbarch_init): Install m68k_return_in_first_hidden_param_p. * sh-tdep.c (sh_return_in_first_hidden_param_p): New. (sh_gdbarch_init): Install sh_return_in_first_hidden_param_p. * tic6x-tdep.c (tic6x_push_dummy_call): Remove local variable `cplus_return_struct_by_reference'. (tic6x_return_value): Handle language cplusplus. (tic6x_return_in_first_hidden_param_p): New. (tic6x_gdbarch_init): Install tic6x_return_in_first_hidden_param_p.
Diffstat (limited to 'gdb/gdbarch.c')
-rw-r--r--gdb/gdbarch.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c
index 4d46a5d..f3d81a1 100644
--- a/gdb/gdbarch.c
+++ b/gdb/gdbarch.c
@@ -200,6 +200,7 @@ struct gdbarch
gdbarch_address_to_pointer_ftype *address_to_pointer;
gdbarch_integer_to_address_ftype *integer_to_address;
gdbarch_return_value_ftype *return_value;
+ gdbarch_return_in_first_hidden_param_p_ftype *return_in_first_hidden_param_p;
gdbarch_skip_prologue_ftype *skip_prologue;
gdbarch_skip_main_prologue_ftype *skip_main_prologue;
gdbarch_inner_than_ftype *inner_than;
@@ -368,6 +369,7 @@ struct gdbarch startup_gdbarch =
unsigned_address_to_pointer, /* address_to_pointer */
0, /* integer_to_address */
0, /* return_value */
+ default_return_in_first_hidden_param_p, /* return_in_first_hidden_param_p */
0, /* skip_prologue */
0, /* skip_main_prologue */
0, /* inner_than */
@@ -519,6 +521,7 @@ gdbarch_alloc (const struct gdbarch_info *info,
gdbarch->value_from_register = default_value_from_register;
gdbarch->pointer_to_address = unsigned_pointer_to_address;
gdbarch->address_to_pointer = unsigned_address_to_pointer;
+ gdbarch->return_in_first_hidden_param_p = default_return_in_first_hidden_param_p;
gdbarch->remote_breakpoint_from_pc = default_remote_breakpoint_from_pc;
gdbarch->memory_insert_breakpoint = default_memory_insert_breakpoint;
gdbarch->memory_remove_breakpoint = default_memory_remove_breakpoint;
@@ -665,6 +668,7 @@ 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, has predicate. */
+ /* Skip verify of return_in_first_hidden_param_p, invalid_p == 0 */
if (gdbarch->skip_prologue == 0)
fprintf_unfiltered (log, "\n\tskip_prologue");
/* Skip verify of skip_main_prologue, has predicate. */
@@ -1243,6 +1247,9 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
"gdbarch_dump: remote_register_number = <%s>\n",
host_address_to_string (gdbarch->remote_register_number));
fprintf_unfiltered (file,
+ "gdbarch_dump: return_in_first_hidden_param_p = <%s>\n",
+ host_address_to_string (gdbarch->return_in_first_hidden_param_p));
+ fprintf_unfiltered (file,
"gdbarch_dump: gdbarch_return_value_p() = %d\n",
gdbarch_return_value_p (gdbarch));
fprintf_unfiltered (file,
@@ -2555,6 +2562,23 @@ set_gdbarch_return_value (struct gdbarch *gdbarch,
gdbarch->return_value = return_value;
}
+int
+gdbarch_return_in_first_hidden_param_p (struct gdbarch *gdbarch, struct type *type)
+{
+ gdb_assert (gdbarch != NULL);
+ gdb_assert (gdbarch->return_in_first_hidden_param_p != NULL);
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_return_in_first_hidden_param_p called\n");
+ return gdbarch->return_in_first_hidden_param_p (gdbarch, type);
+}
+
+void
+set_gdbarch_return_in_first_hidden_param_p (struct gdbarch *gdbarch,
+ gdbarch_return_in_first_hidden_param_p_ftype return_in_first_hidden_param_p)
+{
+ gdbarch->return_in_first_hidden_param_p = return_in_first_hidden_param_p;
+}
+
CORE_ADDR
gdbarch_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR ip)
{