aboutsummaryrefslogtreecommitdiff
path: root/gdb/ada-lang.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/ada-lang.c')
-rw-r--r--gdb/ada-lang.c54
1 files changed, 12 insertions, 42 deletions
diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index 25c49c5..f90907a 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -12257,14 +12257,11 @@ static const struct bp_location_ops ada_catchpoint_location_ops =
ada_catchpoint_location_dtor
};
-/* An instance of this type is used to represent an Ada catchpoint.
- It includes a "struct breakpoint" as a kind of base class; users
- downcast to "struct breakpoint *" when needed. */
+/* An instance of this type is used to represent an Ada catchpoint. */
-struct ada_catchpoint
+struct ada_catchpoint : public breakpoint
{
- /* The base class. */
- struct breakpoint base;
+ ~ada_catchpoint () override;
/* The name of the specific exception the user specified. */
char *excep_string;
@@ -12285,7 +12282,7 @@ create_excep_cond_exprs (struct ada_catchpoint *c)
return;
/* Same if there are no locations... */
- if (c->base.loc == NULL)
+ if (c->loc == NULL)
return;
/* Compute the condition expression in text form, from the specific
@@ -12295,7 +12292,7 @@ create_excep_cond_exprs (struct ada_catchpoint *c)
/* Iterate over all the catchpoint's locations, and parse an
expression for each. */
- for (bl = c->base.loc; bl != NULL; bl = bl->next)
+ for (bl = c->loc; bl != NULL; bl = bl->next)
{
struct ada_catchpoint_location *ada_loc
= (struct ada_catchpoint_location *) bl;
@@ -12316,7 +12313,7 @@ create_excep_cond_exprs (struct ada_catchpoint *c)
{
warning (_("failed to reevaluate internal exception condition "
"for catchpoint %d: %s"),
- c->base.number, e.message);
+ c->number, e.message);
}
END_CATCH
}
@@ -12327,17 +12324,11 @@ create_excep_cond_exprs (struct ada_catchpoint *c)
do_cleanups (old_chain);
}
-/* Implement the DTOR method in the breakpoint_ops structure for all
- exception catchpoint kinds. */
+/* ada_catchpoint destructor. */
-static void
-dtor_exception (enum ada_exception_catchpoint_kind ex, struct breakpoint *b)
+ada_catchpoint::~ada_catchpoint ()
{
- struct ada_catchpoint *c = (struct ada_catchpoint *) b;
-
- xfree (c->excep_string);
-
- bkpt_breakpoint_ops.dtor (b);
+ xfree (this->excep_string);
}
/* Implement the ALLOCATE_LOCATION method in the breakpoint_ops
@@ -12623,12 +12614,6 @@ print_recreate_exception (enum ada_exception_catchpoint_kind ex,
/* Virtual table for "catch exception" breakpoints. */
-static void
-dtor_catch_exception (struct breakpoint *b)
-{
- dtor_exception (ada_catch_exception, b);
-}
-
static struct bp_location *
allocate_location_catch_exception (struct breakpoint *self)
{
@@ -12675,12 +12660,6 @@ static struct breakpoint_ops catch_exception_breakpoint_ops;
/* Virtual table for "catch exception unhandled" breakpoints. */
-static void
-dtor_catch_exception_unhandled (struct breakpoint *b)
-{
- dtor_exception (ada_catch_exception_unhandled, b);
-}
-
static struct bp_location *
allocate_location_catch_exception_unhandled (struct breakpoint *self)
{
@@ -12729,12 +12708,6 @@ static struct breakpoint_ops catch_exception_unhandled_breakpoint_ops;
/* Virtual table for "catch assert" breakpoints. */
-static void
-dtor_catch_assert (struct breakpoint *b)
-{
- dtor_exception (ada_catch_assert, b);
-}
-
static struct bp_location *
allocate_location_catch_assert (struct breakpoint *self)
{
@@ -13060,13 +13033,13 @@ create_ada_exception_catchpoint (struct gdbarch *gdbarch,
= ada_exception_sal (ex_kind, excep_string, &addr_string, &ops);
c = new ada_catchpoint ();
- init_ada_exception_breakpoint (&c->base, gdbarch, sal, addr_string,
+ init_ada_exception_breakpoint (c, gdbarch, sal, addr_string,
ops, tempflag, disabled, from_tty);
c->excep_string = excep_string;
create_excep_cond_exprs (c);
if (cond_string != NULL)
- set_breakpoint_condition (&c->base, cond_string, from_tty);
- install_breakpoint (0, &c->base, 1);
+ set_breakpoint_condition (c, cond_string, from_tty);
+ install_breakpoint (0, c, 1);
}
/* Implement the "catch exception" command. */
@@ -14090,7 +14063,6 @@ initialize_ada_catchpoint_ops (void)
ops = &catch_exception_breakpoint_ops;
*ops = bkpt_breakpoint_ops;
- ops->dtor = dtor_catch_exception;
ops->allocate_location = allocate_location_catch_exception;
ops->re_set = re_set_catch_exception;
ops->check_status = check_status_catch_exception;
@@ -14101,7 +14073,6 @@ initialize_ada_catchpoint_ops (void)
ops = &catch_exception_unhandled_breakpoint_ops;
*ops = bkpt_breakpoint_ops;
- ops->dtor = dtor_catch_exception_unhandled;
ops->allocate_location = allocate_location_catch_exception_unhandled;
ops->re_set = re_set_catch_exception_unhandled;
ops->check_status = check_status_catch_exception_unhandled;
@@ -14112,7 +14083,6 @@ initialize_ada_catchpoint_ops (void)
ops = &catch_assert_breakpoint_ops;
*ops = bkpt_breakpoint_ops;
- ops->dtor = dtor_catch_assert;
ops->allocate_location = allocate_location_catch_assert;
ops->re_set = re_set_catch_assert;
ops->check_status = check_status_catch_assert;