From: Tom Tromey Date: Thu, 13 Jan 2022 23:50:18 +0000 (-0700) Subject: Add an assertion to clone_momentary_breakpoint X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=16922ea6adfe975e42aa2c6bf4a464069754496f;p=binutils-gdb.git Add an assertion to clone_momentary_breakpoint This adds an assertion to clone_momentary_breakpoint. This will eventually be removed, but in the meantime is is useful for helping convince oneself that momentary breakpoints will always use momentary_breakpoint_ops. This understanding will help when cleaning up the code later. --- diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index 683b24beb7e..4864bc79ee1 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -7959,6 +7959,7 @@ clone_momentary_breakpoint (struct breakpoint *orig) if (orig == NULL) return NULL; + gdb_assert (orig->ops == &momentary_breakpoint_ops); return momentary_breakpoint_from_master (orig, orig->type, orig->ops, 0); }