]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
gdb: build dprintf commands just once in code_breakpoint constructor
authorAndrew Burgess <aburgess@redhat.com>
Wed, 5 Apr 2023 15:12:05 +0000 (16:12 +0100)
committerAndrew Burgess <aburgess@redhat.com>
Sun, 31 Mar 2024 10:13:34 +0000 (11:13 +0100)
commit8b4141cdb03e48826e2935529be7fd7499f9d815
tree9acadf18c4d1a4aa8edcf6d459c9bc6271530683
parent437d237a547def823434dd656e5c138a2263dd5c
gdb: build dprintf commands just once in code_breakpoint constructor

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.
gdb/breakpoint.c