From patchwork Sun Nov 23 19:28:54 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kratochvil X-Patchwork-Id: 3873 Received: (qmail 23066 invoked by alias); 23 Nov 2014 19:28:58 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 23023 invoked by uid 89); 23 Nov 2014 19:28:58 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-4.0 required=5.0 tests=AWL, BAYES_00, SPF_HELO_PASS, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Sun, 23 Nov 2014 19:28:57 +0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id sANJStwY009885 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Sun, 23 Nov 2014 14:28:55 -0500 Received: from host1.jankratochvil.net (ovpn-116-31.ams2.redhat.com [10.36.116.31]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id sANJSsZt016663 for ; Sun, 23 Nov 2014 14:28:55 -0500 Subject: [PATCH v4 13/14] add s390_gcc_target_options From: Jan Kratochvil To: gdb-patches@sourceware.org Date: Sun, 23 Nov 2014 20:28:54 +0100 Message-ID: <20141123192854.32193.13344.stgit@host1.jankratochvil.net> In-Reply-To: <20141123192713.32193.57150.stgit@host1.jankratochvil.net> References: <20141123192713.32193.57150.stgit@host1.jankratochvil.net> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-IsSubscribed: yes This adds s390_gcc_target_options, an implementation of the new "gcc_target_options" gdbarch method. This was needed because the default implementation of the method doesn't work properly for S390, as this architecture needs "-m31" rather than "-m32". 2014-10-07 Jan Kratochvil * s390-linux-tdep.c (s390_gcc_target_options): New function. (s390_gdbarch_init): Add it to gdbarch. --- gdb/ChangeLog | 5 +++++ gdb/s390-linux-tdep.c | 9 +++++++++ 2 files changed, 14 insertions(+) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 114fa0f..830593f 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,10 @@ 2014-10-07 Jan Kratochvil + * s390-linux-tdep.c (s390_gcc_target_options): New function. + (s390_gdbarch_init): Add it to gdbarch. + +2014-10-07 Jan Kratochvil + * linux-tdep.c: Include objfiles.h and infcall.h. (GDB_MMAP_MAP_PRIVATE, GDB_MMAP_MAP_ANONYMOUS, linux_infcall_mmap): New function. diff --git a/gdb/s390-linux-tdep.c b/gdb/s390-linux-tdep.c index b5d94ce..5dcf40c 100644 --- a/gdb/s390-linux-tdep.c +++ b/gdb/s390-linux-tdep.c @@ -2808,6 +2808,14 @@ s390_address_class_name_to_type_flags (struct gdbarch *gdbarch, return 0; } +/* Implement gdbarch_gcc_target_options. GCC does not know "-m32". */ + +static char * +s390_gcc_target_options (struct gdbarch *gdbarch) +{ + return xstrdup ("-m31"); +} + /* Implementation of `gdbarch_stap_is_single_operand', as defined in gdbarch.h. */ @@ -3104,6 +3112,7 @@ s390_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) { case ABI_LINUX_S390: set_gdbarch_addr_bits_remove (gdbarch, s390_addr_bits_remove); + set_gdbarch_gcc_target_options (gdbarch, s390_gcc_target_options); set_solib_svr4_fetch_link_map_offsets (gdbarch, svr4_ilp32_fetch_link_map_offsets);