From: "Marcin Kościelnicki" <koriakin@0x04.net>
To: gdb-patches@sourceware.org
Cc: "Marcin Kościelnicki" <koriakin@0x04.net>
Subject: [PATCH 8/8] gdb: Add tracepoint support for powerpc.
Date: Sun, 06 Mar 2016 16:35:00 -0000 [thread overview]
Message-ID: <1457282097-7201-9-git-send-email-koriakin@0x04.net> (raw)
In-Reply-To: <1457282097-7201-1-git-send-email-koriakin@0x04.net>
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
next prev 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 " Marcin Kościelnicki
2016-03-06 16:35 ` [PATCH 2/8] gdb: Add gen_return_address " 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 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 ` Marcin Kościelnicki [this message]
2016-03-09 17:33 ` [PATCH 8/8] gdb: Add tracepoint support for powerpc 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-9-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).