aboutsummaryrefslogtreecommitdiff
path: root/gdb/ada-lang.c
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2011-07-25 11:21:08 +0000
committerPedro Alves <palves@redhat.com>2011-07-25 11:21:08 +0000
commit2060206eaf1f2784e57b350612dc6901504b526f (patch)
tree6b28266e5fd6b58262d42a6e2acc1309894b2019 /gdb/ada-lang.c
parent001c8c333dd8a6fe452203185e57cbcd1a21c57c (diff)
downloadgdb-2060206eaf1f2784e57b350612dc6901504b526f.zip
gdb-2060206eaf1f2784e57b350612dc6901504b526f.tar.gz
gdb-2060206eaf1f2784e57b350612dc6901504b526f.tar.bz2
2011-07-25 Pedro Alves <pedro@codesourcery.com>
* ada-lang.c (dtor_exception, re_set_exception): Indirect through the the base class ops table. (catch_exception_breakpoint_ops) (catch_exception_unhandled_breakpoint_ops) (catch_assert_breakpoint_ops): Don't statically initialize. (initialize_ada_catchpoint_ops): New. (_initialize_ada_language): Call it. * breakpoint.c (base_breakpoint_ops, bkpt_base_breakpoint_ops) (bkpt_breakpoint_ops): Forward declare. (catch_fork_breakpoint_ops, catch_vfork_breakpoint_ops) (catch_syscall_breakpoint_ops, catch_exec_breakpoint_ops) (ranged_breakpoint_ops, watchpoint_breakpoint_ops) (masked_watchpoint_breakpoint_ops) (gnu_v3_exception_catchpoint_ops): Don't statically initialize. (dtor_catch_syscall, dtor_catch_exec): Indirect through the the base class ops table. (null_re_set, null_check_status, null_works_in_software_mode) (null_resources_needed, null_print_one_detail): Delete. (bkpt_dtor): Rename to ... (base_breakpoint_dtor): ... this. Make static. (bkpt_allocate_location): Rename to ... (base_breakpoint_allocate_location): ... this. Make static. (base_breakpoint_re_set): New. (internal_error_pure_virtual_called): New. (base_breakpoint_insert_location, base_breakpoint_remove_location) (base_breakpoint_breakpoint_hit, base_breakpoint_check_status) (base_breakpoint_works_in_software_mode) (base_breakpoint_resources_needed, base_breakpoint_print_it) (base_breakpoint_print_one_detail, base_breakpoint_print_mention) (base_breakpoint_print_recreate): New functions. (base_breakpoint_ops): New global. (bkpt_re_set, bkpt_insert_location, bkpt_remove_location) (bkpt_breakpoint_hit): Make static. (bkpt_check_status): Delete. (bkpt_resources_needed): Make static. (bkpt_works_in_software_mode): Delete. (bkpt_print_it, bkpt_print_mention, bkpt_print_recreate): Make static. (bkpt_breakpoint_ops, internal_breakpoint_ops) (momentary_breakpoint_ops): Don't statically initialize. (internal_bkpt_print_recreate, momentary_bkpt_print_recreate): Delete. (tracepoint_insert_location, tracepoint_remove_location) (tracepoint_check_status, tracepoint_works_in_software_mode) (tracepoint_print_it): Delete. (tracepoint_breakpoint_ops): Don't statically initialize. (initialize_breakpoint_ops): New. (_initialize_breakpoint): Call it. * breakpoint.h (null_re_set, null_works_in_software_mode) (null_resources_needed, null_check_status, null_print_one_detail): (bkpt_dtor, bkpt_allocate_location, bkpt_re_set) (bkpt_insert_location, bkpt_remove_location, bkpt_breakpoint_hit) (bkpt_check_status, bkpt_resources_needed) (bkpt_works_in_software_mode, bkpt_print_it) (null_print_one_detail, bkpt_print_mention, bkpt_print_recreate): Delete declarations. (initialize_breakpoint_ops): Declare.
Diffstat (limited to 'gdb/ada-lang.c')
-rw-r--r--gdb/ada-lang.c99
1 files changed, 48 insertions, 51 deletions
diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index a052cb6..cc1c2c7 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -10989,7 +10989,7 @@ dtor_exception (enum exception_catchpoint_kind ex, struct breakpoint *b)
xfree (c->excep_string);
- bkpt_dtor (b);
+ bkpt_breakpoint_ops.dtor (b);
}
/* Implement the ALLOCATE_LOCATION method in the breakpoint_ops
@@ -11017,7 +11017,7 @@ re_set_exception (enum exception_catchpoint_kind ex, struct breakpoint *b)
/* Call the base class's method. This updates the catchpoint's
locations. */
- bkpt_re_set (b);
+ bkpt_breakpoint_ops.re_set (b);
/* Reparse the exception conditional expressions. One for each
location. */
@@ -11314,23 +11314,7 @@ print_recreate_catch_exception (struct breakpoint *b, struct ui_file *fp)
print_recreate_exception (ex_catch_exception, b, fp);
}
-static struct breakpoint_ops catch_exception_breakpoint_ops =
-{
- dtor_catch_exception,
- allocate_location_catch_exception,
- re_set_catch_exception,
- bkpt_insert_location,
- bkpt_remove_location,
- bkpt_breakpoint_hit,
- check_status_catch_exception,
- bkpt_resources_needed,
- null_works_in_software_mode,
- print_it_catch_exception,
- print_one_catch_exception,
- null_print_one_detail,
- print_mention_catch_exception,
- print_recreate_catch_exception
-};
+static struct breakpoint_ops catch_exception_breakpoint_ops;
/* Virtual table for "catch exception unhandled" breakpoints. */
@@ -11384,22 +11368,7 @@ print_recreate_catch_exception_unhandled (struct breakpoint *b,
print_recreate_exception (ex_catch_exception_unhandled, b, fp);
}
-static struct breakpoint_ops catch_exception_unhandled_breakpoint_ops = {
- dtor_catch_exception_unhandled,
- allocate_location_catch_exception_unhandled,
- re_set_catch_exception_unhandled,
- bkpt_insert_location,
- bkpt_remove_location,
- bkpt_breakpoint_hit,
- check_status_catch_exception_unhandled,
- bkpt_resources_needed,
- null_works_in_software_mode,
- print_it_catch_exception_unhandled,
- print_one_catch_exception_unhandled,
- null_print_one_detail,
- print_mention_catch_exception_unhandled,
- print_recreate_catch_exception_unhandled
-};
+static struct breakpoint_ops catch_exception_unhandled_breakpoint_ops;
/* Virtual table for "catch assert" breakpoints. */
@@ -11451,22 +11420,7 @@ print_recreate_catch_assert (struct breakpoint *b, struct ui_file *fp)
print_recreate_exception (ex_catch_assert, b, fp);
}
-static struct breakpoint_ops catch_assert_breakpoint_ops = {
- dtor_catch_assert,
- allocate_location_catch_assert,
- re_set_catch_assert,
- bkpt_insert_location,
- bkpt_remove_location,
- bkpt_breakpoint_hit,
- check_status_catch_assert,
- bkpt_resources_needed,
- null_works_in_software_mode,
- print_it_catch_assert,
- print_one_catch_assert,
- null_print_one_detail,
- print_mention_catch_assert,
- print_recreate_catch_assert
-};
+static struct breakpoint_ops catch_assert_breakpoint_ops;
/* Return a newly allocated copy of the first space-separated token
in ARGSP, and then adjust ARGSP to point immediately after that
@@ -12354,11 +12308,54 @@ show_ada_command (char *args, int from_tty)
cmd_show_list (show_ada_list, from_tty, "");
}
+static void
+initialize_ada_catchpoint_ops (void)
+{
+ struct breakpoint_ops *ops;
+
+ initialize_breakpoint_ops ();
+
+ 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;
+ ops->print_it = print_it_catch_exception;
+ ops->print_one = print_one_catch_exception;
+ ops->print_mention = print_mention_catch_exception;
+ ops->print_recreate = print_recreate_catch_exception;
+
+ 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;
+ ops->print_it = print_it_catch_exception_unhandled;
+ ops->print_one = print_one_catch_exception_unhandled;
+ ops->print_mention = print_mention_catch_exception_unhandled;
+ ops->print_recreate = print_recreate_catch_exception_unhandled;
+
+ 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;
+ ops->print_it = print_it_catch_assert;
+ ops->print_one = print_one_catch_assert;
+ ops->print_mention = print_mention_catch_assert;
+ ops->print_recreate = print_recreate_catch_assert;
+}
+
void
_initialize_ada_language (void)
{
add_language (&ada_language_defn);
+ initialize_ada_catchpoint_ops ();
+
add_prefix_cmd ("ada", no_class, set_ada_command,
_("Prefix command for changing Ada-specfic settings"),
&set_ada_list, "set ada ", 0, &setlist);