* gdb.trace/report.exp: Adjust for x86 and x86_64.
Issue a tfind end before looking for a tracepoint frame.
* gdb.trace/tfind.exp: Adjust tstatus output.
Adjust disassembly output.
* gdb.trace/while-dyn.exp: Adjust for x86 and x86_64.
+2010-03-12 Pedro Alves <pedro@codesourcery.com>
+
+ * gdb.trace/backtrace.exp: Adjust for x86 and x86_64.
+ * gdb.trace/report.exp: Adjust for x86 and x86_64.
+ Issue a tfind end before looking for a tracepoint frame.
+ * gdb.trace/tfind.exp: Adjust tstatus output.
+ Adjust disassembly output.
+ * gdb.trace/while-dyn.exp: Adjust for x86 and x86_64.
+
2010-03-11 Jan Kratochvil <jan.kratochvil@redhat.com>
* gdb.base/break-interp.exp: Create new displacement parameter value
"$tdp4" \
"collect \$regs, \$args, \$locs" "^$"
+if [istarget "x86_64-*"] then {
+ set fpreg "\$rbp"
+ set spreg "\$rsp"
+} elseif [istarget "i?86-*"] then {
+ set fpreg "\$ebp"
+ set spreg "\$esp"
+} else {
+ set fpreg "\$fp"
+ set spreg "\$sp"
+}
+
gdb_trace_setactions "8.6: setup TP to collect stack mem cast expr" \
- "$tdp6" \
- "collect \$fp, \(\*\(void \*\*\) \(\$sp\)\) @ 64" "^$"
+ "$tdp6" \
+ "collect $fpreg, \(\*\(void \*\*\) \($spreg\)\) @ 64" "^$"
gdb_test "tstart" "" ""
"$tdp4" \
"collect \$locs" "^$"
+if [istarget "x86_64-*"] then {
+ set fpreg "rbp"
+ set spreg "rsp"
+ set pcreg "rip"
+} elseif [istarget "i?86-*"] then {
+ set fpreg "ebp"
+ set spreg "esp"
+ set pcreg "eip"
+} else {
+ set fpreg "fp"
+ set spreg "sp"
+ set pcreg "pc"
+}
+
gdb_trace_setactions "9.x: setup TP to collect stack memory" \
"$tdp5" \
- "collect \$fp, \*\(void \*\*\) \$sp @ 64" "^$"
+ "collect \$$fpreg, \*\(void \*\*\) \$$spreg @ 64" "^$"
gdb_trace_setactions "9.x: setup TP to collect expressions" \
"$tdp6" \
# regs were collected at tdp2.
# How to match for the output of "info registers" on an unknown architecture?
-# For now, assume that every architecture has a register called "pc".
+# For now, assume that most architectures have a register called "pc".
+
gdb_test "tdump" \
- "\[\r\n\]pc .*" \
- "9.1: tdump, regs collected"
+ "\[\r\n\]$pcreg .*" \
+ "9.1: tdump, regs collected"
gdb_tfind_test "9.1: find frame for TP $tdp3" "tracepoint $tdp3" \
"\$tracepoint" "$tdp3"
# stack was collected at tdp5, plus the frame pointer
gdb_test "tdump" \
- ".fp = .*sp @ 64 = .*" \
- "9.1: tdump, memrange collected"
+ ".$fpreg = .*$spreg @ 64 = .*" \
+ "9.1: tdump, memrange collected"
gdb_tfind_test "9.1: find frame for TP $tdp6" "tracepoint $tdp6" \
"\$tracepoint" "$tdp6"
}
}
+gdb_tfind_test "12.2: tfind end, selects no frame" "end" "-1"
gdb_tfind_test "12.2: find first TDP #2 frame" "tracepoint $tdp2" \
"\$tracepoint" "$tdp2"
}
}
+gdb_tfind_test "12.3: tfind end, selects no frame" "end" "-1"
gdb_tfind_test "12.3: find first TDP #3 frame" "tracepoint $tdp3" \
"\$tracepoint" "$tdp3"
}
}
+gdb_tfind_test "12.4: tfind end, selects no frame" "end" "-1"
gdb_tfind_test "12.4: find first TDP #6 frame" "tracepoint $tdp6" \
"\$tracepoint" "$tdp6"
gdb_test "help tstop" "Stop trace data collection." "7.2: help tstop"
# test tstatus (when trace off)
-gdb_test "tstatus" "\[Tt\]race.* not running.*" "test tstatus off"
+gdb_test "tstatus" "Trace stopped by a tstop command.*" \
+ "test tstatus off after tstop"
## record starting PC
set save_pc [gdb_readexpr "(unsigned long) \$pc"];
send_gdb "disassemble gdb_c_test\n"
# look for disassembly of function label
gdb_expect {
- -re "<gdb_c_test>:.*$gdb_prompt $" { pass "8.36: trace disassembly" }
+ -re "<gdb_c_test(\.\[0-9\]+|)>:.*End of assembler dump.*$gdb_prompt $" { pass "8.36: trace disassembly" }
-re ".*$gdb_prompt $" { fail "8.36: trace disassembly" }
timeout { fail "8.36: trace disassembly (timeout)" }
}
"Tracepoint $decimal at .*" \
"Set tracepoint at gdb_c_test"
+if [istarget "x86_64-*"] then {
+ set fpreg "\$rbp"
+} elseif [istarget "i?86-*"] then {
+ set fpreg "\$ebp"
+} else {
+ set fpreg "\$fp"
+}
+
gdb_trace_setactions "5.12: define while-stepping <stepcount>" \
"" \
- "collect \$fp" "^$" \
+ "collect $fpreg" "^$" \
"while-stepping 5" "^$" \
"collect p" "^$" \
"end" "^$" \