aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/lib/trace-support.exp
diff options
context:
space:
mode:
authorMarcin Koƛcielnicki <koriakin@0x04.net>2015-11-10 09:52:29 +0100
committerMarcin Koƛcielnicki <koriakin@0x04.net>2015-11-10 20:05:49 +0100
commit6e7675a70f5a375159f94354fb6f38519303a73d (patch)
treedc2be4cddf5ff77dcf9817f29555a0de4ad58fd9 /gdb/testsuite/lib/trace-support.exp
parent6b21c2bf57ecb18d7df949391ffc178f00b85630 (diff)
downloadgdb-6e7675a70f5a375159f94354fb6f38519303a73d.zip
gdb-6e7675a70f5a375159f94354fb6f38519303a73d.tar.gz
gdb-6e7675a70f5a375159f94354fb6f38519303a73d.tar.bz2
gdb/testsuite/gdb.trace: Deduplicate pcreg/spreg/fpreg.
These variables were used in many gdb.trace tests. Keep them in one place, to reduce work needed for new targets. gdb/testsuite/ChangeLog: * gdb.trace/backtrace.exp: Use global fpreg/spreg definition, add $ in front. * gdb.trace/change-loc.exp: Use global pcreg definition. * gdb.trace/collection.exp: Use global pcreg/fpreg/spreg definition. * gdb.trace/entry-values.exp: Use global spreg definition, add $ in front. * gdb.trace/mi-trace-frame-collected.exp: Use global pcreg definition. * gdb.trace/pending.exp: Likewise. * gdb.trace/report.exp: Use global pcreg/fpreg/spreg definition. * gdb.trace/trace-break.exp: Likewise. * gdb.trace/trace-condition.exp: Use global pcreg definition, add $ in front. * gdb.trace/unavailable.exp: Use global pcreg/fpreg/spreg definition. * gdb.trace/while-dyn.exp: Use global fpreg definition, add $ in front. * lib/trace-support.exp: Define fpreg, spreg, pcreg variables.
Diffstat (limited to 'gdb/testsuite/lib/trace-support.exp')
-rw-r--r--gdb/testsuite/lib/trace-support.exp23
1 files changed, 23 insertions, 0 deletions
diff --git a/gdb/testsuite/lib/trace-support.exp b/gdb/testsuite/lib/trace-support.exp
index 0af73b4..4ec8cac 100644
--- a/gdb/testsuite/lib/trace-support.exp
+++ b/gdb/testsuite/lib/trace-support.exp
@@ -20,6 +20,29 @@
#
+# Program counter / stack pointer / frame pointer for supported targets.
+# Used in many tests, kept here to avoid duplication.
+#
+
+if [is_amd64_regs_target] {
+ set fpreg "rbp"
+ set spreg "rsp"
+ set pcreg "rip"
+} elseif [is_x86_like_target] {
+ set fpreg "ebp"
+ set spreg "esp"
+ set pcreg "eip"
+} elseif [is_aarch64_target] {
+ set fpreg "x29"
+ set spreg "sp"
+ set pcreg "pc"
+} else {
+ set fpreg "fp"
+ set spreg "sp"
+ set pcreg "pc"
+}
+
+#
# Procedure: gdb_target_supports_trace
# Returns true if GDB is connected to a target that supports tracing.
# Allows tests to abort early if not running on a trace-aware target.