public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
From: Tom Tromey <tromey@sourceware.org>
To: gdb-cvs@sourceware.org
Subject: [binutils-gdb] Add an assertion to clone_momentary_breakpoint
Date: Fri, 29 Apr 2022 22:22:04 +0000 (GMT)	[thread overview]
Message-ID: <20220429222204.B4A373858434@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=16922ea6adfe975e42aa2c6bf4a464069754496f

commit 16922ea6adfe975e42aa2c6bf4a464069754496f
Author: Tom Tromey <tom@tromey.com>
Date:   Thu Jan 13 16:50:18 2022 -0700

    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:
---
 gdb/breakpoint.c | 1 +
 1 file changed, 1 insertion(+)

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);
 }


                 reply	other threads:[~2022-04-29 22:22 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220429222204.B4A373858434@sourceware.org \
    --to=tromey@sourceware.org \
    --cc=gdb-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).