From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-f51.google.com (mail-wr1-f51.google.com [209.85.221.51]) by sourceware.org (Postfix) with ESMTPS id A38FC385740B for ; Mon, 16 May 2022 18:40:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A38FC385740B Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=palves.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wr1-f51.google.com with SMTP id a5so17904687wrp.7 for ; Mon, 16 May 2022 11:40:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Do0pHy+IHKhn04auRfXv9XEan39wwuT/PP/FDLWN9x8=; b=VDSIkPWiYwzYQCZZmb9w7gPAiLzofbbnavi1ttfaUjVrOR5VlNNLXBFp/Jf4WVSekL LyPefUEIbzO0vflKEji8Z5QGGq1M+zgsyZ6mggqMQ+NDsHk8s5w4TIqL7BbawbGp6fGW j/ARx7j6JG6oAJ3TdKDZSVXIjcgwQSiPQnRgMxWLDGjWLSgc6RKV2KEhLXlHqA5LXkg0 O2ylc27wBi8xAhrBaYlI38BUitvLCraFv1FGiocJnLK0EXgLpK5zSOcs1Oh/+tWytlvT MYBBDBaAG7ahirjkkFLe6+HPOYdzOg+gHWqO0pP744dQYCBT26rE6XCZNLQAB/3gfKmO JL4g== X-Gm-Message-State: AOAM532WTiH+ZgC3/VmAvKuOYwrKmjI5mME9dD31f80IuyLZ+D2M4kMc 9EFHjl8IDKYLniv/NC2PHKmIYTkrIn4= X-Google-Smtp-Source: ABdhPJwOqTJYAV1gSZv5ZNMoYiHrpa1IZNl7shJ1hGCzn/H/Ci7EU5FqNpSC6H1FrDoGp7WG/Bn0Pw== X-Received: by 2002:a05:6000:144c:b0:20c:9156:539c with SMTP id v12-20020a056000144c00b0020c9156539cmr15844226wrx.249.1652726436844; Mon, 16 May 2022 11:40:36 -0700 (PDT) Received: from localhost ([2001:8a0:f924:2600:209d:85e2:409e:8726]) by smtp.gmail.com with ESMTPSA id f25-20020a1c6a19000000b003942a244f45sm20456wmc.30.2022.05.16.11.40.35 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 16 May 2022 11:40:35 -0700 (PDT) From: Pedro Alves To: gdb-patches@sourceware.org Subject: [PATCH 02/23] Make structs breakpoint/base_breakpoint/catchpoint be abstract Date: Mon, 16 May 2022 19:40:09 +0100 Message-Id: <20220516184030.665489-3-pedro@palves.net> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220516184030.665489-1-pedro@palves.net> References: <20220516184030.665489-1-pedro@palves.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2022 18:40:40 -0000 You should never instanciate these types directly. Change-Id: I8086c74c415eadbd44924bb0ef20f34b5b97ee6f --- gdb/breakpoint.c | 15 +++++++++++++++ gdb/breakpoint.h | 6 +++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index 385c92a6e7b..8f6794511e7 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -252,6 +252,21 @@ static const struct breakpoint_ops tracepoint_probe_breakpoint_ops = create_breakpoints_sal, }; +/* Implementation of abstract dtors. These must exist to satisfy the + linker. */ + +breakpoint::~breakpoint () +{ +} + +base_breakpoint::~base_breakpoint () +{ +} + +catchpoint::~catchpoint () +{ +} + /* The structure to be used in regular breakpoints. */ struct ordinary_breakpoint : public base_breakpoint { diff --git a/gdb/breakpoint.h b/gdb/breakpoint.h index fb8651c55c3..b7e3b4dc6a1 100644 --- a/gdb/breakpoint.h +++ b/gdb/breakpoint.h @@ -631,7 +631,7 @@ struct breakpoint DISABLE_COPY_AND_ASSIGN (breakpoint); - virtual ~breakpoint () = default; + virtual ~breakpoint () = 0; /* Allocate a location for this breakpoint. */ virtual struct bp_location *allocate_location (); @@ -862,6 +862,8 @@ struct base_breakpoint : public breakpoint { using breakpoint::breakpoint; + ~base_breakpoint () override = 0; + void re_set () override; int insert_location (struct bp_location *) override; int remove_location (struct bp_location *, @@ -1023,6 +1025,8 @@ struct catchpoint : public base_breakpoint COND_STRING is not NULL, then store it in the breakpoint. */ catchpoint (struct gdbarch *gdbarch, bool temp, const char *cond_string); + ~catchpoint () override = 0; + void re_set () override { /* For catchpoints, the default is to do nothing. */ -- 2.36.0