public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Sandra Loosemore <sandra@codesourcery.com>
To: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>,
	<qiyao@sourceware.org>
Subject: [patch] add missing gcc_target_options method for nios2
Date: Mon, 17 Sep 2018 15:22:00 -0000	[thread overview]
Message-ID: <a653fe61-50ea-920d-bab4-95b77c6d4b1b@codesourcery.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 350 bytes --]

While looking at gdb.compile test failures on nios2, I found that it was 
passing an invalid option to gcc, due to another missing target method. 
This patch doesn't make the "compile" command work for me yet (see PRs 
23671 and 23672 that I filed last night) but it seems like something 
that will be necessary to get there.  OK to commit?

-Sandra

[-- Attachment #2: gdb1.patch --]
[-- Type: text/x-patch, Size: 1697 bytes --]

commit fce4579114f47246773caa9c68969a90794ff90d
Author: Sandra Loosemore <sandra@codesourcery.com>
Date:   Sun Sep 16 14:35:43 2018 -0700

    Add gcc_target_options hook for nios2.
    
    2018-09-16  Sandra Loosemore  <sandra@codesourcery.com>
    
    	gdb/
    	* nios2-tdep.c (nios2_gcc_target_options): New.
    	(nios2_gdb_arch_init): Install new hook.

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index d36f6cd..8174fe8 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2018-09-16  Sandra Loosemore  <sandra@codesourcery.com>
+
+	* nios2-tdep.c (nios2_gcc_target_options): New.
+	(nios2_gdb_arch_init): Install new hook.
+
 2018-09-16  Tom Tromey  <tom@tromey.com>
 
 	* python/python-internal.h (CPYCHECKER_RETURNS_BORROWED_REF):
diff --git a/gdb/nios2-tdep.c b/gdb/nios2-tdep.c
index eb5285a..008b1d4 100644
--- a/gdb/nios2-tdep.c
+++ b/gdb/nios2-tdep.c
@@ -2239,6 +2239,14 @@ nios2_type_align (struct gdbarch *gdbarch, struct type *type)
   return std::min<ULONGEST> (4, TYPE_LENGTH (type));
 }
 
+/* Implement the gcc_target_options gdbarch method.  */
+static char *
+nios2_gcc_target_options (struct gdbarch *gdbarch)
+{
+  /* GCC doesn't know "-m32".  */
+  return NULL;
+}
+
 /* Initialize the Nios II gdbarch.  */
 
 static struct gdbarch *
@@ -2344,6 +2352,9 @@ nios2_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   /* Single stepping.  */
   set_gdbarch_software_single_step (gdbarch, nios2_software_single_step);
 
+  /* Target options for compile.  */
+  set_gdbarch_gcc_target_options (gdbarch, nios2_gcc_target_options);
+
   /* Hook in ABI-specific overrides, if they have been registered.  */
   gdbarch_init_osabi (info, gdbarch);
 

             reply	other threads:[~2018-09-17 15:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-17 15:22 Sandra Loosemore [this message]
2018-09-18 19:16 ` Tom Tromey
2018-09-18 19:36   ` Sandra Loosemore

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=a653fe61-50ea-920d-bab4-95b77c6d4b1b@codesourcery.com \
    --to=sandra@codesourcery.com \
    --cc=gdb-patches@sourceware.org \
    --cc=qiyao@sourceware.org \
    /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).