From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2126) id B4A373858434; Fri, 29 Apr 2022 22:22:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B4A373858434 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Tom Tromey To: gdb-cvs@sourceware.org Subject: [binutils-gdb] Add an assertion to clone_momentary_breakpoint X-Act-Checkin: binutils-gdb X-Git-Author: Tom Tromey X-Git-Refname: refs/heads/master X-Git-Oldrev: 4e9e993a7e7e741703474f0ae4e311657cec4a60 X-Git-Newrev: 16922ea6adfe975e42aa2c6bf4a464069754496f Message-Id: <20220429222204.B4A373858434@sourceware.org> Date: Fri, 29 Apr 2022 22:22:04 +0000 (GMT) X-BeenThere: gdb-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Apr 2022 22:22:04 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D16922ea6adfe= 975e42aa2c6bf4a464069754496f commit 16922ea6adfe975e42aa2c6bf4a464069754496f Author: Tom Tromey Date: Thu Jan 13 16:50:18 2022 -0700 Add an assertion to clone_momentary_breakpoint =20 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 =3D=3D NULL) return NULL; =20 + gdb_assert (orig->ops =3D=3D &momentary_breakpoint_ops); return momentary_breakpoint_from_master (orig, orig->type, orig->ops, 0); }