From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23674 invoked by alias); 1 Jun 2016 09:04:04 -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 23653 invoked by uid 89); 1 Jun 2016 09:04:02 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_05,MIME_BASE64_BLANKS,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 spammy=Nicole, Deutschland, deutschland, munich X-HELO: mga01.intel.com Received: from mga01.intel.com (HELO mga01.intel.com) (192.55.52.88) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 01 Jun 2016 09:03:52 +0000 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP; 01 Jun 2016 02:03:51 -0700 X-ExtLoop1: 1 Received: from irsmsx106.ger.corp.intel.com ([163.33.3.31]) by fmsmga001.fm.intel.com with ESMTP; 01 Jun 2016 02:03:51 -0700 Received: from irsmsx104.ger.corp.intel.com ([169.254.5.117]) by IRSMSX106.ger.corp.intel.com ([169.254.8.145]) with mapi id 14.03.0248.002; Wed, 1 Jun 2016 10:03:49 +0100 From: "Metzger, Markus T" To: Yao Qi CC: "gdb-patches@sourceware.org" Subject: RE: [PATCH] infcmd, btrace: fix crash in 'finish' for tailcall-only frames Date: Wed, 01 Jun 2016 09:04:00 -0000 Message-ID: References: <1464680165-29696-1-git-send-email-markus.t.metzger@intel.com> <86h9ddxpft.fsf@gmail.com> In-Reply-To: <86h9ddxpft.fsf@gmail.com> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 X-IsSubscribed: yes X-SW-Source: 2016-06/txt/msg00010.txt.bz2 PiAtLS0tLU9yaWdpbmFsIE1lc3NhZ2UtLS0tLQ0KPiBGcm9tOiBZYW8gUWkg W21haWx0bzpxaXlhb2x0Y0BnbWFpbC5jb21dDQo+IFNlbnQ6IFdlZG5lc2Rh eSwgSnVuZSAxLCAyMDE2IDEwOjUxIEFNDQo+IFRvOiBNZXR6Z2VyLCBNYXJr dXMgVCA8bWFya3VzLnQubWV0emdlckBpbnRlbC5jb20+DQo+IENjOiBnZGIt cGF0Y2hlc0Bzb3VyY2V3YXJlLm9yZw0KPiBTdWJqZWN0OiBSZTogW1BBVENI XSBpbmZjbWQsIGJ0cmFjZTogZml4IGNyYXNoIGluICdmaW5pc2gnIGZvciB0 YWlsY2FsbC1vbmx5IGZyYW1lcw0KPiANCj4gTWFya3VzIE1ldHpnZXIgPG1h cmt1cy50Lm1ldHpnZXJAaW50ZWwuY29tPiB3cml0ZXM6DQo+IA0KPiBQYXRj aCBpcyBnb29kIHRvIG1lLCBuaXRzIG9uIGNvZGUgZm9ybWF0LA0KDQpUaGFu a3MsDQpNYXJrdXMuDQoNCkludGVsIERldXRzY2hsYW5kIEdtYkgKUmVnaXN0 ZXJlZCBBZGRyZXNzOiBBbSBDYW1wZW9uIDEwLTEyLCA4NTU3OSBOZXViaWJl cmcsIEdlcm1hbnkKVGVsOiArNDkgODkgOTkgODg1My0wLCB3d3cuaW50ZWwu ZGUKTWFuYWdpbmcgRGlyZWN0b3JzOiBDaHJpc3RpbiBFaXNlbnNjaG1pZCwg Q2hyaXN0aWFuIExhbXByZWNodGVyCkNoYWlycGVyc29uIG9mIHRoZSBTdXBl cnZpc29yeSBCb2FyZDogTmljb2xlIExhdQpSZWdpc3RlcmVkIE9mZmljZTog TXVuaWNoCkNvbW1lcmNpYWwgUmVnaXN0ZXI6IEFtdHNnZXJpY2h0IE11ZW5j aGVuIEhSQiAxODY5MjgK >From gdb-patches-return-131867-listarch-gdb-patches=sources.redhat.com@sourceware.org Wed Jun 01 09:18:59 2016 Return-Path: Delivered-To: listarch-gdb-patches@sources.redhat.com Received: (qmail 67740 invoked by alias); 1 Jun 2016 09:18:59 -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 Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 67723 invoked by uid 89); 1 Jun 2016 09:18:58 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.3 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=libibertya, UD:libiberty.a, libiberty.a, Hx-languages-length:1731 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; Wed, 01 Jun 2016 09:18:57 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id F13A97F344 for ; Wed, 1 Jun 2016 09:18:55 +0000 (UTC) Received: from littlehelper.redhat.com (vpn1-7-174.ams2.redhat.com [10.36.7.174]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u519Isdk001832 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Wed, 1 Jun 2016 05:18:55 -0400 From: Nick Clifton To: gdb-patches@sourceware.org Subject: RFA: Add xmalloc_failed() to common-utils.c Date: Wed, 01 Jun 2016 09:18:00 -0000 Message-ID: <87inxtgtc2.fsf@redhat.com> MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2016-06/txt/msg00011.txt.bz2 Content-length: 1779 Hi Guys, I am finding that GDB currently fails to build because of a problem with libiberty and multiple definitions of xmalloc. For example: % cd arm-eabi % make all-gdb [...] ../libiberty/libiberty.a(xmalloc.o): In function `xmalloc': libiberty/xmalloc.c:147: multiple definition of `xmalloc' common-utils.o:/work/sources/gcc/current/gdb/common/common-utils.c:41: first defined here [...] Which is strange because the xmalloc functions provided by common-utils.c ought to be sufficient. I have traced this down to the fact that libiberty's cplus-dem.o file includes an unresolved reference to the xmalloc_failed() function. (I am not sure exactly how this reference comes about however). This function is only provided by the xmalloc.c file in libiberty, which is why it is being included in the link, and hence causing a conflict. The fix for the problem is, I think, quite straightforward - provide a copy of the xmalloc_failed function in common-utils.c. I have tested this patch with a variety of different targets (x86, x86_64, arm, msp430) and not found any problems or regressions. So... OK to apply ? Cheers Nick gdb/ChangeLog 2016-06-01 Nick Clifton * common/common-utils.c (xmalloc_failed): New function. Provided so that the version in libiberty is not linked in. diff --git a/gdb/common/common-utils.c b/gdb/common/common-utils.c index 33668f3..5a346ec 100644 --- a/gdb/common/common-utils.c +++ b/gdb/common/common-utils.c @@ -100,6 +100,12 @@ xfree (void *ptr) free (ptr); /* ARI: free */ } +void +xmalloc_failed (size_t size) +{ + malloc_failure (size); +} + /* Like asprintf/vasprintf but get an internal_error if the call fails. */