gdb, testsuite: fix TCL error in 'gdb.base/structs.exp'
Checks
Commit Message
A failure of 'runto_main' in 'start_structs_test' results in a TCL
error. The return value of 'start_structs_test' function is evaluated
inside an if conditional clause, which expects a boolean value. Return
'-1' on failure to avoid the error.
---
gdb/testsuite/gdb.base/structs.exp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On 12/4/24 5:41 AM, Stephan Rohr wrote:
> A failure of 'runto_main' in 'start_structs_test' results in a TCL
> error. The return value of 'start_structs_test' function is evaluated
> inside an if conditional clause, which expects a boolean value. Return
> '-1' on failure to avoid the error.
Kinda funny to return -1 as a boolean value, so I was compelled to look
into this. This is consistent with the rest of `start_structs_test',
so this is fine. [Tcl doesn't care anyway.]
Good catch!
Reviewed-By: Keith Seitz <keiths@redhat.com>
Keith
>>>>> "Keith" == Keith Seitz <keiths@redhat.com> writes:
Keith> Reviewed-By: Keith Seitz <keiths@redhat.com>
Thanks Keith. I agree it is ok.
Approved-By: Tom Tromey <tom@tromey.com>
Tom
@@ -68,7 +68,7 @@ proc start_structs_test { types } {
# Advance to main
if {![runto_main]} {
- return
+ return -1
}
# Get the debug format