Add an assertion to clone_momentary_breakpoint
authorTom Tromey <tom@tromey.com>
Thu, 13 Jan 2022 23:50:18 +0000 (16:50 -0700)
committerTom Tromey <tom@tromey.com>
Fri, 29 Apr 2022 22:14:30 +0000 (16:14 -0600)
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.

gdb/breakpoint.c

index 683b24beb7e78a824890cfc981622c428021cb7b..4864bc79ee12d2c1043073bf6fba5535082b7d61 100644 (file)
@@ -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);
 }