From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 117396 invoked by alias); 17 Sep 2018 15:22:12 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 116707 invoked by uid 89); 17 Sep 2018 15:22:11 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-24.4 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,KAM_NUMSUBJECT,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=H*r:0700 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 17 Sep 2018 15:22:10 +0000 Received: from svr-orw-mbx-03.mgc.mentorg.com ([147.34.90.203]) by relay1.mentorg.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-SHA384:256) id 1g1vLk-0001FZ-O1 from Sandra_Loosemore@mentor.com ; Mon, 17 Sep 2018 08:22:08 -0700 Received: from [127.0.0.1] (147.34.91.1) by svr-orw-mbx-03.mgc.mentorg.com (147.34.90.203) with Microsoft SMTP Server (TLS) id 15.0.1320.4; Mon, 17 Sep 2018 08:22:06 -0700 To: "gdb-patches@sourceware.org" , From: Sandra Loosemore Subject: [patch] add missing gcc_target_options method for nios2 Message-ID: Date: Mon, 17 Sep 2018 15:22:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------F07898BD828C6143EE724F61" X-SW-Source: 2018-09/txt/msg00581.txt.bz2 --------------F07898BD828C6143EE724F61 Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Content-length: 350 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 --------------F07898BD828C6143EE724F61 Content-Type: text/x-patch; name="gdb1.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="gdb1.patch" Content-length: 1697 commit fce4579114f47246773caa9c68969a90794ff90d Author: Sandra Loosemore Date: Sun Sep 16 14:35:43 2018 -0700 Add gcc_target_options hook for nios2. 2018-09-16 Sandra Loosemore 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 + + * nios2-tdep.c (nios2_gcc_target_options): New. + (nios2_gdb_arch_init): Install new hook. + 2018-09-16 Tom Tromey * 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 (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); --------------F07898BD828C6143EE724F61--