Re: [PATCHv9 05/14] gdb: build dprintf commands just once in code_breakpoint constructor

Andrew Burgess
2024-03-31T10:28:22Z

Andrew Burgess <aburgess@redhat.com> writes:

> I noticed in code_breakpoint::code_breakpoint that we are calling
> update_dprintf_command_list once for each breakpoint location, when we
> really only need to call this once per breakpoint -- the data updated
> by this function, the breakpoint command list -- is per breakpoint,
> not per breakpoint location. Calling update_dprintf_command_list
> multiple times is just wasted effort, there's no per location error
> checking, we don't even pass the current location to the function.
>
> This commit moves the update_dprintf_command_list call outside of the
> per-location loop.
>
> There should be no user visible changes after this commit.

I've gone ahead and committed this patch.

Thanks,
Andrew