From patchwork Wed May 24 16:36:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 69969 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 41CA238323F0 for ; Wed, 24 May 2023 16:38:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 41CA238323F0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1684946334; bh=/CG1Lv+ItoQLBCN4LTcPmK7nXWRzTHizZ1KyTUArPnM=; h=Date:Subject:References:In-Reply-To:To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=CeuN/t/1bHE+OXPEAu5eQuCUGfSuMGbxjjsxF+EivmQfh3lFeGwAIwFpslN5fqkyB m+7VYVs/ccLbOwdxStwea+3GOwXa1CSjZTJGeupqhQr10RtG4Y8c4Y7SG6kmzUABWM Kr1Ay10waZ2kuH1CgWl670yadGJdnzv+OLmOCDak= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from mail-io1-xd31.google.com (mail-io1-xd31.google.com [IPv6:2607:f8b0:4864:20::d31]) by sourceware.org (Postfix) with ESMTPS id EFBCB3857711 for ; Wed, 24 May 2023 16:37:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org EFBCB3857711 Received: by mail-io1-xd31.google.com with SMTP id ca18e2360f4ac-76c64da0e46so36174239f.0 for ; Wed, 24 May 2023 09:37:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684946248; x=1687538248; h=to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/CG1Lv+ItoQLBCN4LTcPmK7nXWRzTHizZ1KyTUArPnM=; b=Gzns7oSCs5ctD0Eyj89IcfwR0hM8SQxhFbcJJpZIo0AaYJmKZooFK7VA4NjIaRZrWV VBO+YGGkbl5ieMMKMEVoBUdsbz4UHWThrDnhL5dNGE8FzEFje4CrGQb4Mt4+5Y5eAnTd iZUKtx/LT4lUeL7yv8xOhBxPcGiJhwU5NJ0+83uZGQ++ylzUuy2+JJM84DkaCQzhMS7r QPDh8XKlGxCWJ9As+Ienq1OVxdQ48HRSgTYzH7cWOYg7fSc/UlXAltgN9iLSp44RjgiU 0rXAkPxS8rqbaWBTazsEkoeF6fh0J9XiGttOuEe7iTjwL0uox6B0/Use+NYrK1LxM2Qq gRYA== X-Gm-Message-State: AC+VfDxK5cvjJZ3qJISg0i/opqxXE1Scx3U4trzVbo1O1kYyKefadbDF SMso71vvchQ2+s70g+fa+gsduINC6SYDKAEmq2R2iA== X-Google-Smtp-Source: ACHHUZ5mRTbsSaguPvodgkH3Dx4jq9eJnbsyFvTHc96g+sw7RqOmTjLGBCanmKlNOrLHedXwCx4StQ== X-Received: by 2002:a5e:d610:0:b0:774:982e:cb0a with SMTP id w16-20020a5ed610000000b00774982ecb0amr865858iom.15.1684946248173; Wed, 24 May 2023 09:37:28 -0700 (PDT) Received: from localhost.localdomain (71-211-130-244.hlrn.qwest.net. [71.211.130.244]) by smtp.gmail.com with ESMTPSA id o22-20020a6bcf16000000b0076c81bf2731sm3397266ioa.20.2023.05.24.09.37.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 May 2023 09:37:27 -0700 (PDT) Date: Wed, 24 May 2023 10:36:58 -0600 Subject: [PATCH 07/25] Mark members of ada_catchpoint "private" MIME-Version: 1.0 Message-Id: <20230427-ada-catch-exception-v1-7-947caa9905e3@adacore.com> References: <20230427-ada-catch-exception-v1-0-947caa9905e3@adacore.com> In-Reply-To: <20230427-ada-catch-exception-v1-0-947caa9905e3@adacore.com> To: gdb-patches@sourceware.org X-Mailer: b4 0.12.2 X-Spam-Status: No, score=-11.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, 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-Patchwork-Original-From: Tom Tromey via Gdb-patches From: Tom Tromey Reply-To: Tom Tromey Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" This changes the members of ada_catchpoint to be private. --- gdb/ada-lang.c | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index d8c7492551c..6ee507147cb 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -12142,7 +12142,7 @@ struct ada_catchpoint : public code_breakpoint bool from_tty, std::string &&excep_string_) : code_breakpoint (gdbarch_, bp_catchpoint, tempflag), - excep_string (std::move (excep_string_)), + m_excep_string (std::move (excep_string_)), m_kind (kind) { add_location (sal); @@ -12186,6 +12186,8 @@ struct ada_catchpoint : public code_breakpoint void print_mention () const override; void print_recreate (struct ui_file *fp) const override; +private: + /* A helper function for check_status. Returns true if we should stop for this breakpoint hit. If the user specified a specific exception, we only want to cause a stop if the program thrown @@ -12193,7 +12195,7 @@ struct ada_catchpoint : public code_breakpoint bool should_stop_exception (const struct bp_location *bl) const; /* The name of the specific exception the user specified. */ - std::string excep_string; + std::string m_excep_string; /* What kind of catchpoint this is. */ enum ada_exception_catchpoint_kind m_kind; @@ -12229,7 +12231,7 @@ ada_catchpoint::re_set () location. */ /* Nothing to do if there's no specific exception to catch. */ - if (excep_string.empty ()) + if (m_excep_string.empty ()) return; /* Same if there are no locations... */ @@ -12239,7 +12241,7 @@ ada_catchpoint::re_set () /* Compute the condition expression in text form, from the specific expection we want to catch. */ std::string cond_string - = ada_exception_catchpoint_cond_string (excep_string.c_str (), m_kind); + = ada_exception_catchpoint_cond_string (m_excep_string.c_str (), m_kind); /* Iterate over all the catchpoint's locations, and parse an expression for each. */ @@ -12316,7 +12318,7 @@ ada_catchpoint::should_stop_exception (const struct bp_location *bl) const } /* With no specific exception, should always stop. */ - if (c->excep_string.empty ()) + if (c->m_excep_string.empty ()) return true; if (ada_loc->excep_cond_expr == NULL) @@ -12456,10 +12458,10 @@ ada_catchpoint::print_one (bp_location **last_loc) const switch (m_kind) { case ada_catch_exception: - if (!excep_string.empty ()) + if (!m_excep_string.empty ()) { std::string msg = string_printf (_("`%s' Ada exception"), - excep_string.c_str ()); + m_excep_string.c_str ()); uiout->field_string ("what", msg); } @@ -12473,11 +12475,11 @@ ada_catchpoint::print_one (bp_location **last_loc) const break; case ada_catch_handlers: - if (!excep_string.empty ()) + if (!m_excep_string.empty ()) { uiout->field_fmt ("what", _("`%s' Ada exception handlers"), - excep_string.c_str ()); + m_excep_string.c_str ()); } else uiout->field_string ("what", "all Ada exceptions handlers"); @@ -12511,10 +12513,10 @@ ada_catchpoint::print_mention () const switch (m_kind) { case ada_catch_exception: - if (!excep_string.empty ()) + if (!m_excep_string.empty ()) { std::string info = string_printf (_("`%s' Ada exception"), - excep_string.c_str ()); + m_excep_string.c_str ()); uiout->text (info); } else @@ -12526,11 +12528,11 @@ ada_catchpoint::print_mention () const break; case ada_catch_handlers: - if (!excep_string.empty ()) + if (!m_excep_string.empty ()) { std::string info = string_printf (_("`%s' Ada exception handlers"), - excep_string.c_str ()); + m_excep_string.c_str ()); uiout->text (info); } else @@ -12557,8 +12559,8 @@ ada_catchpoint::print_recreate (struct ui_file *fp) const { case ada_catch_exception: gdb_printf (fp, "catch exception"); - if (!excep_string.empty ()) - gdb_printf (fp, " %s", excep_string.c_str ()); + if (!m_excep_string.empty ()) + gdb_printf (fp, " %s", m_excep_string.c_str ()); break; case ada_catch_exception_unhandled: