This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: "optimized out" on gdb.base/gdb1090.exp
On Tue, 12 Apr 2011 15:44:29 +0200, Edjunior Barbosa Machado wrote:
> My only concern is if this check in the same frame will not affect the main
> purpose of the testcase.
One should find the fix, I do not see it obvious which one it is.
> --- a/gdb/testsuite/gdb.base/gdb1090.exp
> +++ b/gdb/testsuite/gdb.base/gdb1090.exp
> @@ -40,12 +40,9 @@ gdb_start
> gdb_reinitialize_dir $srcdir/$subdir
> gdb_load ${binfile}
> -if ![runto marker] then {
> - perror "couldn't run to breakpoint"
> - continue
> -}
> -gdb_test "up" ".*foo.*" "up from marker"
> +gdb_breakpoint [gdb_get_line_number "break-here"]
> +gdb_run_cmd
gdb_run_cmd produces output which is not caught anywhere here. This will
result in testcase races.
BTW runto expects a function name, not file:line notation.
This is why the pair
gdb_breakpoint [gdb_get_line_number "break-here"]
gdb_continue_to_breakpoint "break-here" ".* break-here .*"
is popular.
> gdb_test_multiple "print s24" "print s24" {
> -re "\\\$\[0-9\]* = \\{field_0 = 1170, field_1 = 64701\\}\r\n$gdb_prompt $" {
> pass "print s24"
Thanks,
Jan