aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.btrace
diff options
context:
space:
mode:
authorMarkus Metzger <markus.t.metzger@intel.com>2013-04-17 09:39:43 +0200
committerMarkus Metzger <markus.t.metzger@intel.com>2014-01-16 13:05:38 +0100
commit0688d04e19c0e6305c1034eb5e97a66458fd805a (patch)
treebe934314a7c9e9afd80c3488d38eb71c8a25a367 /gdb/testsuite/gdb.btrace
parent8710b7097e6564969c5e417007a438d8f4ab710e (diff)
downloadgdb-0688d04e19c0e6305c1034eb5e97a66458fd805a.zip
gdb-0688d04e19c0e6305c1034eb5e97a66458fd805a.tar.gz
gdb-0688d04e19c0e6305c1034eb5e97a66458fd805a.tar.bz2
record-btrace: make ranges include begin and end
The "record function-call-history" and "record instruction-history" commands accept a range "begin, end". End is not included in both cases. Include it. 2014-01-16 Markus Metzger <markus.t.metzger@intel.com> * record-btrace.c (record_btrace_insn_history_range): Include end. (record_btrace_insn_history_from): Adjust range. (record_btrace_call_history_range): Include end. (record_btrace_call_history_from): Adjust range. * NEWS: Announce changes. testsuite/ * gdb.btrace/function_call_history.exp: Update tests. * gdb.btrace/instruction_history.exp: Update tests. doc/ * gdb.texinfo (Process Record and Replay): Update documentation.
Diffstat (limited to 'gdb/testsuite/gdb.btrace')
-rw-r--r--gdb/testsuite/gdb.btrace/function_call_history.exp5
-rw-r--r--gdb/testsuite/gdb.btrace/instruction_history.exp8
2 files changed, 8 insertions, 5 deletions
diff --git a/gdb/testsuite/gdb.btrace/function_call_history.exp b/gdb/testsuite/gdb.btrace/function_call_history.exp
index f7a9233..935fc22 100644
--- a/gdb/testsuite/gdb.btrace/function_call_history.exp
+++ b/gdb/testsuite/gdb.btrace/function_call_history.exp
@@ -183,9 +183,10 @@ set expected_range [join [list \
"10\tinc"] "\r\n"]
# show functions in instruction range
-gdb_test "record function-call-history 4,11" $expected_range
+gdb_test "record function-call-history 4,10" $expected_range
gdb_test "record function-call-history 4,+7" $expected_range
-gdb_test "record function-call-history 11,-7" $expected_range
+gdb_test "record function-call-history 10,-7" $expected_range
+gdb_test "record function-call-history 4,4" "4\tinc\r"
# set bp after fib recursion and continue
set bp_location [gdb_get_line_number "bp.2" $testfile.c]
diff --git a/gdb/testsuite/gdb.btrace/instruction_history.exp b/gdb/testsuite/gdb.btrace/instruction_history.exp
index 46ef65e..5769345 100644
--- a/gdb/testsuite/gdb.btrace/instruction_history.exp
+++ b/gdb/testsuite/gdb.btrace/instruction_history.exp
@@ -65,7 +65,7 @@ if { $traced != 6 } {
}
# test that we see the expected instructions
-gdb_test "record instruction-history 2,7" [join [list \
+gdb_test "record instruction-history 2,6" [join [list \
"2\t 0x\[0-9a-f\]+ <loop\\+\[0-9\]+>:\tje 0x\[0-9a-f\]+ <loop\\+\[0-9\]+>" \
"3\t 0x\[0-9a-f\]+ <loop\\+\[0-9\]+>:\tdec %eax" \
"4\t 0x\[0-9a-f\]+ <loop\\+\[0-9\]+>:\tjmp 0x\[0-9a-f\]+ <loop\\+\[0-9\]+>" \
@@ -81,7 +81,7 @@ gdb_test "record instruction-history /f 2,+5" [join [list \
"6\t 0x\[0-9a-f\]+ <\\+\[0-9\]+>:\tje 0x\[0-9a-f\]+ <loop\\+\[0-9\]+>\r" \
] "\r\n"]
-gdb_test "record instruction-history /p 7,-5" [join [list \
+gdb_test "record instruction-history /p 6,-5" [join [list \
"2\t0x\[0-9a-f\]+ <loop\\+\[0-9\]+>:\tje 0x\[0-9a-f\]+ <loop\\+\[0-9\]+>" \
"3\t0x\[0-9a-f\]+ <loop\\+\[0-9\]+>:\tdec %eax" \
"4\t0x\[0-9a-f\]+ <loop\\+\[0-9\]+>:\tjmp 0x\[0-9a-f\]+ <loop\\+\[0-9\]+>" \
@@ -89,7 +89,7 @@ gdb_test "record instruction-history /p 7,-5" [join [list \
"6\t0x\[0-9a-f\]+ <loop\\+\[0-9\]+>:\tje 0x\[0-9a-f\]+ <loop\\+\[0-9\]+>\r" \
] "\r\n"]
-gdb_test "record instruction-history /pf 2,7" [join [list \
+gdb_test "record instruction-history /pf 2,6" [join [list \
"2\t0x\[0-9a-f\]+ <\\+\[0-9\]+>:\tje 0x\[0-9a-f\]+ <loop\\+\[0-9\]+>" \
"3\t0x\[0-9a-f\]+ <\\+\[0-9\]+>:\tdec %eax" \
"4\t0x\[0-9a-f\]+ <\\+\[0-9\]+>:\tjmp 0x\[0-9a-f\]+ <loop\\+\[0-9\]+>" \
@@ -97,6 +97,8 @@ gdb_test "record instruction-history /pf 2,7" [join [list \
"6\t0x\[0-9a-f\]+ <\\+\[0-9\]+>:\tje 0x\[0-9a-f\]+ <loop\\+\[0-9\]+>\r" \
] "\r\n"]
+gdb_test "record instruction-history 2,2" "2\t 0x\[0-9a-f\]+ <loop\\+\[0-9\]+>:\tje 0x\[0-9a-f\]+ <loop\\+\[0-9\]+>\r"
+
# the following tests are checking the iterators
# to avoid lots of regexps, we just check the number of lines that
# were printed during command execution.