From 0688d04e19c0e6305c1034eb5e97a66458fd805a Mon Sep 17 00:00:00 2001 From: Markus Metzger Date: Wed, 17 Apr 2013 09:39:43 +0200 Subject: 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 * 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. --- gdb/testsuite/gdb.btrace/function_call_history.exp | 5 +++-- gdb/testsuite/gdb.btrace/instruction_history.exp | 8 +++++--- 2 files changed, 8 insertions(+), 5 deletions(-) (limited to 'gdb/testsuite/gdb.btrace') 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\]+ :\tje 0x\[0-9a-f\]+ " \ "3\t 0x\[0-9a-f\]+ :\tdec %eax" \ "4\t 0x\[0-9a-f\]+ :\tjmp 0x\[0-9a-f\]+ " \ @@ -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\]+ \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\]+ :\tje 0x\[0-9a-f\]+ " \ "3\t0x\[0-9a-f\]+ :\tdec %eax" \ "4\t0x\[0-9a-f\]+ :\tjmp 0x\[0-9a-f\]+ " \ @@ -89,7 +89,7 @@ gdb_test "record instruction-history /p 7,-5" [join [list \ "6\t0x\[0-9a-f\]+ :\tje 0x\[0-9a-f\]+ \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\]+ " \ "3\t0x\[0-9a-f\]+ <\\+\[0-9\]+>:\tdec %eax" \ "4\t0x\[0-9a-f\]+ <\\+\[0-9\]+>:\tjmp 0x\[0-9a-f\]+ " \ @@ -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\]+ \r" \ ] "\r\n"] +gdb_test "record instruction-history 2,2" "2\t 0x\[0-9a-f\]+ :\tje 0x\[0-9a-f\]+ \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. -- cgit v1.1