From: Tom Tromey <tromey@adacore.com>
To: gdb-patches@sourceware.org
Subject: [PATCH 07/25] Mark members of ada_catchpoint "private"
Date: Wed, 24 May 2023 10:36:58 -0600 [thread overview]
Message-ID: <20230427-ada-catch-exception-v1-7-947caa9905e3@adacore.com> (raw)
In-Reply-To: <20230427-ada-catch-exception-v1-0-947caa9905e3@adacore.com>
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:
--
2.40.0
next prev parent reply other threads:[~2023-05-24 16:37 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-24 16:36 [PATCH 00/25] Many updates to DAP implementation Tom Tromey
2023-05-24 16:36 ` [PATCH 01/25] Stop gdb in gnat_runtime_has_debug_info Tom Tromey
2023-05-24 16:36 ` [PATCH 02/25] Use gnat_runtime_has_debug_info in Ada catchpoint tests Tom Tromey
2023-06-13 20:10 ` Tom de Vries
2023-06-19 9:49 ` Tom de Vries
2023-06-20 13:56 ` Tom Tromey
2023-05-24 16:36 ` [PATCH 03/25] Pass tempflag to ada_catchpoint constructor Tom Tromey
2023-05-24 16:36 ` [PATCH 04/25] Transfer ownership of exception string to ada_catchpoint Tom Tromey
2023-05-24 16:36 ` [PATCH 05/25] Combine create_excep_cond_exprs and ada_catchpoint::re_set Tom Tromey
2023-05-24 16:36 ` [PATCH 06/25] Turn should_stop_exception into a method of ada_catchpoint Tom Tromey
2023-05-24 16:36 ` Tom Tromey [this message]
2023-05-24 16:36 ` [PATCH 08/25] Don't require inferior execution for Ada catchpoints Tom Tromey
2023-05-24 16:37 ` [PATCH 09/25] Implement DAP setExceptionBreakpoints request Tom Tromey
2023-05-24 16:37 ` [PATCH 10/25] Implement DAP attach request Tom Tromey
2023-05-24 16:53 ` Eli Zaretskii
2023-05-24 16:37 ` [PATCH 11/25] Implement DAP stepOut request Tom Tromey
2023-05-24 16:37 ` [PATCH 12/25] Add singleThread support to some DAP requests Tom Tromey
2023-05-24 16:37 ` [PATCH 13/25] Rename one DAP function Tom Tromey
2023-05-24 16:37 ` [PATCH 14/25] Add test for DAP pause request Tom Tromey
2023-05-24 16:37 ` [PATCH 15/25] Fix a latent bug in DAP request decorator Tom Tromey
2023-05-24 16:37 ` [PATCH 16/25] Use tuples for default arguments in DAP Tom Tromey
2023-05-24 16:37 ` [PATCH 17/25] Add type-checking to DAP requests Tom Tromey
2023-05-24 16:37 ` [PATCH 18/25] Add gdb.Value.assign method Tom Tromey
2023-05-24 16:54 ` Eli Zaretskii
2023-05-24 16:37 ` [PATCH 19/25] Implement DAP setExpression request Tom Tromey
2023-05-24 16:37 ` [PATCH 20/25] Handle DAP supportsVariableType capability Tom Tromey
2023-05-24 16:37 ` [PATCH 21/25] Add "target" parameter to DAP attach request Tom Tromey
2023-05-24 16:55 ` Eli Zaretskii
2023-05-24 16:37 ` [PATCH 22/25] Add "stop at main" extension to DAP launch request Tom Tromey
2023-05-24 16:56 ` Eli Zaretskii
2023-05-24 16:37 ` [PATCH 23/25] Implement DAP breakpointLocations request Tom Tromey
2023-05-24 16:37 ` [PATCH 24/25] Do not report totalFrames from DAP stackTrace request Tom Tromey
2023-05-24 16:37 ` [PATCH 25/25] Implement DAP conditional breakpoints Tom Tromey
2023-06-12 18:11 ` [PATCH 00/25] Many updates to DAP implementation Tom Tromey
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=20230427-ada-catch-exception-v1-7-947caa9905e3@adacore.com \
--to=tromey@adacore.com \
--cc=gdb-patches@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).