diff options
author | Christopher Ferris <cferris@google.com> | 2017-07-19 14:20:46 -0700 |
---|---|---|
committer | Christopher Ferris <cferris@google.com> | 2017-07-19 15:36:32 -0700 |
commit | 96722b0fa48524e03659c0a3d579f8ef4f1641ba (patch) | |
tree | 36fc9010745e09a91647fabbc5abdbbbe2cea9f2 /libbacktrace/Backtrace.cpp | |
parent | 33913ebfb5ca699d09459227284b3d324343fa43 (diff) | |
download | system_core-96722b0fa48524e03659c0a3d579f8ef4f1641ba.tar.gz system_core-96722b0fa48524e03659c0a3d579f8ef4f1641ba.tar.bz2 system_core-96722b0fa48524e03659c0a3d579f8ef4f1641ba.zip |
Cleanup the libbacktrace interface a bit.
- Change the field name load_base to load_bias (which is what it really is).
- Add a rel_pc field so that callers do not need to compute it themselves.
- Remove the BacktraceMap::GetRelativePc() since nobody should need to
compute this themselves.
Bug: 23762183
Test: Compiles and unit tests pass (debuggerd, libbacktrace).
Change-Id: I2cb579767120adf08c407a58f3c487ee3f2b45fc
Diffstat (limited to 'libbacktrace/Backtrace.cpp')
-rw-r--r-- | libbacktrace/Backtrace.cpp | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/libbacktrace/Backtrace.cpp b/libbacktrace/Backtrace.cpp index e46d35389..81f5e32cc 100644 --- a/libbacktrace/Backtrace.cpp +++ b/libbacktrace/Backtrace.cpp @@ -84,10 +84,8 @@ std::string Backtrace::FormatFrameData(size_t frame_num) { } std::string Backtrace::FormatFrameData(const backtrace_frame_data_t* frame) { - uintptr_t relative_pc; std::string map_name; if (BacktraceMap::IsValid(frame->map)) { - relative_pc = BacktraceMap::GetRelativePc(frame->map, frame->pc); if (!frame->map.name.empty()) { map_name = frame->map.name.c_str(); if (map_name[0] == '[' && map_name[map_name.size() - 1] == ']') { @@ -99,10 +97,9 @@ std::string Backtrace::FormatFrameData(const backtrace_frame_data_t* frame) { } } else { map_name = "<unknown>"; - relative_pc = frame->pc; } - std::string line(StringPrintf("#%02zu pc %" PRIPTR " ", frame->num, relative_pc)); + std::string line(StringPrintf("#%02zu pc %" PRIPTR " ", frame->num, frame->rel_pc)); line += map_name; // Special handling for non-zero offset maps, we need to print that // information. |