This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
instruction_history.exp unset variable [Re: [patch v4 21/24] record-btrace: show trace from enable location]
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: Markus Metzger <markus dot t dot metzger at intel dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Sun, 18 Aug 2013 21:10:04 +0200
- Subject: instruction_history.exp unset variable [Re: [patch v4 21/24] record-btrace: show trace from enable location]
- References: <1372842874-28951-1-git-send-email-markus dot t dot metzger at intel dot com> <1372842874-28951-22-git-send-email-markus dot t dot metzger at intel dot com>
On Wed, 03 Jul 2013 11:14:31 +0200, Markus Metzger wrote:
> --- a/gdb/testsuite/gdb.btrace/instruction_history.exp
> +++ b/gdb/testsuite/gdb.btrace/instruction_history.exp
> @@ -56,42 +56,42 @@ gdb_test_multiple "info record" $testname {
> }
> }
>
> -# we have exactly 6 instructions here
> -set message "exactly 6 instructions"
> -if { $traced != 6 } {
> +# we have exactly 11 instructions here
> +set message "exactly 11 instructions"
> +if { $traced != 11 } {
> fail $message
> } else {
> pass $message
> }
Not related to this patch but here is a bug:
set testname "determine number of recorded instructions"
gdb_test_multiple "info record" $testname {
-re "Active record target: record-btrace\r\nRecorded \(\[0-9\]*\) instructions in \(\[0-9\]*\) functions for thread 1 .*\\.\r\n$gdb_prompt $" {
set traced $expect_out(1,string)
set traced_functions $expect_out(2,string)
pass $testname
}
}
# we have exactly 11 instructions here
set message "exactly 11 instructions"
if { $traced != 11 } {
[...]
If the first test FAILs then the testcase aborts (aborting also other tests in
its group):
Running ./gdb.btrace/instruction_history.exp ...
FAIL: gdb.btrace/instruction_history.exp: record btrace
FAIL: gdb.btrace/instruction_history.exp: determine number of recorded instructions
ERROR: tcl error sourcing ./gdb.btrace/instruction_history.exp.
ERROR: can't read "traced": no such variable
while executing
"if { $traced != 11 } {
fail $message
} else {
pass $message
}"
[...]
There should be some
set traced ""
before gdb_test_multiple.
BTW $traced_functions is not used anywhere.
Jan