Mirror of the gdb-patches mailing list
 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 4/8] gdb.trace: Use manually-defined start labels in unavailable-dwarf-piece.exp
Date: Sun, 06 Mar 2016 16:35:00 -0000	[thread overview]
Message-ID: <1457282097-7201-5-git-send-email-koriakin@0x04.net> (raw)
In-Reply-To: <1457282097-7201-1-git-send-email-koriakin@0x04.net>

On powerpc64, foo/bar point to a function descriptor, not to function code.
Since there are no global labels pointing at the actual function code,
let's make our own.

Regression-tested on x86_64.

gdb/testsuite/ChangeLog:

	* gdb.trace/unavailable-dwarf-piece.c (foo): Add foo_start_lbl label.
	(bar): Add bar_start_lbl label.
	* gdb.trace/unavailable-dwarf-piece.exp: Use foo/bar_start_lbl instead
	of foo/bar for emitting DWARF and tracing.
---
 gdb/testsuite/ChangeLog                             | 7 +++++++
 gdb/testsuite/gdb.trace/unavailable-dwarf-piece.c   | 2 ++
 gdb/testsuite/gdb.trace/unavailable-dwarf-piece.exp | 8 ++++----
 3 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index a96156d..e2835d5 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,10 @@
+2016-03-05  Marcin Kościelnicki  <koriakin@0x04.net>
+
+	* gdb.trace/unavailable-dwarf-piece.c (foo): Add foo_start_lbl label.
+	(bar): Add bar_start_lbl label.
+	* gdb.trace/unavailable-dwarf-piece.exp: Use foo/bar_start_lbl instead
+	of foo/bar for emitting DWARF and tracing.
+
 2016-03-05  Sergio Durigan Junior  <sergiodj@redhat.com>
 
 	* Makefile.in (DEFAULT_RACY_ITER): New variable.
diff --git a/gdb/testsuite/gdb.trace/unavailable-dwarf-piece.c b/gdb/testsuite/gdb.trace/unavailable-dwarf-piece.c
index 94d611f..5d12c52 100644
--- a/gdb/testsuite/gdb.trace/unavailable-dwarf-piece.c
+++ b/gdb/testsuite/gdb.trace/unavailable-dwarf-piece.c
@@ -54,6 +54,7 @@ dummy (void)
 int
 foo (struct s x, struct s y, struct s z)
 {
+  asm (".global foo_start_lbl\nfoo_start_lbl:");
   dummy ();
   asm (".global foo_end_lbl\nfoo_end_lbl:");
   return 0;
@@ -62,6 +63,7 @@ foo (struct s x, struct s y, struct s z)
 int
 bar (struct t x, struct t y, struct t z)
 {
+  asm (".global bar_start_lbl\nbar_start_lbl:");
   dummy ();
   asm (".global bar_end_lbl\nbar_end_lbl:");
   return 0;
diff --git a/gdb/testsuite/gdb.trace/unavailable-dwarf-piece.exp b/gdb/testsuite/gdb.trace/unavailable-dwarf-piece.exp
index b5052d1..66a09a5 100644
--- a/gdb/testsuite/gdb.trace/unavailable-dwarf-piece.exp
+++ b/gdb/testsuite/gdb.trace/unavailable-dwarf-piece.exp
@@ -175,7 +175,7 @@ Dwarf::assemble $asm_file {
 	    DW_TAG_subprogram {
 		{name foo}
 		{decl_file 1 sdata}
-		{low_pc foo addr}
+		{low_pc foo_start_lbl addr}
 		{high_pc foo_end_lbl addr}
 	    } {
 		DW_TAG_formal_parameter {
@@ -220,7 +220,7 @@ Dwarf::assemble $asm_file {
 	    DW_TAG_subprogram {
 		{name bar}
 		{decl_file 1 sdata}
-		{low_pc bar addr}
+		{low_pc bar_start_lbl addr}
 		{high_pc bar_end_lbl addr}
 	    } {
 		DW_TAG_formal_parameter {
@@ -306,7 +306,7 @@ if ![gdb_target_supports_trace] {
 gdb_breakpoint "end"
 
 with_test_prefix "tracing foo" {
-    gdb_test "trace foo" ".*"
+    gdb_test "trace *foo_start_lbl" ".*"
     gdb_test_no_output "tstart"
     gdb_test "continue" "Continuing\\.\[ \r\n\]+Breakpoint.*"
     gdb_test_no_output "tstop"
@@ -320,7 +320,7 @@ with_test_prefix "tracing foo" {
 }
 
 with_test_prefix "tracing bar" {
-    gdb_test "trace bar" ".*"
+    gdb_test "trace *bar_start_lbl" ".*"
     gdb_test_no_output "tstart"
     gdb_test "continue" "Continuing\\.\[ \r\n\]+Breakpoint.*"
     gdb_test_no_output "tstop"
-- 
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 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 1/8] gdb: Add ax_pseudo_register_collect for powerpc Marcin Kościelnicki
2016-03-09 17:20   ` Ulrich Weigand
2016-03-06 16:35 ` [PATCH 6/8] gdb.trace/tfind.exp: Force call via global entry point on ppc64le Marcin Kościelnicki
2016-03-09 17:26   ` 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:24   ` [PATCH 4/8] gdb.trace: Use manually-defined start labels in unavailable-dwarf-piece.exp Ulrich Weigand
2016-03-09 17:27     ` Marcin Kościelnicki
2016-03-09 17:35       ` 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: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
2016-03-06 16:40 ` [PATCH 3/8] gdb/rs6000: Read backchain as unsigned Marcin Kościelnicki
2016-03-09 17:21   ` 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-5-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