From patchwork Sun Mar 6 16:34:55 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marcin_Ko=C5=9Bcielnicki?= X-Patchwork-Id: 11219 Received: (qmail 98681 invoked by alias); 6 Mar 2016 16:35:09 -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 98601 invoked by uid 89); 6 Mar 2016 16:35:08 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 spammy=4811, 1107, HContent-Transfer-Encoding:8bit X-HELO: xyzzy.0x04.net Received: from xyzzy.0x04.net (HELO xyzzy.0x04.net) (109.74.193.254) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 06 Mar 2016 16:35:06 +0000 Received: from hogfather.0x04.net (89-65-66-135.dynamic.chello.pl [89.65.66.135]) by xyzzy.0x04.net (Postfix) with ESMTPS id 0FD1B4109C for ; Sun, 6 Mar 2016 17:36:00 +0100 (CET) Received: by hogfather.0x04.net (Postfix, from userid 1000) id D29EE58008A; Sun, 6 Mar 2016 17:35:00 +0100 (CET) From: =?UTF-8?q?Marcin=20Ko=C5=9Bcielnicki?= To: gdb-patches@sourceware.org Cc: =?UTF-8?q?Marcin=20Ko=C5=9Bcielnicki?= Subject: [PATCH 6/8] gdb.trace/tfind.exp: Force call via global entry point on ppc64le. Date: Sun, 6 Mar 2016 17:34:55 +0100 Message-Id: <1457282097-7201-7-git-send-email-koriakin@0x04.net> In-Reply-To: <1457282097-7201-1-git-send-email-koriakin@0x04.net> References: <1457282097-7201-1-git-send-email-koriakin@0x04.net> MIME-Version: 1.0 X-IsSubscribed: yes tfind.exp sets a breakpoint on *gdb_recursion_test, which is the global entry point on ppc64le, and won't be hit, since the call uses the local entry. Fix by calling the function via a pointer in a global variable, forcing use of the global entry. This patch is a slightly modified hunk extracted from https://sourceware.org/ml/gdb-patches/2015-07/msg00353.html gdb/testsuite/ChangeLog: 2016-03-05 Wei-cheng Wang Marcin Kościelnicki * gdb.trace/actions.c (gdb_recursion_test_fp): New typedef. (gdb_recursion_test_ptr): New global variable. (gdb_recursion_test): Call gdb_recursion_test_ptr instead of gdb_recursion_test. (gdb_c_test): Ditto. --- gdb/testsuite/ChangeLog | 9 +++++++++ gdb/testsuite/gdb.trace/actions.c | 9 +++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 2cf9531..54d0f01 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,12 @@ +2016-03-05 Wei-cheng Wang + Marcin KoÅ›cielnicki + + * gdb.trace/actions.c (gdb_recursion_test_fp): New typedef. + (gdb_recursion_test_ptr): New global variable. + (gdb_recursion_test): Call gdb_recursion_test_ptr instead of + gdb_recursion_test. + (gdb_c_test): Ditto. + 2016-03-05 Marcin KoÅ›cielnicki * gdb.trace/change-loc.exp: Don't depend on tracepoint location diff --git a/gdb/testsuite/gdb.trace/actions.c b/gdb/testsuite/gdb.trace/actions.c index 431b08a..aedd202 100644 --- a/gdb/testsuite/gdb.trace/actions.c +++ b/gdb/testsuite/gdb.trace/actions.c @@ -48,6 +48,11 @@ static union GDB_UNION_TEST } gdb_union1_test; void gdb_recursion_test (int, int, int, int, int, int, int); +/* This function pointer is used to force the function to be called via + the global entry instead of local entry on ppc64le; otherwise, breakpoints + set at the global entry (i.e., '*foo') will not be hit. */ +typedef void (*gdb_recursion_test_fp) (int, int, int, int, int, int, int); +gdb_recursion_test_fp gdb_recursion_test_ptr = gdb_recursion_test; void gdb_recursion_test (int depth, int q1, @@ -66,7 +71,7 @@ void gdb_recursion_test (int depth, q5 = q6; /* gdbtestline 6 */ q6 = q; /* gdbtestline 7 */ if (depth--) /* gdbtestline 8 */ - gdb_recursion_test (depth, q1, q2, q3, q4, q5, q6); /* gdbtestline 9 */ + gdb_recursion_test_ptr (depth, q1, q2, q3, q4, q5, q6); /* gdbtestline 9 */ } @@ -105,7 +110,7 @@ unsigned long gdb_c_test( unsigned long *parm ) gdb_structp_test = &gdb_struct1_test; gdb_structpp_test = &gdb_structp_test; - gdb_recursion_test (3, (long) parm[1], (long) parm[2], (long) parm[3], + gdb_recursion_test_ptr (3, (long) parm[1], (long) parm[2], (long) parm[3], (long) parm[4], (long) parm[5], (long) parm[6]); gdb_char_test = gdb_short_test = gdb_long_test = 0;