From patchwork Tue May 2 18:42:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Keith Seitz X-Patchwork-Id: 20224 Received: (qmail 106355 invoked by alias); 2 May 2017 18:43:00 -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 106341 invoked by uid 89); 2 May 2017 18:42:59 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= 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 ESMTP; Tue, 02 May 2017 18:42:58 +0000 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E0E7B716E3 for ; Tue, 2 May 2017 18:42:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com E0E7B716E3 Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=keiths@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com E0E7B716E3 Received: from valrhona.uglyboxes.com (ovpn04.gateway.prod.ext.rdu2.redhat.com [10.11.146.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id 98DAA1BD861 for ; Tue, 2 May 2017 18:42:59 +0000 (UTC) From: Keith Seitz To: gdb-patches@sourceware.org Subject: [PATCH] Make sure malloc is linked into gdb.cp/oranking.cc. Date: Tue, 2 May 2017 11:42:58 -0700 Message-Id: <1493750578-11772-1-git-send-email-keiths@redhat.com> X-IsSubscribed: yes On some platforms, e.g., arm-eabi-none, we need to make certain that malloc is linked into the program because oranking.exp uses function calls requiring it: (gdb) p foo101("abc") evaluation of this expression requires the program to have a function "malloc". While not a big deal (this is /not/ a regression), I think this would be appropriate for inclusion in 8.0. gdb/testsuite/ChangeLog * gdb.cp/oranking.cc (dummy): New function to grab malloc. (main): Call it. --- gdb/testsuite/ChangeLog | 5 +++++ gdb/testsuite/gdb.cp/oranking.cc | 17 +++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 9c0d68b..2e587d6 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2017-05-02 Keith Seitz + + * gdb.cp/oranking.cc (dummy): New function to grab malloc. + (main): Call it. + 2017-05-01 Tim Wiederhake * gdb.python/py-record-btrace.exp: Rename prev_sibling and next_sibling diff --git a/gdb/testsuite/gdb.cp/oranking.cc b/gdb/testsuite/gdb.cp/oranking.cc index bd2f51b..1357610 100644 --- a/gdb/testsuite/gdb.cp/oranking.cc +++ b/gdb/testsuite/gdb.cp/oranking.cc @@ -1,3 +1,18 @@ +#include + +/* Make sure `malloc' is linked into the program. If we don't, tests + in the accompanying expect file may fail: + + evaluation of this expression requires the program to have a function + "malloc". */ + +void +dummy () +{ + void *p = malloc (16); + + free (p); +} /* 1. A standard covnersion sequence is better than a user-defined sequence which is better than an elipses conversion sequence. */ @@ -165,6 +180,8 @@ test15 () } int main() { + dummy (); + B b; foo0(b); foo1(b);