public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: will schmidt <will_schmidt@vnet.ibm.com>
To: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Cc: Ulrich Weigand <Ulrich.Weigand@de.ibm.com>,
	rogerio <rogealve@br.ibm.com>, "Carl E. Love" <cel@us.ibm.com>
Subject: [PATCH, rs6000] Add ppc64_linux_gcc_target_options method
Date: Tue, 27 Jul 2021 10:35:42 -0500	[thread overview]
Message-ID: <7a13098d7023cf184c25dfaacd829effb07f35c8.camel@vnet.ibm.com> (raw)

[gdb] [rs6000] Add ppc64_linux_gcc_target_options method.
    
Hi,
 Add a method to set the gcc target options for powerpc.
This change explicitly sets mcmodel=medium, which matches the gcc
default setting for this target; versus the -mcmodel=large
setting which is set by default_gcc_target_options.
    
OK for trunk?
Thanks
-Will
    
gdb/Changelog:
	yyyy-mm-dd  Will Schmidt  <will_schmidt@vnet.ibm.com>

	* gdb/rs6000-tdep.c (linux_gcc_target_options): New method.
	(rs6000_gdbarch_init):  Hook in the new method.

diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c
index 826f0266ed8..a14366e778b 100644
--- a/gdb/rs6000-tdep.c
+++ b/gdb/rs6000-tdep.c
@@ -822,10 +822,17 @@ rs6000_stack_frame_destroyed_p (struct gdbarch *gdbarch, CORE_ADDR pc)
 {
   return rs6000_in_function_epilogue_frame_p (get_current_frame (),
 					      gdbarch, pc);
 }
 
+/* Implement the linux_gcc_target_options method.  */
+static std::string
+ppc64_linux_gcc_target_options (struct gdbarch *gdbarch)
+{
+        return "-mcmodel=medium";
+}
+
 /* Get the ith function argument for the current function.  */
 static CORE_ADDR
 rs6000_fetch_pointer_argument (struct frame_info *frame, int argi, 
 			       struct type *type)
 {
@@ -7129,10 +7136,13 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   /* Trampoline.  */
   set_gdbarch_in_solib_return_trampoline
     (gdbarch, rs6000_in_solib_return_trampoline);
   set_gdbarch_skip_trampoline_code (gdbarch, rs6000_skip_trampoline_code);
 
+  /* Set GCC target options.  */
+  set_gdbarch_gcc_target_options (gdbarch, ppc64_linux_gcc_target_options);
+
   /* Hook in the DWARF CFI frame unwinder.  */
   dwarf2_append_unwinders (gdbarch);
   dwarf2_frame_set_adjust_regnum (gdbarch, rs6000_adjust_frame_regnum);
 
   /* Frame handling.  */


             reply	other threads:[~2021-07-27 15:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-27 15:35 will schmidt [this message]
2021-07-29  7:16 ` Ulrich Weigand
2021-08-03 18:56   ` will schmidt
2021-07-30 13:52 ` Tom Tromey
2021-08-05 20:43   ` [PATCH, rs6000] [V2] " will schmidt
2021-08-16 12:12     ` Ulrich Weigand

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=7a13098d7023cf184c25dfaacd829effb07f35c8.camel@vnet.ibm.com \
    --to=will_schmidt@vnet.ibm.com \
    --cc=Ulrich.Weigand@de.ibm.com \
    --cc=cel@us.ibm.com \
    --cc=gdb-patches@sourceware.org \
    --cc=rogealve@br.ibm.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).