From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id AlJ8Aw1gpWovDwQAWB0awg (envelope-from ) for ; Sat, 12 Sep 2026 10:22:05 -0400 Authentication-Results: simark.ca; dkim=fail reason="signature verification failed" (768-bit key; unprotected) header.d=tromey.com header.i=@tromey.com header.a=rsa-sha256 header.s=default header.b=mgz1aOA4; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id CF6271E167; Sat, 12 Sep 2026 10:22:04 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-5.1 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_INVALID,DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [IPv6:2620:52:6:3111::32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 9D4F51E09B for ; Sat, 12 Sep 2026 10:22:03 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 117FE4B920FE for ; Sat, 12 Sep 2026 14:21:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 117FE4B920FE Authentication-Results: sourceware.org; dkim=fail reason="signature verification failed" (768-bit key, unprotected) header.d=tromey.com header.i=@tromey.com header.a=rsa-sha256 header.s=default header.b=mgz1aOA4 Received: from omta038.useast.a.cloudfilter.net (omta038.useast.a.cloudfilter.net [44.202.169.37]) by sourceware.org (Postfix) with ESMTPS id 895C94BB5908 for ; Sat, 12 Sep 2026 14:21:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 895C94BB5908 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tromey.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 895C94BB5908 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=44.202.169.37 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1789222887; cv=none; b=Wf0jIo/Kuxaj2LFGxlPujowMeBD/wQ/6fIOJsiHOr82kxlU4pK+Rgtt7QqDj+ntWZv/BJ7MjGpYrRqOm2jyAeQ8jL5cO8IdoVx6dQmoRD1IzdYdR5T9cAuqUKCx1wlvmcBg455Mg0JLVDiEvPXwrgG/T7knhktK6PZHqQ1jdY3U= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1789222887; c=relaxed/simple; bh=KVO8przzxIVagNpUVKTk+6biF75s5Gv98svmz3fOs50=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=KlDl6bUGIxjkafkeZlFm8yEc+7cvBUwG/+dYZ1pCeMqGtqkgIFsRamXYZSyXiATdocmFZPr8o+DFDmYJOeXoyKV/Fdk5LSp2iMRfTYPGfab5iZ1t9EIz4ITAAZFKumYJvt5kEWTHazXRecR3v91zxxuBiOxiLTJlNkZAEzAqAWM= ARC-Authentication-Results: i=1; sourceware.org; dkim=policy (768-bit key, unprotected) header.d=tromey.com header.i=@tromey.com header.a=rsa-sha256 header.s=default header.b=mgz1aOA4 reason="signing key too small" DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 895C94BB5908 Received: from eig-obgw-6003b.ext.cloudfilter.net ([10.0.30.175]) by cmsmtp with ESMTPS id 5CZGxIOvfJFmF5ObcxP6x6; Sat, 12 Sep 2026 14:21:24 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id 5ObaxtuwoUNmN5ObaxDBQ4; Sat, 12 Sep 2026 14:21:22 +0000 X-Authority-Analysis: v=2.4 cv=BpKdwZX5 c=1 sm=1 tr=0 ts=6aa55fe2 a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=VdqzKS8jKosA:10 a=ItBw4LHWJt0A:10 a=dJYk9HiZgkZnkv0Xc6cA:9 a=DCx65vhANUyCzuf5D8fC:22 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Transfer-Encoding:MIME-Version:Message-ID:Date:Subject: Cc:To:From:Sender:Reply-To:Content-Type:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Unsubscribe-Post:List-Subscribe:List-Post:List-Owner:List-Archive; bh=r6dU1q6uGORckoeP0N07T7eU0ZmzK+OJ7mbyjbE/zaI=; b=mgz1aOA4DYmjK2yfmNAkM0YMty vPwUjbpZKI5sDZRP/Dtv7t5gNYs4i3P2y3yKat7T6dIn8cdgXT8PnpehzXint5vfUSXg5ttErUi+C IMa68QmSDxIArlkwwn+r7XHLe; Received: from 97-122-117-2.hlrn.qwest.net ([97.122.117.2]:39830 helo=localhost.localdomain) by box5379.bluehost.com with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.100) (envelope-from ) id 1x5Oba-00000002KzQ-03uA; Sat, 12 Sep 2026 08:21:22 -0600 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH] Fix inheritance of finish_breakpoint_object Date: Sat, 12 Sep 2026 08:21:15 -0600 Message-ID: <20260912142115.3717539-1-tom@tromey.com> X-Mailer: git-send-email 2.49.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - sourceware.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 97.122.117.2 X-Source-L: No X-Exim-ID: 1x5Oba-00000002KzQ-03uA X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 97-122-117-2.hlrn.qwest.net (localhost.localdomain) [97.122.117.2]:39830 X-Source-Auth: tom+tromey.com X-Email-Count: 1 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfO7KC0yKHocuioeWqiR0GzhZg+dvTQgjMCMlQsq21DXr6e+zDwnbm1cp8ucLVzjnCXhJ30cOYQamoaRCHpxbWLaCq3eOm+J60tmPKH5zYE1xc5p9UAZO b9VeoawXzxO2Yp2PCtapMjNX1UiEDVG3vnww3OEZuApuSBbdt/Ec124ntz5AfRKK3EoVZNJSddpzjPhyqG+jkxIrvdVPTeexYdg= X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org I noticed that finish_breakpoint_object does not derive from PyObject, but instead uses the older C-style inheritance. This patch fixes this. --- gdb/python/py-finishbreakpoint.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/gdb/python/py-finishbreakpoint.c b/gdb/python/py-finishbreakpoint.c index 49e12c00054..f5548636398 100644 --- a/gdb/python/py-finishbreakpoint.c +++ b/gdb/python/py-finishbreakpoint.c @@ -36,11 +36,8 @@ static const char outofscope_func[] = "out_of_scope"; /* struct implementing the gdb.FinishBreakpoint object by extending the gdb.Breakpoint class. */ -struct finish_breakpoint_object +struct finish_breakpoint_object : public gdbpy_breakpoint_object { - /* gdb.Breakpoint base class. */ - gdbpy_breakpoint_object py_bp; - /* gdb.Symbol object of the function finished by this breakpoint. nullptr if no debug information was available or return type was VOID. */ @@ -301,7 +298,7 @@ bpfinishpy_init (PyObject *self, PyObject *args, PyObject *kwargs) self_bpfinish->function_value = nullptr; } - bppy_pending_object = &self_bpfinish->py_bp; + bppy_pending_object = self_bpfinish; bppy_pending_object->number = -1; bppy_pending_object->bp = NULL; @@ -325,12 +322,12 @@ bpfinishpy_init (PyObject *self, PyObject *args, PyObject *kwargs) return gdbpy_handle_gdb_exception (-1, except); } - self_bpfinish->py_bp.bp->frame_id = frame_id; - self_bpfinish->py_bp.is_finish_bp = 1; + self_bpfinish->bp->frame_id = frame_id; + self_bpfinish->is_finish_bp = 1; self_bpfinish->initiating_frame = get_frame_id (frame); /* Bind the breakpoint with the current program space. */ - self_bpfinish->py_bp.bp->pspace = current_program_space; + self_bpfinish->bp->pspace = current_program_space; return 0; } @@ -345,7 +342,7 @@ bpfinishpy_out_of_scope (struct finish_breakpoint_object *bpfinish_obj) gdbpy_breakpoint_object *bp_obj = (gdbpy_breakpoint_object *) bpfinish_obj; PyObject *py_obj = (PyObject *) bp_obj; - if (bpfinish_obj->py_bp.bp->enable_state == bp_enabled + if (bpfinish_obj->bp->enable_state == bp_enabled && PyObject_HasAttrString (py_obj, outofscope_func)) { gdbpy_ref<> meth_result = gdbpy_call_method (py_obj, outofscope_func); @@ -388,7 +385,7 @@ bpfinishpy_detect_out_scope_cb (struct breakpoint *b, { bpfinishpy_out_of_scope (finish_bp); if (delete_bp) - delete_breakpoint (finish_bp->py_bp.bp); + delete_breakpoint (finish_bp->bp); } } catch (const gdb_exception &except) -- 2.49.0