From: "Ulrich Weigand" <uweigand@de.ibm.com>
To: mark.kettenis@xs4all.nl (Mark Kettenis)
Cc: drow@false.org, gdb-patches@sourceware.org, pedro@codesourcery.com
Subject: [commit, spu] Do not use generic_push_dummy_code
Date: Fri, 05 Sep 2008 16:19:00 -0000 [thread overview]
Message-ID: <200809051521.m85FLLNf029869@d12av02.megacenter.de.ibm.com> (raw)
In-Reply-To: <200809051410.m85EAKmN020776@brahms.sibelius.xs4all.nl> from "Mark Kettenis" at Sep 05, 2008 04:10:20 PM
Mark Kettenis wrote:
> Now you mention it, it would be nice if we could change the SPU code
> such that it doesn't use generic_push_dummy_code(). This function
> abuses frame_align(), and it would be nice if we could eliminate it.
>
> Something like i386_dicos_push_dummy_code() is needed. I can roll you
> a diff if you want, but I won't be able to test it.
No problem. The following patch adds a spu_push_dummy_code function.
If you want to eliminate generic_push_dummy_code now, that would
certainly be fine with me ...
Tested with no regressions on spu-elf.
Committed to mainline.
Bye,
Ulrich
ChangeLog:
* spu-tdep.c (spu_push_dummy_code): New function.
(spu_gdbarch_init): Install it.
Index: gdb/spu-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/spu-tdep.c,v
retrieving revision 1.39
diff -c -p -r1.39 spu-tdep.c
*** gdb/spu-tdep.c 5 Sep 2008 11:37:17 -0000 1.39
--- gdb/spu-tdep.c 5 Sep 2008 15:06:47 -0000
*************** spu_frame_align (struct gdbarch *gdbarch
*** 1032,1037 ****
--- 1032,1053 ----
return sp & ~15;
}
+ static CORE_ADDR
+ spu_push_dummy_code (struct gdbarch *gdbarch, CORE_ADDR sp, CORE_ADDR funaddr,
+ struct value **args, int nargs, struct type *value_type,
+ CORE_ADDR *real_pc, CORE_ADDR *bp_addr,
+ struct regcache *regcache)
+ {
+ /* Allocate space sufficient for a breakpoint, keeping the stack aligned. */
+ sp = (sp - 4) & ~15;
+ /* Store the address of that breakpoint */
+ *bp_addr = sp;
+ /* The call starts at the callee's entry point. */
+ *real_pc = funaddr;
+
+ return sp;
+ }
+
static int
spu_scalar_value_p (struct type *type)
{
*************** spu_gdbarch_init (struct gdbarch_info in
*** 2108,2113 ****
--- 2124,2130 ----
set_gdbarch_call_dummy_location (gdbarch, ON_STACK);
set_gdbarch_frame_align (gdbarch, spu_frame_align);
set_gdbarch_frame_red_zone_size (gdbarch, 2000);
+ set_gdbarch_push_dummy_code (gdbarch, spu_push_dummy_code);
set_gdbarch_push_dummy_call (gdbarch, spu_push_dummy_call);
set_gdbarch_dummy_id (gdbarch, spu_dummy_id);
set_gdbarch_return_value (gdbarch, spu_return_value);
--
Dr. Ulrich Weigand
GNU Toolchain for Linux on System z and Cell BE
Ulrich.Weigand@de.ibm.com
prev parent reply other threads:[~2008-09-05 16:19 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-22 17:49 [rfc] Displaced stepping with wrong entry point address Ulrich Weigand
2008-09-04 1:49 ` [ping] " Ulrich Weigand
2008-09-04 12:15 ` [rfc] " Daniel Jacobowitz
2008-09-04 19:28 ` Ulrich Weigand
2008-09-04 19:32 ` Daniel Jacobowitz
2008-09-04 20:31 ` Ulrich Weigand
2008-09-05 14:17 ` Mark Kettenis
2008-09-05 16:19 ` Ulrich Weigand [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200809051521.m85FLLNf029869@d12av02.megacenter.de.ibm.com \
--to=uweigand@de.ibm.com \
--cc=drow@false.org \
--cc=gdb-patches@sourceware.org \
--cc=mark.kettenis@xs4all.nl \
--cc=pedro@codesourcery.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox