public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 8/8] gdb: Add tracepoint support for powerpc.
  2016-03-06 16:35 [PATCH 0/8] Add regular tracepoint support for powerpc Marcin Kościelnicki
                   ` (4 preceding siblings ...)
  2016-03-06 16:35 ` [PATCH 1/8] gdb: Add ax_pseudo_register_collect " Marcin Kościelnicki
@ 2016-03-06 16:35 ` Marcin Kościelnicki
  2016-03-09 17:33   ` Ulrich Weigand
  2016-03-06 16:40 ` [PATCH 3/8] gdb/rs6000: Read backchain as unsigned 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
  7 siblings, 1 reply; 20+ messages in thread
From: Marcin Kościelnicki @ 2016-03-06 16:35 UTC (permalink / raw)
  To: gdb-patches; +Cc: Marcin Kościelnicki

gdb/gdbserver/ChangeLog:

	* linux-ppc-low.c (ppc_supports_tracepoints): New function.
	(struct linux_target_ops): Wire in the above.

gdb/testsuite/ChangeLog:

	* gdb.trace/ftrace.exp: Set arg0exp for ppc.
	* gdb.trace/mi-trace-unavailable.exp: Set pcnum for ppc.
	* gdb.trace/pending.exp: Accept leading dot before function name.
	* gdb.trace/trace-common.h: Add fast tracepoint dummy insn for ppc.
	* lib/trace-support.exp: Set registers for ppc.
---
 gdb/gdbserver/ChangeLog                          | 5 +++++
 gdb/gdbserver/linux-ppc-low.c                    | 8 +++++++-
 gdb/testsuite/ChangeLog                          | 8 ++++++++
 gdb/testsuite/gdb.trace/ftrace.exp               | 2 ++
 gdb/testsuite/gdb.trace/mi-trace-unavailable.exp | 2 ++
 gdb/testsuite/gdb.trace/pending.exp              | 3 ++-
 gdb/testsuite/gdb.trace/trace-common.h           | 2 +-
 gdb/testsuite/lib/trace-support.exp              | 4 ++++
 8 files changed, 31 insertions(+), 3 deletions(-)

diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
index 11e1c4f..664e89f 100644
--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -1,3 +1,8 @@
+2016-03-05  Marcin Kościelnicki  <koriakin@0x04.net>
+
+	* linux-ppc-low.c (ppc_supports_tracepoints): New function.
+	(struct linux_target_ops): Wire in the above.
+
 2016-03-03  Yao Qi  <yao.qi@linaro.org>
 
 	* linux-low.c: Update comments to start_step_over.
diff --git a/gdb/gdbserver/linux-ppc-low.c b/gdb/gdbserver/linux-ppc-low.c
index 61a1693..49d27ee 100644
--- a/gdb/gdbserver/linux-ppc-low.c
+++ b/gdb/gdbserver/linux-ppc-low.c
@@ -756,6 +756,12 @@ ppc_arch_setup (void)
   current_process ()->tdesc = tdesc;
 }
 
+static int
+ppc_supports_tracepoints (void)
+{
+  return 1;
+}
+
 struct linux_target_ops the_low_target = {
   ppc_arch_setup,
   ppc_regs_info,
@@ -782,7 +788,7 @@ struct linux_target_ops the_low_target = {
   NULL, /* new_fork */
   NULL, /* prepare_to_resume */
   NULL, /* process_qsupported */
-  NULL, /* supports_tracepoints */
+  ppc_supports_tracepoints,
   NULL, /* get_thread_area */
   NULL, /* install_fast_tracepoint_jump_pad */
   NULL, /* emit_ops */
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index c634ce8..100da10 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,11 @@
+2016-03-05  Marcin Kościelnicki  <koriakin@0x04.net>
+
+	* gdb.trace/ftrace.exp: Set arg0exp for ppc.
+	* gdb.trace/mi-trace-unavailable.exp: Set pcnum for ppc.
+	* gdb.trace/pending.exp: Accept leading dot before function name.
+	* gdb.trace/trace-common.h: Add fast tracepoint dummy insn for ppc.
+	* lib/trace-support.exp: Set registers for ppc.
+
 2016-03-06  Marcin Kościelnicki  <koriakin@0x04.net>
 
 	* gdb.trace/entry-values.exp: Link ${binfile}1.o to ${binfile}1 and
diff --git a/gdb/testsuite/gdb.trace/ftrace.exp b/gdb/testsuite/gdb.trace/ftrace.exp
index a1d4771..349f4e2 100644
--- a/gdb/testsuite/gdb.trace/ftrace.exp
+++ b/gdb/testsuite/gdb.trace/ftrace.exp
@@ -242,6 +242,8 @@ if [is_amd64_regs_target] {
     set arg0exp "*(int *) (\$ebp + 8)"
 } elseif { [istarget "aarch64*-*-*"] } {
     set arg0exp "\$x0"
+} elseif [istarget "powerpc*-*-*"] {
+    set arg0exp "\$r3"
 } else {
     set arg0exp ""
 }
diff --git a/gdb/testsuite/gdb.trace/mi-trace-unavailable.exp b/gdb/testsuite/gdb.trace/mi-trace-unavailable.exp
index 82c6101..4228c97 100644
--- a/gdb/testsuite/gdb.trace/mi-trace-unavailable.exp
+++ b/gdb/testsuite/gdb.trace/mi-trace-unavailable.exp
@@ -137,6 +137,8 @@ proc test_trace_unavailable { data_source } {
 	    set pcnum 8
 	} elseif [is_aarch64_target] {
 	    set pcnum 32
+	} elseif [istarget "powerpc*-*-*"] {
+	    set pcnum 64
 	} else {
 	    # Other ports support tracepoint should define the number
 	    # of its own pc register.
diff --git a/gdb/testsuite/gdb.trace/pending.exp b/gdb/testsuite/gdb.trace/pending.exp
index 3ef752f..43f4c60 100644
--- a/gdb/testsuite/gdb.trace/pending.exp
+++ b/gdb/testsuite/gdb.trace/pending.exp
@@ -307,7 +307,8 @@ proc pending_tracepoint_installed_during_trace { trace_type } \
 \[0-9\]+\[\t \]+\(fast |\)tracepoint\[ \]+keep y.*pendfunc2.*" \
 	"tracepoint is resolved"
 
-    gdb_test "tfind start" "#0  $hex in pendfunc2 .*" "tfind test frame 0"
+    # powerpc64 shows "in .pendfunc2" here.
+    gdb_test "tfind start" "#0  $hex in .?pendfunc2 .*" "tfind test frame 0"
     gdb_test "tfind" "Target failed to find requested trace frame..*" "tfind test frame"
 }}
 
diff --git a/gdb/testsuite/gdb.trace/trace-common.h b/gdb/testsuite/gdb.trace/trace-common.h
index eceb182..fa99fd9 100644
--- a/gdb/testsuite/gdb.trace/trace-common.h
+++ b/gdb/testsuite/gdb.trace/trace-common.h
@@ -40,7 +40,7 @@ x86_trace_dummy ()
        "    call " SYMBOL(x86_trace_dummy) "\n" \
        )
 
-#elif (defined __aarch64__)
+#elif (defined __aarch64__) || (defined __powerpc__)
 
 #define FAST_TRACEPOINT_LABEL(name) \
   asm ("    .global " SYMBOL(name) "\n" \
diff --git a/gdb/testsuite/lib/trace-support.exp b/gdb/testsuite/lib/trace-support.exp
index f593c43..372a595 100644
--- a/gdb/testsuite/lib/trace-support.exp
+++ b/gdb/testsuite/lib/trace-support.exp
@@ -36,6 +36,10 @@ if [is_amd64_regs_target] {
     set fpreg "x29"
     set spreg "sp"
     set pcreg "pc"
+} elseif [istarget "powerpc*-*-*"] {
+    set fpreg "r31"
+    set spreg "r1"
+    set pcreg "pc"
 } else {
     set fpreg "fp"
     set spreg "sp"
-- 
2.7.2

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [PATCH 2/8] gdb: Add gen_return_address for powerpc.
  2016-03-06 16:35 [PATCH 0/8] Add regular tracepoint support for powerpc Marcin Kościelnicki
                   ` (2 preceding siblings ...)
  2016-03-06 16:35 ` [PATCH 7/8] gdb.trace/entry-values.exp: Fixes for powerpc64 Marcin Kościelnicki
@ 2016-03-06 16:35 ` Marcin Kościelnicki
  2016-03-09 17:20   ` Ulrich Weigand
  2016-03-06 16:35 ` [PATCH 1/8] gdb: Add ax_pseudo_register_collect " Marcin Kościelnicki
                   ` (3 subsequent siblings)
  7 siblings, 1 reply; 20+ messages in thread
From: Marcin Kościelnicki @ 2016-03-06 16:35 UTC (permalink / raw)
  To: gdb-patches; +Cc: Marcin Kościelnicki

gdb/ChangeLog:

	* rs6000-tdep.c (rs6000_gen_return_address): New function.
	(rs6000_gdbarch_init): Wire in the above.
---
 gdb/ChangeLog     |  5 +++++
 gdb/rs6000-tdep.c | 17 +++++++++++++++++
 2 files changed, 22 insertions(+)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index f0b6112..c2ef019 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,10 @@
 2016-03-05  Marcin Kościelnicki  <koriakin@0x04.net>
 
+	* rs6000-tdep.c (rs6000_gen_return_address): New function.
+	(rs6000_gdbarch_init): Wire in the above.
+
+2016-03-05  Marcin Kościelnicki  <koriakin@0x04.net>
+
 	* rs6000-tdep.c (rs6000_ax_pseudo_register_collect): New function.
 	(rs6000_gdbarch_init): Wire in the above.
 
diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c
index 3bcd205..565c620 100644
--- a/gdb/rs6000-tdep.c
+++ b/gdb/rs6000-tdep.c
@@ -63,6 +63,9 @@
 #include "frame-unwind.h"
 #include "frame-base.h"
 
+#include "ax.h"
+#include "ax-gdb.h"
+
 #include "features/rs6000/powerpc-32.c"
 #include "features/rs6000/powerpc-altivec32.c"
 #include "features/rs6000/powerpc-vsx32.c"
@@ -2963,6 +2966,18 @@ rs6000_ax_pseudo_register_collect (struct gdbarch *gdbarch,
 }
 
 
+static void
+rs6000_gen_return_address (struct gdbarch *gdbarch,
+			   struct agent_expr *ax, struct axs_value *value,
+			   CORE_ADDR scope)
+{
+  struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+  value->type = register_type (gdbarch, tdep->ppc_lr_regnum);
+  value->kind = axs_lvalue_register;
+  value->u.reg = tdep->ppc_lr_regnum;
+}
+
+
 /* Convert a DBX STABS register number to a GDB register number.  */
 static int
 rs6000_stab_reg_to_regnum (struct gdbarch *gdbarch, int num)
@@ -5972,6 +5987,8 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
 	      rs6000_ax_pseudo_register_collect);
     }
 
+  set_gdbarch_gen_return_address (gdbarch, rs6000_gen_return_address);
+
   set_gdbarch_have_nonsteppable_watchpoint (gdbarch, 1);
 
   /* Select instruction printer.  */
-- 
2.7.2

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [PATCH 0/8] Add regular tracepoint support for powerpc.
@ 2016-03-06 16:35 Marcin Kościelnicki
  2016-03-06 16:35 ` [PATCH 6/8] gdb.trace/tfind.exp: Force call via global entry point on ppc64le Marcin Kościelnicki
                   ` (7 more replies)
  0 siblings, 8 replies; 20+ messages in thread
From: Marcin Kościelnicki @ 2016-03-06 16:35 UTC (permalink / raw)
  To: gdb-patches

This patchset adds regular tracepoint support for powerpc and fixes most
test failures.  Tested on powerpc, powerpc64, powerpc64le.

Aside of the target-independent FAILs in collection.exp and
unavailable.exp, the only FAILs left are on 32-bit, and they're all
caused by const variables landing in .sdata instead of .rodata - since
they're in a writable segment, they're not considered to be in
an immutable area by gdbserver, and will be deemed unavailable if not
explicitely collected.  FWIW, running the testsuite with -mno-sdata
fixes these.

That's a special case of a more generic problem already causing the
target-independent FAILs in unavailable.exp (involving unavailable
vtables).  We should probably utilize the debugging information to
create additional immutable ranges for vtables and const variables,
even if they end up in .data.relro, .sdata, etc.  However, solving it
is IMO outside of the scope of this patchset.

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [PATCH 1/8] gdb: Add ax_pseudo_register_collect for powerpc.
  2016-03-06 16:35 [PATCH 0/8] Add regular tracepoint support for powerpc Marcin Kościelnicki
                   ` (3 preceding siblings ...)
  2016-03-06 16:35 ` [PATCH 2/8] gdb: Add gen_return_address for powerpc Marcin Kościelnicki
@ 2016-03-06 16:35 ` Marcin Kościelnicki
  2016-03-09 17:20   ` Ulrich Weigand
  2016-03-06 16:35 ` [PATCH 8/8] gdb: Add tracepoint support " Marcin Kościelnicki
                   ` (2 subsequent siblings)
  7 siblings, 1 reply; 20+ messages in thread
From: Marcin Kościelnicki @ 2016-03-06 16:35 UTC (permalink / raw)
  To: gdb-patches; +Cc: Marcin Kościelnicki

gdb/ChangeLog:

	* rs6000-tdep.c (rs6000_ax_pseudo_register_collect): New function.
	(rs6000_gdbarch_init): Wire in the above.
---
 gdb/ChangeLog     |  5 +++++
 gdb/rs6000-tdep.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 51 insertions(+)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index b84326c..f0b6112 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2016-03-05  Marcin Kościelnicki  <koriakin@0x04.net>
+
+	* rs6000-tdep.c (rs6000_ax_pseudo_register_collect): New function.
+	(rs6000_gdbarch_init): Wire in the above.
+
 2016-03-05  Pitchumani Sivanupandi  <pitchumani.s@atmel.com>
 
 	* avr-tdep.c (AVR_LAST_ARG_REGNUM): Define.
diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c
index c2b6638..3bcd205 100644
--- a/gdb/rs6000-tdep.c
+++ b/gdb/rs6000-tdep.c
@@ -2919,6 +2919,50 @@ rs6000_pseudo_register_write (struct gdbarch *gdbarch,
 		    gdbarch_register_name (gdbarch, reg_nr), reg_nr);
 }
 
+static int
+rs6000_ax_pseudo_register_collect (struct gdbarch *gdbarch,
+				   struct agent_expr *ax, int reg_nr)
+{
+  struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+  if (IS_SPE_PSEUDOREG (tdep, reg_nr))
+    {
+      int reg_index = reg_nr - tdep->ppc_ev0_regnum;
+      ax_reg_mask (ax, tdep->ppc_gp0_regnum + reg_index);
+      ax_reg_mask (ax, tdep->ppc_ev0_upper_regnum + reg_index);
+    }
+  else if (IS_DFP_PSEUDOREG (tdep, reg_nr))
+    {
+      int reg_index = reg_nr - tdep->ppc_dl0_regnum;
+      ax_reg_mask (ax, tdep->ppc_fp0_regnum + 2 * reg_index);
+      ax_reg_mask (ax, tdep->ppc_fp0_regnum + 2 * reg_index + 1);
+    }
+  else if (IS_VSX_PSEUDOREG (tdep, reg_nr))
+    {
+      int reg_index = reg_nr - tdep->ppc_vsr0_regnum;
+      if (reg_index > 31)
+        {
+          ax_reg_mask (ax, tdep->ppc_vr0_regnum + reg_index - 32);
+	}
+      else
+        {
+          ax_reg_mask (ax, tdep->ppc_fp0_regnum + reg_index);
+          ax_reg_mask (ax, tdep->ppc_vsr0_upper_regnum + reg_index);
+        }
+    }
+  else if (IS_EFP_PSEUDOREG (tdep, reg_nr))
+    {
+      int reg_index = reg_nr - tdep->ppc_efpr0_regnum;
+      ax_reg_mask (ax, tdep->ppc_vr0_regnum + reg_index);
+    }
+  else
+    internal_error (__FILE__, __LINE__,
+		    _("rs6000_pseudo_register_collect: "
+		    "called on unexpected register '%s' (%d)"),
+		    gdbarch_register_name (gdbarch, reg_nr), reg_nr);
+  return 0;
+}
+
+
 /* Convert a DBX STABS register number to a GDB register number.  */
 static int
 rs6000_stab_reg_to_regnum (struct gdbarch *gdbarch, int num)
@@ -5924,6 +5968,8 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
       set_gdbarch_pseudo_register_read (gdbarch, rs6000_pseudo_register_read);
       set_gdbarch_pseudo_register_write (gdbarch,
 					 rs6000_pseudo_register_write);
+      set_gdbarch_ax_pseudo_register_collect (gdbarch,
+	      rs6000_ax_pseudo_register_collect);
     }
 
   set_gdbarch_have_nonsteppable_watchpoint (gdbarch, 1);
-- 
2.7.2

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [PATCH 4/8] gdb.trace: Use manually-defined start labels in unavailable-dwarf-piece.exp
  2016-03-06 16:35 [PATCH 0/8] Add regular tracepoint support for powerpc Marcin Kościelnicki
  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-06 16:35 ` Marcin Kościelnicki
  2016-03-09 17:24   ` Ulrich Weigand
  2016-03-06 16:35 ` [PATCH 7/8] gdb.trace/entry-values.exp: Fixes for powerpc64 Marcin Kościelnicki
                   ` (5 subsequent siblings)
  7 siblings, 1 reply; 20+ messages in thread
From: Marcin Kościelnicki @ 2016-03-06 16:35 UTC (permalink / raw)
  To: gdb-patches; +Cc: Marcin Kościelnicki

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

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [PATCH 7/8] gdb.trace/entry-values.exp: Fixes for powerpc64.
  2016-03-06 16:35 [PATCH 0/8] Add regular tracepoint support for powerpc Marcin Kościelnicki
  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-06 16:35 ` [PATCH 4/8] gdb.trace: Use manually-defined start labels in unavailable-dwarf-piece.exp Marcin Kościelnicki
@ 2016-03-06 16:35 ` Marcin Kościelnicki
  2016-03-09 17:29   ` Ulrich Weigand
  2016-03-06 16:35 ` [PATCH 2/8] gdb: Add gen_return_address for powerpc Marcin Kościelnicki
                   ` (4 subsequent siblings)
  7 siblings, 1 reply; 20+ messages in thread
From: Marcin Kościelnicki @ 2016-03-06 16:35 UTC (permalink / raw)
  To: gdb-patches; +Cc: Marcin Kościelnicki

On powerpc64, "disassemble foo" doesn't work properly on object files
(it can't process the relocations in .opd section) - instead, let's
link it into an executable and load that.

Also, backtrace displays .main, not main.  Accept both.

gdb/testsuite/ChangeLog:

	* gdb.trace/entry-values.exp: Link ${binfile}1.o to ${binfile}1 and
	use it for disassembly; accept .main in addition to main in backtrace.
---
 gdb/testsuite/ChangeLog                  |  5 +++++
 gdb/testsuite/gdb.trace/entry-values.exp | 13 +++++++++----
 2 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 54d0f01..c634ce8 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2016-03-06  Marcin Kościelnicki  <koriakin@0x04.net>
+
+	* gdb.trace/entry-values.exp: Link ${binfile}1.o to ${binfile}1 and
+	use it for disassembly; accept .main in addition to main in backtrace.
+
 2016-03-05  Wei-cheng Wang  <cole945@gmail.com>
 	    Marcin Kościelnicki  <koriakin@0x04.net>
 
diff --git a/gdb/testsuite/gdb.trace/entry-values.exp b/gdb/testsuite/gdb.trace/entry-values.exp
index 81b0263..e8ed517 100644
--- a/gdb/testsuite/gdb.trace/entry-values.exp
+++ b/gdb/testsuite/gdb.trace/entry-values.exp
@@ -26,14 +26,19 @@ if  {[gdb_compile ${srcdir}/${subdir}/${srcfile} ${binfile}1.o \
     return -1
 }
 
-# Start GDB and load object file, compute the offset of the
+if  {[gdb_compile [list ${binfile}1.o] \
+	  "${binfile}1" executable {}] != ""} {
+    return -1
+}
+
+# Start GDB and load executable file, compute the offset of the
 # instruction in bar returned from foo.  It is needed in the Dwarf
 # Assembler.
 
 gdb_exit
 gdb_start
 gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}1.o
+gdb_load ${binfile}1
 
 set returned_from_foo ""
 
@@ -183,7 +188,7 @@ gdb_test_no_output "set print entry-values both"
 gdb_test_sequence "bt" "bt (1)" {
     "\[\r\n\]#0 .* foo \\(i=[-]?[0-9]+, i@entry=2, j=[-]?[0-9]+, j@entry=3\\)"
     "\[\r\n\]#1 .* bar \\(i=<optimized out>, i@entry=<optimized out>\\)"
-    "\[\r\n\]#2 .* main \\(\\)"
+    "\[\r\n\]#2 .* \.?main \\(\\)"
 }
 
 # Update global variables 'global1' and 'global2' and test that the
@@ -195,7 +200,7 @@ gdb_test_no_output "set var global2=11"
 gdb_test_sequence "bt" "bt (2)" {
     "\[\r\n\]#0 .* foo \\(i=[-]?[0-9]+, i@entry=10, j=[-]?[0-9]+, j@entry=11\\)"
     "\[\r\n\]#1 .* bar \\(i=<optimized out>, i@entry=<optimized out>\\)"
-    "\[\r\n\]#2 .* main \\(\\)"
+    "\[\r\n\]#2 .* \.?main \\(\\)"
 }
 
 # Restart GDB and trace.
-- 
2.7.2

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [PATCH 6/8] gdb.trace/tfind.exp: Force call via global entry point on ppc64le.
  2016-03-06 16:35 [PATCH 0/8] Add regular tracepoint support for powerpc Marcin Kościelnicki
@ 2016-03-06 16:35 ` Marcin Kościelnicki
  2016-03-09 17:26   ` Ulrich Weigand
  2016-03-06 16:35 ` [PATCH 4/8] gdb.trace: Use manually-defined start labels in unavailable-dwarf-piece.exp Marcin Kościelnicki
                   ` (6 subsequent siblings)
  7 siblings, 1 reply; 20+ messages in thread
From: Marcin Kościelnicki @ 2016-03-06 16:35 UTC (permalink / raw)
  To: gdb-patches; +Cc: Marcin Kościelnicki

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

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [PATCH 3/8] gdb/rs6000: Read backchain as unsigned.
  2016-03-06 16:35 [PATCH 0/8] Add regular tracepoint support for powerpc Marcin Kościelnicki
                   ` (5 preceding siblings ...)
  2016-03-06 16:35 ` [PATCH 8/8] gdb: Add tracepoint support " Marcin Kościelnicki
@ 2016-03-06 16:40 ` 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
  7 siblings, 1 reply; 20+ messages in thread
From: Marcin Kościelnicki @ 2016-03-06 16:40 UTC (permalink / raw)
  To: gdb-patches; +Cc: Marcin Kościelnicki

Previously, backchain was read as a signed quantity, resulting in
addresses like 0xfffffffffffeded0 instead of 0xfffeded0 returned by
unwinder on 32-bit powerpc.  While normally such addresses are masked
off, this causes problems for tracepoints, since 0xfffffffffffeded0
is considered unavailable.

Fixes a test failure in gdb.trace/entry-values.exp.

gdb/ChangeLog:

	* corefile.c (safe_read_memory_unsigned_integer): New function.
	* gdbcore.h (safe_read_memory_unsigned_integer): New prototype.
	* rs6000-tdep.c (rs6000_frame_cache): Read backchain as unsigned.
---
 gdb/ChangeLog     |  6 ++++++
 gdb/corefile.c    | 18 ++++++++++++++++++
 gdb/gdbcore.h     |  3 +++
 gdb/rs6000-tdep.c |  6 +++---
 4 files changed, 30 insertions(+), 3 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index c2ef019..45c5276 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,9 @@
+2016-03-06  Marcin Kościelnicki  <koriakin@0x04.net>
+
+	* corefile.c (safe_read_memory_unsigned_integer): New function.
+	* gdbcore.h (safe_read_memory_unsigned_integer): New prototype.
+	* rs6000-tdep.c (rs6000_frame_cache): Read backchain as unsigned.
+
 2016-03-05  Marcin Kościelnicki  <koriakin@0x04.net>
 
 	* rs6000-tdep.c (rs6000_gen_return_address): New function.
diff --git a/gdb/corefile.c b/gdb/corefile.c
index dbdbafc..5ad4d40 100644
--- a/gdb/corefile.c
+++ b/gdb/corefile.c
@@ -306,6 +306,24 @@ safe_read_memory_integer (CORE_ADDR memaddr, int len,
   return 1;
 }
 
+/* Read memory at MEMADDR of length LEN and put the contents in
+   RETURN_VALUE.  Return 0 if MEMADDR couldn't be read and non-zero
+   if successful.  */
+
+int
+safe_read_memory_unsigned_integer (CORE_ADDR memaddr, int len,
+				   enum bfd_endian byte_order,
+				   ULONGEST *return_value)
+{
+  gdb_byte buf[sizeof (ULONGEST)];
+
+  if (target_read_memory (memaddr, buf, len))
+    return 0;
+
+  *return_value = extract_unsigned_integer (buf, len, byte_order);
+  return 1;
+}
+
 LONGEST
 read_memory_integer (CORE_ADDR memaddr, int len,
 		     enum bfd_endian byte_order)
diff --git a/gdb/gdbcore.h b/gdb/gdbcore.h
index 5db80e5..8b101bc 100644
--- a/gdb/gdbcore.h
+++ b/gdb/gdbcore.h
@@ -76,6 +76,9 @@ extern int safe_read_memory_integer (CORE_ADDR memaddr, int len,
 extern ULONGEST read_memory_unsigned_integer (CORE_ADDR memaddr,
 					      int len,
 					      enum bfd_endian byte_order);
+extern int safe_read_memory_unsigned_integer (CORE_ADDR memaddr, int len,
+					      enum bfd_endian byte_order,
+					      ULONGEST *return_value);
 
 /* Read an integer from debugged code memory, given address,
    number of bytes, and byte order for code.  */
diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c
index 565c620..2460eb5 100644
--- a/gdb/rs6000-tdep.c
+++ b/gdb/rs6000-tdep.c
@@ -3336,10 +3336,10 @@ rs6000_frame_cache (struct frame_info *this_frame, void **this_cache)
   if (!fdata.frameless)
     {
       /* Frameless really means stackless.  */
-      LONGEST backchain;
+      ULONGEST backchain;
 
-      if (safe_read_memory_integer (cache->base, wordsize,
-				    byte_order, &backchain))
+      if (safe_read_memory_unsigned_integer (cache->base, wordsize,
+					     byte_order, &backchain))
         cache->base = (CORE_ADDR) backchain;
     }
 
-- 
2.7.2

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [PATCH 5/8] gdb.trace/change-loc.exp: Don't depend on tracepoint ordering.
  2016-03-06 16:35 [PATCH 0/8] Add regular tracepoint support for powerpc Marcin Kościelnicki
                   ` (6 preceding siblings ...)
  2016-03-06 16:40 ` [PATCH 3/8] gdb/rs6000: Read backchain as unsigned Marcin Kościelnicki
@ 2016-03-06 16:40 ` Marcin Kościelnicki
  2016-03-09 17:25   ` Ulrich Weigand
  7 siblings, 1 reply; 20+ messages in thread
From: Marcin Kościelnicki @ 2016-03-06 16:40 UTC (permalink / raw)
  To: gdb-patches; +Cc: Marcin Kościelnicki

powerpc (32-bit) loads shared libraries below the main executable, so
the PENDING location is the first one, which the current regex doesn't
match.  Split it into two tests instead, one looking for the pending
tracepoint location, and the other for two installed locations.

gdb/testsuite/ChangeLog:

	* gdb.trace/change-loc.exp: Don't depend on tracepoint location
	ordering.
---
 gdb/testsuite/ChangeLog                |  5 +++++
 gdb/testsuite/gdb.trace/change-loc.exp | 20 ++++++++++++++++----
 2 files changed, 21 insertions(+), 4 deletions(-)

diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index e2835d5..2cf9531 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,5 +1,10 @@
 2016-03-05  Marcin Kościelnicki  <koriakin@0x04.net>
 
+	* gdb.trace/change-loc.exp: Don't depend on tracepoint location
+	ordering.
+
+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
diff --git a/gdb/testsuite/gdb.trace/change-loc.exp b/gdb/testsuite/gdb.trace/change-loc.exp
index 80beb4d..c4e0b4b 100644
--- a/gdb/testsuite/gdb.trace/change-loc.exp
+++ b/gdb/testsuite/gdb.trace/change-loc.exp
@@ -152,8 +152,14 @@ proc tracepoint_change_loc_1 { trace_type } {
 	gdb_test "info trace" \
 	    "Num     Type\[ \]+Disp Enb Address\[ \]+What.*
 \[0-9\]+\[\t \]+\(|fast \)tracepoint\[ \]+keep y.*\<MULTIPLE\>.*
-4\.1.* in func4.*\tinstalled on target\r\n(4\.2.* in func4.*\tinstalled on target\r\n4\.3.* \<PENDING\>\[\t \]+set_tracepoint|4\.2.* \<PENDING\>\[\t \]+set_tracepoint.*4\.3.* in func4.*\tinstalled on target).*" \
-	    "tracepoint with two locations (unload)"
+(4\.\[1-3].* in func4.*\tinstalled on target.*){2}" \
+	    "tracepoint with two locations - installed (unload)"
+
+	gdb_test "info trace" \
+	    "Num     Type\[ \]+Disp Enb Address\[ \]+What.*
+\[0-9\]+\[\t \]+\(|fast \)tracepoint\[ \]+keep y.*\<MULTIPLE\>.*
+4\.\[1-3].* \<PENDING\>\[\t \]+set_tracepoint.*" \
+	    "tracepoint with two locations - pending (unload)"
 
 	gdb_test_no_output "tstop"
 
@@ -262,8 +268,14 @@ proc tracepoint_change_loc_2 { trace_type } {
 	gdb_test "info trace" \
 	    "Num     Type\[ \]+Disp Enb Address\[ \]+What.*
 \[0-9\]+\[\t \]+\(|fast \)tracepoint\[ \]+keep y.*\<MULTIPLE\>.*
-1\.1.* in func4.*\tinstalled on target\r\n(1\.2.* in func4.*\tinstalled on target\r\n1\.3.* \<PENDING\>\[\t \]+set_tracepoint|1\.2.* \<PENDING\>\[\t \]+set_tracepoint\r\n1\.3.* in func4.*\tinstalled on target).*" \
-	    "tracepoint with two locations (unload)"
+(1\.\[1-3].* in func4.*\tinstalled on target.*){2}" \
+	    "tracepoint with two locations - installed (unload)"
+
+	gdb_test "info trace" \
+	    "Num     Type\[ \]+Disp Enb Address\[ \]+What.*
+\[0-9\]+\[\t \]+\(|fast \)tracepoint\[ \]+keep y.*\<MULTIPLE\>.*
+1\.\[1-3].* \<PENDING\>\[\t \]+set_tracepoint.*" \
+	    "tracepoint with two locations - pending (unload)"
 
 	gdb_test_no_output "tstop"
 
-- 
2.7.2

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 1/8] gdb: Add ax_pseudo_register_collect for powerpc.
  2016-03-06 16:35 ` [PATCH 1/8] gdb: Add ax_pseudo_register_collect " Marcin Kościelnicki
@ 2016-03-09 17:20   ` Ulrich Weigand
  0 siblings, 0 replies; 20+ messages in thread
From: Ulrich Weigand @ 2016-03-09 17:20 UTC (permalink / raw)
  To: Marcin Kościelnicki; +Cc: gdb-patches, Marcin Kościelnicki

Marcin Kościelnicki wrote:

> 	* rs6000-tdep.c (rs6000_ax_pseudo_register_collect): New function.
> 	(rs6000_gdbarch_init): Wire in the above.

This is OK.

Bye,
Ulrich

-- 
  Dr. Ulrich Weigand
  GNU/Linux compilers and toolchain
  Ulrich.Weigand@de.ibm.com

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 2/8] gdb: Add gen_return_address for powerpc.
  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
  0 siblings, 0 replies; 20+ messages in thread
From: Ulrich Weigand @ 2016-03-09 17:20 UTC (permalink / raw)
  To: Marcin Kościelnicki; +Cc: gdb-patches, Marcin Kościelnicki

Marcin Kościelnicki wrote:

> 	* rs6000-tdep.c (rs6000_gen_return_address): New function.
> 	(rs6000_gdbarch_init): Wire in the above.

Needs ChangeLog entries for the added #include files.
Otherwise, this is OK.

Bye,
Ulrich

-- 
  Dr. Ulrich Weigand
  GNU/Linux compilers and toolchain
  Ulrich.Weigand@de.ibm.com

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 3/8] gdb/rs6000: Read backchain as unsigned.
  2016-03-06 16:40 ` [PATCH 3/8] gdb/rs6000: Read backchain as unsigned Marcin Kościelnicki
@ 2016-03-09 17:21   ` Ulrich Weigand
  0 siblings, 0 replies; 20+ messages in thread
From: Ulrich Weigand @ 2016-03-09 17:21 UTC (permalink / raw)
  To: Marcin Kościelnicki; +Cc: gdb-patches, Marcin Kościelnicki

Marcin Kościelnicki wrote:

> 	* corefile.c (safe_read_memory_unsigned_integer): New function.
> 	* gdbcore.h (safe_read_memory_unsigned_integer): New prototype.
> 	* rs6000-tdep.c (rs6000_frame_cache): Read backchain as unsigned.

This is OK.

Thanks,
Ulrich

-- 
  Dr. Ulrich Weigand
  GNU/Linux compilers and toolchain
  Ulrich.Weigand@de.ibm.com

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 4/8] gdb.trace: Use manually-defined start labels in unavailable-dwarf-piece.exp
  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
  0 siblings, 1 reply; 20+ messages in thread
From: Ulrich Weigand @ 2016-03-09 17:24 UTC (permalink / raw)
  To: Marcin Kościelnicki; +Cc: gdb-patches, Marcin Kościelnicki

Marcin Kościelnicki wrote:

> 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.

>  with_test_prefix "tracing foo" {
> -    gdb_test "trace foo" ".*"
> +    gdb_test "trace *foo_start_lbl" ".*"

Well, I'd have thought that "trace foo" should simply work as-is,
otherwise, this isn't particularly user-friedly ...

Is there a call to gdbarch_convert_from_func_ptr_addr missing
somewhere in the trace code, maybe?

Bye,
Ulrich

-- 
  Dr. Ulrich Weigand
  GNU/Linux compilers and toolchain
  Ulrich.Weigand@de.ibm.com

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 5/8] gdb.trace/change-loc.exp: Don't depend on tracepoint ordering.
  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
  0 siblings, 0 replies; 20+ messages in thread
From: Ulrich Weigand @ 2016-03-09 17:25 UTC (permalink / raw)
  To: Marcin Kościelnicki; +Cc: gdb-patches, Marcin Kościelnicki

Marcin Kościelnicki wrote:

> 	* gdb.trace/change-loc.exp: Don't depend on tracepoint location
> 	ordering.

This is OK.

Thanks,
Ulrich

-- 
  Dr. Ulrich Weigand
  GNU/Linux compilers and toolchain
  Ulrich.Weigand@de.ibm.com

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 6/8] gdb.trace/tfind.exp: Force call via global entry point on ppc64le.
  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
  0 siblings, 0 replies; 20+ messages in thread
From: Ulrich Weigand @ 2016-03-09 17:26 UTC (permalink / raw)
  To: Marcin Kościelnicki; +Cc: gdb-patches, Marcin Kościelnicki

Marcin Kościelnicki wrote:

> 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.

This is OK.

Thanks,
Ulrich

-- 
  Dr. Ulrich Weigand
  GNU/Linux compilers and toolchain
  Ulrich.Weigand@de.ibm.com

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 4/8] gdb.trace: Use manually-defined start labels in unavailable-dwarf-piece.exp
  2016-03-09 17:24   ` Ulrich Weigand
@ 2016-03-09 17:27     ` Marcin Kościelnicki
  2016-03-09 17:35       ` Ulrich Weigand
  0 siblings, 1 reply; 20+ messages in thread
From: Marcin Kościelnicki @ 2016-03-09 17:27 UTC (permalink / raw)
  To: Ulrich Weigand; +Cc: gdb-patches

On 09/03/16 18:24, Ulrich Weigand wrote:
> Marcin Kościelnicki wrote:
>
>> 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.
>
>>   with_test_prefix "tracing foo" {
>> -    gdb_test "trace foo" ".*"
>> +    gdb_test "trace *foo_start_lbl" ".*"
>
> Well, I'd have thought that "trace foo" should simply work as-is,
> otherwise, this isn't particularly user-friedly ...
>
> Is there a call to gdbarch_convert_from_func_ptr_addr missing
> somewhere in the trace code, maybe?

Don't worry, trace foo does work, but not for this particular test, 
because of the way the fake DWARF is emitted: before, the DWARF covered 
area from foo to foo_end_lbl, and thus a tracepoint set on foo worked 
just fine.  However, now the DWARF covers foo_start_lbl to foo_end_lbl - 
and function entry point (which is where the tracepoint is) is not covered.

>
> Bye,
> Ulrich
>

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 7/8] gdb.trace/entry-values.exp: Fixes for powerpc64.
  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
  0 siblings, 0 replies; 20+ messages in thread
From: Ulrich Weigand @ 2016-03-09 17:29 UTC (permalink / raw)
  To: Marcin Kościelnicki; +Cc: gdb-patches, Marcin Kościelnicki

Marcin Kościelnicki wrote:

> On powerpc64, "disassemble foo" doesn't work properly on object files
> (it can't process the relocations in .opd section)

Huh.  I thought that worked at some point.  This should probably be
fixed.  But that is certainly an independent problem.

For now, I guess the change to the tracepoint test case is fine.

> - instead, let's
> link it into an executable and load that.
> 
> Also, backtrace displays .main, not main.  Accept both.
> 
> gdb/testsuite/ChangeLog:
> 
> 	* gdb.trace/entry-values.exp: Link ${binfile}1.o to ${binfile}1 and
> 	use it for disassembly; accept .main in addition to main in backtrace.

This is OK.

Thanks,
Ulrich

-- 
  Dr. Ulrich Weigand
  GNU/Linux compilers and toolchain
  Ulrich.Weigand@de.ibm.com

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 8/8] gdb: Add tracepoint support for powerpc.
  2016-03-06 16:35 ` [PATCH 8/8] gdb: Add tracepoint support " Marcin Kościelnicki
@ 2016-03-09 17:33   ` Ulrich Weigand
  2016-03-09 17:48     ` Marcin Kościelnicki
  0 siblings, 1 reply; 20+ messages in thread
From: Ulrich Weigand @ 2016-03-09 17:33 UTC (permalink / raw)
  To: Marcin Kościelnicki; +Cc: gdb-patches, Marcin Kościelnicki

Marcin Kościelnicki wrote:

> gdb/gdbserver/ChangeLog:
> 
> 	* linux-ppc-low.c (ppc_supports_tracepoints): New function.
> 	(struct linux_target_ops): Wire in the above.
> 
> gdb/testsuite/ChangeLog:
> 
> 	* gdb.trace/ftrace.exp: Set arg0exp for ppc.
> 	* gdb.trace/mi-trace-unavailable.exp: Set pcnum for ppc.
> 	* gdb.trace/pending.exp: Accept leading dot before function name.
> 	* gdb.trace/trace-common.h: Add fast tracepoint dummy insn for ppc.
> 	* lib/trace-support.exp: Set registers for ppc.

This is OK, once the prerequiste patches are in.

Thanks,
Ulrich

-- 
  Dr. Ulrich Weigand
  GNU/Linux compilers and toolchain
  Ulrich.Weigand@de.ibm.com

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 4/8] gdb.trace: Use manually-defined start labels in unavailable-dwarf-piece.exp
  2016-03-09 17:27     ` Marcin Kościelnicki
@ 2016-03-09 17:35       ` Ulrich Weigand
  0 siblings, 0 replies; 20+ messages in thread
From: Ulrich Weigand @ 2016-03-09 17:35 UTC (permalink / raw)
  To: Marcin Kościelnicki; +Cc: gdb-patches

Marcin Kościelnicki wrote:
> On 09/03/16 18:24, Ulrich Weigand wrote:
> > Marcin Kościelnicki wrote:
> >
> >> 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.
> >
> >>   with_test_prefix "tracing foo" {
> >> -    gdb_test "trace foo" ".*"
> >> +    gdb_test "trace *foo_start_lbl" ".*"
> >
> > Well, I'd have thought that "trace foo" should simply work as-is,
> > otherwise, this isn't particularly user-friedly ...
> >
> > Is there a call to gdbarch_convert_from_func_ptr_addr missing
> > somewhere in the trace code, maybe?
> 
> Don't worry, trace foo does work, but not for this particular test, 
> because of the way the fake DWARF is emitted: before, the DWARF covered 
> area from foo to foo_end_lbl, and thus a tracepoint set on foo worked 
> just fine.  However, now the DWARF covers foo_start_lbl to foo_end_lbl - 
> and function entry point (which is where the tracepoint is) is not covered.

Ah, I see.

The patch is OK, then.

Thanks,
Ulrich

-- 
  Dr. Ulrich Weigand
  GNU/Linux compilers and toolchain
  Ulrich.Weigand@de.ibm.com

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 8/8] gdb: Add tracepoint support for powerpc.
  2016-03-09 17:33   ` Ulrich Weigand
@ 2016-03-09 17:48     ` Marcin Kościelnicki
  0 siblings, 0 replies; 20+ messages in thread
From: Marcin Kościelnicki @ 2016-03-09 17:48 UTC (permalink / raw)
  To: Ulrich Weigand; +Cc: gdb-patches

On 09/03/16 18:33, Ulrich Weigand wrote:
> Marcin Kościelnicki wrote:
>
>> gdb/gdbserver/ChangeLog:
>>
>> 	* linux-ppc-low.c (ppc_supports_tracepoints): New function.
>> 	(struct linux_target_ops): Wire in the above.
>>
>> gdb/testsuite/ChangeLog:
>>
>> 	* gdb.trace/ftrace.exp: Set arg0exp for ppc.
>> 	* gdb.trace/mi-trace-unavailable.exp: Set pcnum for ppc.
>> 	* gdb.trace/pending.exp: Accept leading dot before function name.
>> 	* gdb.trace/trace-common.h: Add fast tracepoint dummy insn for ppc.
>> 	* lib/trace-support.exp: Set registers for ppc.
>
> This is OK, once the prerequiste patches are in.
>
> Thanks,
> Ulrich
>

Thanks, all pushed.

^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2016-03-09 17:48 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-06 16:35 [PATCH 0/8] Add regular tracepoint support for powerpc Marcin Kościelnicki
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 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 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 2/8] gdb: Add gen_return_address for powerpc Marcin Kościelnicki
2016-03-09 17:20   ` Ulrich Weigand
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:35 ` [PATCH 8/8] gdb: Add tracepoint support " Marcin Kościelnicki
2016-03-09 17:33   ` Ulrich Weigand
2016-03-09 17:48     ` Marcin Kościelnicki
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

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).