Age | Commit message (Collapse) | Author | Files | Lines |
|
Move initialization of ranged_breakpoint's fields to its ctor.
Change-Id: If7b842861f3cc6a429ea329d45598b5852283ba3
|
|
This commit replaces a chunk of code in break_range_command by an
equivalent call to install_breakpoint.
Change-Id: I31c06cabd36f5be91740aab029265f678aa78e35
|
|
ranged_breakpoint's ctor already sets the breakpoint's type to
bp_hardware_breakpoint.
Since this is a "regular" breakpoint, b->pspace should remain NULL.
Thus, the only thing init_raw_breakpoint is needed for, is to add the
breakpoint's location. Do that directly.
Change-Id: I1505de94c3919881c2b300437e2c0da9b05f76bd
|
|
You should never instanciate these types directly.
Change-Id: I8086c74c415eadbd44924bb0ef20f34b5b97ee6f
|
|
Make add_location_to_breakpoint be a method of struct breakpoint.
A patch later in the series will move this to base_breakpoint, but for
now, it needs to be here.
Change-Id: I5bdc2ec1a7c2d66f26f51bf6f6adc8384a90b129
|
|
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.
|
|
This removes init_raw_breakpoint_without_location, replacing it with a
constructor on 'breakpoint' itself. The subclasses and callers are
all updated.
|
|
This constifies breakpoint::print_recreate.
|
|
This constifies breakpoint::print_mention.
|
|
This constifies breakpoint::print_one.
|
|
This constifies breakpoint::print_it. Doing this pointed out some
code in ada-lang.c that can be simplified a little as well.
|
|
works_in_software_mode is only useful for watchpoints. This patch
moves it from breakpoint to watchpoint, and changes it to return bool.
|
|
This changes breakpoint::explains_signal to return bool.
|
|
The breakpoint::ops field is set but never used. This removes it.
|
|
This changes print_recreate_thread to be a method on breakpoint. This
function is only used as a helper by print_recreate methods, so I
thought this transformation made sense.
|
|
The type_wanted value, passed down to the create_sals_from_location
callback, is never used. Remove it.
Change-Id: Ic363ee13f6af593a3e875ff7fe46de130cdc190c
|
|
create_breakpoints_sal_default is just a simple wrapper, so remove it.
|
|
allocate_bp_location is just a small wrapper for a method call, so
inline it everywhere.
|
|
Now that all breakpoint_ops are statically initialized, they can all
be made const.
|
|
initialize_breakpoint_ops does not do much any more, so remove it in
favor of statically-initialize objects.
|
|
There's no need to have vtable_breakpoint_ops any more, so remove it
in favor of base_breakpoint_ops.
|
|
At this point, all implementations of breakpoints use the vtable. So,
we can now remove most function pointers from breakpoint_ops and
switch to using methods directly in the callers. Only the two "static
virtual" methods remain in breakpoint_ops.
|
|
init_catchpoint is only ever passed a single breakpoint_ops pointer,
so remove the parameter.
|
|
init_ada_exception_breakpoint is only ever passed a single
breakpoint_ops structure, so remove the parameter.
|
|
Right now, probe tracepoints are handled by a separate ops object.
However, they differ only in a small way from ordinary tracepoints,
and furthermore can be distinguished by their event location.
This patch merges the two cases, just as was done for breakpoints.
|
|
Right now, probe breakpoints are handled by a separate ops object.
However, they differ only in a small way from ordinary breakpoints,
and furthermore can be distinguished by their "probe" object.
This patch merges the two cases. This avoids having to introduce a
new bp_ constant (which can be quite subtle to do correctly) and a new
subclass.
|
|
An earlier patch removed the last use of bkpt_base_breakpoint_ops, so
remove the object entirely.
|
|
This converts static marker tracepoints to use vtable_breakpoint_ops.
|
|
Because the actual construction of a breakpoint is buried deep in
create_breakpoint, at present it's necessary to have a new bp_
enumerator constant any time a new subclass is needed. Static marker
tracepoints are one such case, so this patch introduces
bp_static_marker_tracepoint and updates various spots to recognize it.
|
|
This converts ranged breakpoints to use vtable_breakpoint_ops. This
requires introducing a new ranged_breakpoint type, but this is
relatively simple because ranged breakpoints can only be created by
break_range_command.
|
|
This converts dprintf to use vtable_breakpoint_ops.
|
|
This converts "ordinary" breakpoint to use vtable_breakpoint_ops.
Recall that an ordinary breakpoint is both the kind normally created
by users, and also a base class used by other classes.
|
|
The dprintf breakpoint ops is mostly a copy of bpkt_breakpoint_ops,
except it's written out explicitly -- and, importantly, there's
nothing that bpkt_breakpoint_ops overrides that dprintf does not.
This changes dprintf to simply inherit directly, and updates struct
dprintf_breakpoint to reflect the change as well.
|
|
This converts momentary breakpoints to use vtable_breakpoint_ops.
|
|
This converts internal breakpoints to use vtable_breakpoint_ops.
|
|
This converts base breakpoints to use vtable_breakpoint_ops.
|
|
This adds a few new subclasses of breakpoint. The inheritance
hierarchy is chosen to reflect what's already present in
initialize_breakpoint_ops -- it mirrors the way that the _ops
structures are filled in.
This patch also changes new_breakpoint_from_type to create the correct
sublcass based on bptype. This is important due to the somewhat
inverted way in which create_breakpoint works; and in particular later
patches will change some of these entries.
|
|
This converts tracepoints to use vtable_breakpoint_ops.
|
|
This converts watchpoints and masked watchpoints. to use
vtable_breakpoint_ops. For masked watchpoints, a new subclass must be
introduced, and watch_command_1 is changed to create one.
|
|
This adds methods to struct breakpoint. Each method has a similar
signature to a corresponding function in breakpoint_ops, with the
exceptions of create_sals_from_location and create_breakpoints_sal,
which can't be virtual methods on breakpoint -- they are only used
during the construction of breakpoints.
Then, this adds a new vtable_breakpoint_ops structure and populates it
with functions that simply forward a call from breakpoint_ops to the
corresponding virtual method. These are all done with lambdas,
because they are just a stepping stone -- by the end of the series,
this structure will be deleted.
|
|
This changes breakpoint_ops::print_one to return bool, and updates all
the implementations and the caller. The caller is changed so that a
NULL check is no longer needed -- something that will be impossible
with a real method.
|
|
This patch deletes a few unnecessary wrapper functions from
breakpoint.c.
|
|
This adds an assertion to clone_momentary_breakpoint. This will
eventually be removed, but in the meantime is is useful for helping
convince oneself that momentary breakpoints will always use
momentary_breakpoint_ops. This understanding will help when cleaning
up the code later.
|
|
Change print_solib_event to accept a bool parameter and update the
callers.
|
|
The "catch load" code is reasonably self-contained, and so this patch
moves it out of breakpoint.c and into a new file, break-catch-load.c.
One function from breakpoint.c, print_solib_event, now has to be
exposed, but this seems pretty reasonable.
|
|
The clear command shouldn't delete momentary and internal breakpoints,
nor internal breakpoints created via Python's gdb.Breakpoint.
This patch fixes this issue and adds a testcase.
Regression tested on x86_64 openSUSE Tumbleweed(VERSION_ID="20220413").
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=7161
|
|
Add a getter and a setter for a minimal symbol's type. Remove the
corresponding macro and adjust all callers.
Change-Id: I89900df5ffa5687133fe1a16b2e0d4684e67a77d
|
|
Remove all macros related to getting and setting some symbol value:
#define SYMBOL_VALUE(symbol) (symbol)->value.ivalue
#define SYMBOL_VALUE_ADDRESS(symbol) \
#define SET_SYMBOL_VALUE_ADDRESS(symbol, new_value) \
#define SYMBOL_VALUE_BYTES(symbol) (symbol)->value.bytes
#define SYMBOL_VALUE_COMMON_BLOCK(symbol) (symbol)->value.common_block
#define SYMBOL_BLOCK_VALUE(symbol) (symbol)->value.block
#define SYMBOL_VALUE_CHAIN(symbol) (symbol)->value.chain
#define MSYMBOL_VALUE(symbol) (symbol)->value.ivalue
#define MSYMBOL_VALUE_RAW_ADDRESS(symbol) ((symbol)->value.address + 0)
#define MSYMBOL_VALUE_ADDRESS(objfile, symbol) \
#define BMSYMBOL_VALUE_ADDRESS(symbol) \
#define SET_MSYMBOL_VALUE_ADDRESS(symbol, new_value) \
#define MSYMBOL_VALUE_BYTES(symbol) (symbol)->value.bytes
#define MSYMBOL_BLOCK_VALUE(symbol) (symbol)->value.block
Replace them with equivalent methods on the appropriate objects.
Change-Id: Iafdab3b8eefc6dc2fd895aa955bf64fafc59ed50
|
|
Same idea as previous patch, but for symtab::objfile. I find
it clearer without this wrapper, as it shows that the objfile is
common to all symtabs of a given compunit. Otherwise, you could think
that each symtab (of a given compunit) can have a specific objfile.
Change-Id: Ifc0dbc7ec31a06eefa2787c921196949d5a6fcc6
|
|
This patch removes gdb's dbx mode. Regression tested on x86-64 Fedora
34.
|