From: Pedro Alves Date: Fri, 12 Mar 2010 04:04:40 +0000 (+0000) Subject: * gdb.trace/backtrace.exp: Adjust for x86 and x86_64. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6a8f26716ab741331f724f92713d982fe47126da;p=binutils-gdb.git * 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. --- diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index ae6658a7066..2d6fbcd4b6b 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,12 @@ +2010-03-12 Pedro Alves + + * 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 * gdb.base/break-interp.exp: Create new displacement parameter value diff --git a/gdb/testsuite/gdb.trace/backtrace.exp b/gdb/testsuite/gdb.trace/backtrace.exp index 47d75be5c59..ea1a3718b94 100644 --- a/gdb/testsuite/gdb.trace/backtrace.exp +++ b/gdb/testsuite/gdb.trace/backtrace.exp @@ -146,9 +146,20 @@ gdb_trace_setactions "8.6: setup TP to collect regs, args, and locals" \ "$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" "" "" diff --git a/gdb/testsuite/gdb.trace/report.exp b/gdb/testsuite/gdb.trace/report.exp index fb7d6b0b3b1..9a038cbbe7d 100644 --- a/gdb/testsuite/gdb.trace/report.exp +++ b/gdb/testsuite/gdb.trace/report.exp @@ -155,9 +155,23 @@ gdb_trace_setactions "9.x: setup TP to collect locals" \ "$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" \ @@ -193,10 +207,11 @@ gdb_tfind_test "9.1: find frame for TP $tdp2" "tracepoint $tdp2" \ # 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" @@ -219,8 +234,8 @@ gdb_tfind_test "9.1: find frame for TP $tdp5" "tracepoint $tdp5" \ # 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" @@ -321,6 +336,7 @@ gdb_expect { } } +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" @@ -344,6 +360,7 @@ gdb_expect { } } +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" @@ -367,6 +384,7 @@ gdb_expect { } } +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" diff --git a/gdb/testsuite/gdb.trace/tfind.exp b/gdb/testsuite/gdb.trace/tfind.exp index 2f65436dcc8..9928c69f59f 100644 --- a/gdb/testsuite/gdb.trace/tfind.exp +++ b/gdb/testsuite/gdb.trace/tfind.exp @@ -147,7 +147,8 @@ gdb_expect { 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"]; @@ -333,7 +334,7 @@ set timeout 60 send_gdb "disassemble gdb_c_test\n" # look for disassembly of function label gdb_expect { - -re ":.*$gdb_prompt $" { pass "8.36: trace disassembly" } + -re ":.*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)" } } diff --git a/gdb/testsuite/gdb.trace/while-dyn.exp b/gdb/testsuite/gdb.trace/while-dyn.exp index de319801992..d379e1dc0dc 100644 --- a/gdb/testsuite/gdb.trace/while-dyn.exp +++ b/gdb/testsuite/gdb.trace/while-dyn.exp @@ -63,9 +63,17 @@ gdb_test "trace gdb_c_test" \ "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 " \ "" \ - "collect \$fp" "^$" \ + "collect $fpreg" "^$" \ "while-stepping 5" "^$" \ "collect p" "^$" \ "end" "^$" \