[PATCH 3/4] sh: Install return_with_first_hidden_param_p

Yao Qi
2012-04-18T13:18:15Z

SH specific bits.

Regression tested on sh-linux-gnu. Two fails are fixed

-FAIL: gdb.cp/bs15503.exp: print (const char *) s.substr(0,4)
-FAIL: gdb.cp/bs15503.exp: print (const char *) (s=s.substr(0,4))
+PASS: gdb.cp/bs15503.exp: print (const char *) s.substr(0,4)
+PASS: gdb.cp/bs15503.exp: print (const char *) (s=s.substr(0,4))

gdb:

2012-04-16 Yao Qi <yao@codesourcery.com>

* sh-tdep.c (sh_return_with_first_hidden_param_p): New.
(sh_gdbarch_init): Install sh_return_with_first_hidden_param_p.
---
gdb/sh-tdep.c | 13 +++++++++++++
1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/gdb/sh-tdep.c b/gdb/sh-tdep.c
index 7f15191..029958d 100644
--- a/gdb/sh-tdep.c
+++ b/gdb/sh-tdep.c
@@ -2915,6 +2915,17 @@ sh_regset_from_core_section (struct gdbarch *gdbarch, const char *sect_name,

return NULL;
}
+
+/* This is the implementation of gdbarch method
+ return_with_first_hidden_param_p. */
+
+static int
+sh_return_with_first_hidden_param_p (struct gdbarch *gdbarch,
+ struct type *type)
+{
+ return 0;
+}
+
\f

static struct gdbarch *
@@ -3013,6 +3024,8 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_inner_than (gdbarch, core_addr_lessthan);

set_gdbarch_push_dummy_call (gdbarch, sh_push_dummy_call_nofpu);
+ set_gdbarch_return_with_first_hidden_param_p (gdbarch,
+ sh_return_with_first_hidden_param_p);

set_gdbarch_believe_pcc_promotion (gdbarch, 1);

--
1.7.0.4