Re: [PATCH 1/2] PowerPC: fix for gdb.reverse/finish-precsave.exp and gdb.reverse/finish-reverse.exp

Tom Tromey
2023-03-09T19:04:01Z

>>>>> "Carl" == Carl Love via Gdb-patches <gdb-patches@sourceware.org> writes:

Carl> Procedure proc_step_until from test gdb.reverse/step-indirect-call-thunk.exp

The "proc_" in there seems incorrect.

Carl> # Step until the pattern REGEXP is found. Step at most
Carl> # MAX_STEPS times, but stop stepping once REGEXP is found.
Carl> -#
Carl> +# CURRENT matches current location
Carl> # If REGEXP is found then a single pass is emitted, otherwise, after
Carl> # MAX_STEPS steps, a single fail is emitted.
Carl> #
Carl> # TEST_NAME is the name used in the pass/fail calls.

Carl> -proc gdb_step_until { regexp {test_name ""} {max_steps 10} } {
Carl> +proc gdb_step_until { regexp {test_name ""} {current ""} \
Carl> + { max_steps 10 } } {
Carl> + if { $current == "" } {
Carl> + set current "\}"
Carl> + }
Carl> + if { $test_name == "" } {
Carl> + set test_name "stepping until regexp"
Carl> + }

I think you can just supply these as defaults directly in the proc
definition.

Carl> +# Do repeated stepping COMMANDs in order to reach TARGET from CURRENT
Carl> +#
Carl> +# COMMAND is a stepping command
Carl> +# CURRENT is a string matching the current location
Carl> +# TARGET is a string matching the target location
Carl> +# TEST is the test name
Carl> +# MAX_STEPS is number of steps attempted before fail is emitted
Carl> +#
Carl> +# The function issues repeated COMMANDs as long as the location matches
Carl> +# CURRENT up to a maximum of 100 steps.

s/100/MAX_STEPS

Carl> +#
Carl> +# TEST passes if the resulting location matches TARGET and fails
Carl> +# otherwise.
Carl> +#
Carl> +proc repeat_cmd_until { command current target test_name {max_steps 100} } {

The docs refer to "TEST" but should use "TEST_NAME".

thanks,
Tom