Re: [PATCH 05/12] gdb: rename displaced_step_fixup to displaced_step_finish

Pedro Alves
2020-11-25T01:29:24Z

On 11/10/20 9:46 PM, Simon Marchi via Gdb-patches wrote:
> This is a preparatory patch to reduce a little bit the diff size of the
> main patch later in this series. It renames the displaced_step_fixup
> function in infrun.c to displaced_step_finish.
>
> The rationale is to better differentiate the low and high level
> operations.
>
> We first have the low level operation of writing an instruction to a
> displaced buffer, called "copy_insn". The mirror low level operation to
> fix up the state after having executed the instruction is "fixup". The
> high level operation of preparing a thread for a displaced step (which
> includes doing the "copy_insn" and some more bookkeeping) is called
> "prepare" (as in displaced_step_prepare). The mirror high level
> operation to cleaning up after a displaced step (which includes doing
> the "fixup" and some more bookkeeping) is currently also called "fixup"
> (as in displaced_step_fixup), just like the low level operation.
>
> I think that choosing a different name for the low and high level
> cleanup operation makes it clearer, hence "finish".
>
> gdb/ChangeLog:
>
> * infrun.c (displaced_step_fixup): Rename to...
> (displaced_step_finish): ... this, update all callers.

OK.