diff options
author | Pedro Alves <palves@redhat.com> | 2010-03-12 04:04:40 +0000 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2010-03-12 04:04:40 +0000 |
commit | 6a8f26716ab741331f724f92713d982fe47126da (patch) | |
tree | e4146dc4cf86ea8db85b3c4da03adf6b3fcda1bc /gdb | |
parent | 2f4d88753bc52c1104d9418fb843154ee8ef610c (diff) | |
download | gdb-6a8f26716ab741331f724f92713d982fe47126da.zip gdb-6a8f26716ab741331f724f92713d982fe47126da.tar.gz gdb-6a8f26716ab741331f724f92713d982fe47126da.tar.bz2 |
* 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.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/testsuite/ChangeLog | 9 | ||||
-rw-r--r-- | gdb/testsuite/gdb.trace/backtrace.exp | 15 | ||||
-rw-r--r-- | gdb/testsuite/gdb.trace/report.exp | 30 | ||||
-rw-r--r-- | gdb/testsuite/gdb.trace/tfind.exp | 5 | ||||
-rw-r--r-- | gdb/testsuite/gdb.trace/while-dyn.exp | 10 |
5 files changed, 58 insertions, 11 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index ae6658a..2d6fbcd 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,12 @@ +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 diff --git a/gdb/testsuite/gdb.trace/backtrace.exp b/gdb/testsuite/gdb.trace/backtrace.exp index 47d75be..ea1a371 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 fb7d6b0..9a038cb 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 2f65436..9928c69 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_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)" } } diff --git a/gdb/testsuite/gdb.trace/while-dyn.exp b/gdb/testsuite/gdb.trace/while-dyn.exp index de31980..d379e1d 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 <stepcount>" \ "" \ - "collect \$fp" "^$" \ + "collect $fpreg" "^$" \ "while-stepping 5" "^$" \ "collect p" "^$" \ "end" "^$" \ |