Fix use after free introduced by $_hit_bpnum/$_hit_locno variables.
authorPhilippe Waroquiers <philippe.waroquiers@skynet.be>
Sun, 20 Nov 2022 10:11:27 +0000 (11:11 +0100)
committerPhilippe Waroquiers <philippe.waroquiers@skynet.be>
Mon, 21 Nov 2022 20:15:20 +0000 (21:15 +0100)
commit83f350830ee561ddc799d1445c6024a84df9f161
tree29880fb16a28a2b7cb63c26fafab0b85f508d532
parente66c9edea34ce13e7a6769996e1d151505d8cd3e
Fix use after free introduced by $_hit_bpnum/$_hit_locno variables.

If the commands of the bpstat bs contain commands such as step or next or
continue, the BS and its commands are freed by execute_control_command.

So, we cannot remember the BS that was printed. Instead, remember
the bpnum and locno.

Regtested on debian/amd64 and re-run a few tests under valgrind.
gdb/breakpoint.c