diff options
author | Tom Tromey <tom@tromey.com> | 2022-05-01 16:11:26 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2022-05-06 12:03:35 -0600 |
commit | fed1c982dec3baba167b3fd4df3538f09fa3d339 (patch) | |
tree | 40077feab51633a68a1cf53066f83ff7f3991b90 /gdb/break-catch-fork.c | |
parent | b68f26dea78f1a390084a0e2bfa95f1bcf1942dc (diff) | |
download | binutils-fed1c982dec3baba167b3fd4df3538f09fa3d339.zip binutils-fed1c982dec3baba167b3fd4df3538f09fa3d339.tar.gz binutils-fed1c982dec3baba167b3fd4df3538f09fa3d339.tar.bz2 |
Introduce catchpoint class
This introduces a catchpoint class that is used as the base class for
all catchpoints. init_catchpoint is rewritten to be a constructor
instead.
This changes the hierarchy a little -- some catchpoints now inherit
from base_breakpoint whereas previously they did not. This isn't a
problem, as long as re_set is redefined in catchpoint.
Diffstat (limited to 'gdb/break-catch-fork.c')
-rw-r--r-- | gdb/break-catch-fork.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/gdb/break-catch-fork.c b/gdb/break-catch-fork.c index 913ccec..1f8deec 100644 --- a/gdb/break-catch-fork.c +++ b/gdb/break-catch-fork.c @@ -32,10 +32,11 @@ catchpoint. A breakpoint is really of this type iff its ops pointer points to CATCH_FORK_BREAKPOINT_OPS. */ -struct fork_catchpoint : public breakpoint +struct fork_catchpoint : public catchpoint { - fork_catchpoint (struct gdbarch *gdbarch, bool is_vfork_) - : breakpoint (gdbarch, bp_catchpoint), + fork_catchpoint (struct gdbarch *gdbarch, bool temp, + const char *cond_string, bool is_vfork_) + : catchpoint (gdbarch, temp, cond_string), is_vfork (is_vfork_) { } @@ -186,10 +187,8 @@ create_fork_vfork_event_catchpoint (struct gdbarch *gdbarch, bool temp, const char *cond_string, bool is_vfork) { - std::unique_ptr<fork_catchpoint> c (new fork_catchpoint (gdbarch, - is_vfork)); - - init_catchpoint (c.get (), gdbarch, temp, cond_string); + std::unique_ptr<fork_catchpoint> c + (new fork_catchpoint (gdbarch, temp, cond_string, is_vfork)); install_breakpoint (0, std::move (c), 1); } |