Create struct type for longjmp breakpoint
authorSimon Marchi <simon.marchi@polymtl.ca>
Fri, 2 Jun 2017 21:16:20 +0000 (23:16 +0200)
committerSimon Marchi <simon.marchi@ericsson.com>
Fri, 2 Jun 2017 21:16:20 +0000 (23:16 +0200)
commit3b0871f44a3402f4e1e811ae81c8ba1293c1c7be
treef6e40bc552474f0bd53dcbca597b501cbe393b8c
parenta5e364af4a3d745bb79cfc9a1d533632d4d04b57
Create struct type for longjmp breakpoint

The longjmp kind of breakpoint has a destructor, but doesn't have an
associated structure.  The next patch converts breakpoint destructors from
breakpoint_ops::dtor to actual destructors, but to do that it is needed
for longjmp_breakpoint to have a structure that will contain such
destructor.  This patch adds it.

According to initialize_breakpoint_ops, a longjmp breakpoint derives
from "momentary breakpoints", so eventually a momentary_breakpoint
struct/class should probably be created.  It's not necessary for the
destructor though, so a structure type for this abstract kind of
breakpoint can be added when we fully convert breakpoint ops into
methods of the breakpoint type hierarchy.

It is now necessary to instantiate different kinds of breakpoint objects
in set_raw_breakpoint_without_location based on bptype (sometimes a
breakpoint, sometimes a longjmp_breakpoint), so it now uses
new_breakpoint_from_type to do that.  I also changed set_raw_breakpoint
to use it, even though I don't think that it can ever receive a bptype
that actually requires it.  However, I think it's good if all breakpoint
object instantion is done in a single place.

gdb/ChangeLog:

* breakpoint.c (struct longjmp_breakpoint): New struct.
(is_tracepoint_type): Change return type to bool.
(is_longjmp_type): New function.
(new_breakpoint_from_type): Handle longjmp kinds of breakpoints.
(set_raw_breakpoint_without_location): Use
new_breakpoint_from_type.
(set_raw_breakpoint): Likewise.
gdb/ChangeLog
gdb/breakpoint.c
This page took 0.026594 seconds and 4 git commands to generate.