diff options
Diffstat (limited to 'src/interpret/heaptrack_interpret.cpp')
-rw-r--r-- | src/interpret/heaptrack_interpret.cpp | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/src/interpret/heaptrack_interpret.cpp b/src/interpret/heaptrack_interpret.cpp index 23d0431..9b69853 100644 --- a/src/interpret/heaptrack_interpret.cpp +++ b/src/interpret/heaptrack_interpret.cpp @@ -71,11 +71,11 @@ string demangle(const char* function) struct Frame { - Frame(string function = {}, string file = {}, int line = 0, size_t moduleOffset = 0) - : function(function) - , file(file) - , line(line) - , moduleOffset(moduleOffset) + Frame(string function_ = {}, string file_ = {}, int line_ = 0, size_t moduleOffset_ = 0) + : function(function_) + , file(file_) + , line(line_) + , moduleOffset(moduleOffset_) {} bool isValid() const @@ -97,11 +97,11 @@ struct AddressInformation struct ResolvedFrame { - ResolvedFrame(size_t functionIndex = 0, size_t fileIndex = 0, int line = 0, size_t moduleOffset = 0) - : functionIndex(functionIndex) - , fileIndex(fileIndex) - , line(line) - , moduleOffset(moduleOffset) + ResolvedFrame(size_t functionIndex_ = 0, size_t fileIndex_ = 0, int line_ = 0, size_t moduleOffset_ = 0) + : functionIndex(functionIndex_) + , fileIndex(fileIndex_) + , line(line_) + , moduleOffset(moduleOffset_) {} size_t functionIndex; size_t fileIndex; @@ -118,11 +118,11 @@ struct ResolvedIP struct Module { - Module(uintptr_t addressStart, uintptr_t addressEnd, backtrace_state* backtraceState, size_t moduleIndex) - : addressStart(addressStart) - , addressEnd(addressEnd) - , moduleIndex(moduleIndex) - , backtraceState(backtraceState) + Module(uintptr_t addressStart_, uintptr_t addressEnd_, backtrace_state* backtraceState_, size_t moduleIndex_) + : addressStart(addressStart_) + , addressEnd(addressEnd_) + , moduleIndex(moduleIndex_) + , backtraceState(backtraceState_) { } @@ -137,11 +137,11 @@ struct Module backtrace_pcinfo(backtraceState, address, [](void* data, uintptr_t /*addr*/, const char* file, int line, const char* function) -> int { Frame frame(demangle(function), file ? file : "", line); - auto info = reinterpret_cast<AddressInformation*>(data); - if (!info->frame.isValid()) { - info->frame = frame; + auto addr_info = reinterpret_cast<AddressInformation*>(data); + if (!addr_info->frame.isValid()) { + addr_info->frame = frame; } else { - info->inlined.push_back(frame); + addr_info->inlined.push_back(frame); } return 0; }, @@ -246,7 +246,7 @@ struct AccumulatedTraceData // find module for this instruction pointer auto module = lower_bound(m_modules.begin(), m_modules.end(), ip, - [](const Module& module, const uintptr_t ip) -> bool { return module.addressEnd < ip; }); + [](const Module& module_, const uintptr_t ip_) -> bool { return module_.addressEnd < ip_; }); if (module != m_modules.end() && module->addressStart <= ip && module->addressEnd >= ip) { data.moduleIndex = module->moduleIndex; const auto info = module->resolveAddress(ip); @@ -402,8 +402,8 @@ struct AccumulatedTraceData CallbackData data = {fileName.c_str()}; auto errorHandler = [](void* rawData, const char* msg, int errnum) { - auto data = reinterpret_cast<const CallbackData*>(rawData); - cerr << "Failed to create backtrace state for module " << data->fileName << ": " << msg << " / " + auto callback_data = reinterpret_cast<const CallbackData*>(rawData); + cerr << "Failed to create backtrace state for module " << callback_data->fileName << ": " << msg << " / " << strerror(errnum) << " (error code " << errnum << ")" << endl; }; |