-
Notifications
You must be signed in to change notification settings - Fork 460
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce TraceResolver::load_addresses() for raw address array
TraceResolver has a load_stacktrace() method accepting only an object like StackTrace. That object is basically an array of pointers. This was not really convenient, because 1) it required carrying of this StackTrace object from the moment of its creation to the load_stacktrace() invocation. Sometimes this is a long path. And that may break encapsulation, if a project, using Backward, does not want to include Backward header anywhere except for 1 or 2 C++ files, responsible for collection and resolution of addresses. So basically, load_stacktrace() prevented split of stack load and stack resolution into separate submodules of a project; 2) that made impossible to use Backward to resolve a stack, collected not via Backward. The patch introduces a new method load_addresses(), accepting an array of addresses. That solves both problems. Alongside, to avoid increase of code duplication by empty load_addresses() methods in the classes where they are not needed, now both load_stacktrace() and load_addresses() are in one base class, used by all resolvers. load_addresses() is a virtual method, which does nothing, except for a couple of classes, where it is overridden as backtrace_symbols(). load_stacktrace() just calls load_addresses() and doesn't need to be defined everywhere again and again.
- Loading branch information
Showing
1 changed file
with
28 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters