This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

instruction_history.exp unset variable [Re: [patch v4 21/24] record-btrace: show trace from enable location]


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]