public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: "Marcin Kościelnicki" <koriakin@0x04.net>
To: gdb-patches@sourceware.org
Cc: "Marcin Kościelnicki" <koriakin@0x04.net>
Subject: [PATCH 6/8] gdb.trace/tfind.exp: Force call via global entry point on ppc64le.
Date: Sun, 06 Mar 2016 16:35:00 -0000	[thread overview]
Message-ID: <1457282097-7201-7-git-send-email-koriakin@0x04.net> (raw)
In-Reply-To: <1457282097-7201-1-git-send-email-koriakin@0x04.net>

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  <cole945@gmail.com>
	    Marcin Kościelnicki  <koriakin@0x04.net>

	* 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  <cole945@gmail.com>
+	    Marcin Kościelnicki  <koriakin@0x04.net>
+
+	* 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  <koriakin@0x04.net>
 
 	* 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;
-- 
2.7.2

  parent reply	other threads:[~2016-03-06 16:35 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-06 16:35 [PATCH 0/8] Add regular tracepoint support for powerpc Marcin Kościelnicki
2016-03-06 16:35 ` [PATCH 4/8] gdb.trace: Use manually-defined start labels in unavailable-dwarf-piece.exp Marcin Kościelnicki
2016-03-09 17:24   ` Ulrich Weigand
2016-03-09 17:27     ` Marcin Kościelnicki
2016-03-09 17:35       ` Ulrich Weigand
2016-03-06 16:35 ` [PATCH 2/8] gdb: Add gen_return_address for powerpc Marcin Kościelnicki
2016-03-09 17:20   ` Ulrich Weigand
2016-03-06 16:35 ` Marcin Kościelnicki [this message]
2016-03-09 17:26   ` [PATCH 6/8] gdb.trace/tfind.exp: Force call via global entry point on ppc64le Ulrich Weigand
2016-03-06 16:35 ` [PATCH 7/8] gdb.trace/entry-values.exp: Fixes for powerpc64 Marcin Kościelnicki
2016-03-09 17:29   ` Ulrich Weigand
2016-03-06 16:35 ` [PATCH 8/8] gdb: Add tracepoint support for powerpc Marcin Kościelnicki
2016-03-09 17:33   ` Ulrich Weigand
2016-03-09 17:48     ` Marcin Kościelnicki
2016-03-06 16:35 ` [PATCH 1/8] gdb: Add ax_pseudo_register_collect " Marcin Kościelnicki
2016-03-09 17:20   ` Ulrich Weigand
2016-03-06 16:40 ` [PATCH 3/8] gdb/rs6000: Read backchain as unsigned Marcin Kościelnicki
2016-03-09 17:21   ` Ulrich Weigand
2016-03-06 16:40 ` [PATCH 5/8] gdb.trace/change-loc.exp: Don't depend on tracepoint ordering Marcin Kościelnicki
2016-03-09 17:25   ` Ulrich Weigand

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1457282097-7201-7-git-send-email-koriakin@0x04.net \
    --to=koriakin@0x04.net \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).