aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorEdjunior Barbosa Machado <emachado@linux.vnet.ibm.com>2011-05-02 17:07:10 +0000
committerEdjunior Barbosa Machado <emachado@linux.vnet.ibm.com>2011-05-02 17:07:10 +0000
commitb4cbb4a3654f62d901ff0537f317fe3f197f52d4 (patch)
tree302977165be6c7836182a2c079a391c7a5288d14 /gdb
parentfde6f1fc677f2dabc5f81d73b80d36b0d75a722d (diff)
downloadgdb-b4cbb4a3654f62d901ff0537f317fe3f197f52d4.zip
gdb-b4cbb4a3654f62d901ff0537f317fe3f197f52d4.tar.gz
gdb-b4cbb4a3654f62d901ff0537f317fe3f197f52d4.tar.bz2
* gdb.opt/inline-cmds.exp: Adjust checks with "finish" command to
accept to show the caller line again as well as the line after.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/testsuite/ChangeLog5
-rw-r--r--gdb/testsuite/gdb.opt/inline-cmds.exp25
2 files changed, 28 insertions, 2 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 470f0d8..e531f69 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2011-05-02 Edjunior Machado <emachado@linux.vnet.ibm.com>
+
+ * gdb.opt/inline-cmds.exp: Adjust checks with "finish" command to
+ accept to show the caller line again as well as the line after.
+
2011-04-29 Phil Muldoon <pmuldoon@redhat.com>
PR mi/12531
diff --git a/gdb/testsuite/gdb.opt/inline-cmds.exp b/gdb/testsuite/gdb.opt/inline-cmds.exp
index cde86f5..cb5f96f 100644
--- a/gdb/testsuite/gdb.opt/inline-cmds.exp
+++ b/gdb/testsuite/gdb.opt/inline-cmds.exp
@@ -263,7 +263,20 @@ gdb_continue_to_breakpoint "finish into func1"
gdb_test "next" ".*marker \\\(\\\);" "next to finish marker"
gdb_test "step" ".*set breakpoint 2 here.*" "step into finish marker"
-gdb_test "finish" "func1 \\\(\\\);" "finish from marker to func1"
+
+# Some architectures will have one or more instructions after
+# the call instruction which still are part of the call sequence,
+# so it should be expected to return to the caller line after issue
+# a 'finish' command.
+gdb_test_multiple "finish" "finish from marker" {
+ -re "func1 \\\(\\\);.*\r\n$gdb_prompt $" {
+ pass "finish from marker to func1"
+ }
+ -re "marker \\\(\\\);.*\r\n$gdb_prompt $" {
+ pass "finish from marker"
+ gdb_test "step" "func1 \\\(\\\);.*" "step after marker to reach func1"
+ }
+}
gdb_test "step" "bar \\\(\\\);" "step into func1 for finish"
gdb_test "finish" "func3 \\\(\\\);" "finish from func1 to func3"
@@ -273,7 +286,15 @@ set line6 [gdb_get_line_number "set breakpoint 6 here"]
gdb_breakpoint $line6
gdb_continue_to_breakpoint "before the outer_inline call"
gdb_test "step" "marker \\\(\\\) at .*" "reach 1 the outer_inline call"
-gdb_test "finish" "main \\\(\\\) at .*outer_inline2 \\\(\\\);" "reach outer_inline2"
+gdb_test_multiple "finish" "finish from marker" {
+ -re "main \\\(\\\) at .*outer_inline2 \\\(\\\);.*\r\n$gdb_prompt $" {
+ pass "reach outer_inline2"
+ }
+ -re "main \\\(\\\) at .*marker \\\(\\\);.*\r\n$gdb_prompt $" {
+ pass "finish from marker"
+ gdb_test "step" "outer_inline2 \\\(\\\);.*" "step after marker to reach outer_inline2"
+ }
+}
gdb_test "bt" "#0 main.*" "backtrace at main of outer_inline"
gdb_test "step" "outer_inline2 \\\(\\\) at .*" "enter outer_inline2"
gdb_test "bt" "#0 outer_inline2.*#1 main.*" "backtrace at outer_inline2"