[compiler-rt] r231061 - Symbolizer refactoring: Turn FillAddressAndModuleInfo into FillModuleInfo
Kuba Brecka
kuba.brecka at gmail.com
Tue Mar 3 01:18:44 PST 2015
Author: kuba.brecka
Date: Tue Mar 3 03:18:44 2015
New Revision: 231061
URL: http://llvm.org/viewvc/llvm-project?rev=231061&view=rev
Log:
Symbolizer refactoring: Turn FillAddressAndModuleInfo into FillModuleInfo
Reviewed at http://reviews.llvm.org/D8020
Modified:
compiler-rt/trunk/lib/sanitizer_common/sanitizer_symbolizer.cc
compiler-rt/trunk/lib/sanitizer_common/sanitizer_symbolizer.h
compiler-rt/trunk/lib/sanitizer_common/sanitizer_symbolizer_libbacktrace.cc
compiler-rt/trunk/lib/sanitizer_common/sanitizer_symbolizer_posix_libcdep.cc
compiler-rt/trunk/lib/sanitizer_common/sanitizer_symbolizer_win.cc
Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_symbolizer.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_symbolizer.cc?rev=231061&r1=231060&r2=231061&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_symbolizer.cc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_symbolizer.cc Tue Mar 3 03:18:44 2015
@@ -33,9 +33,7 @@ void AddressInfo::Clear() {
function_offset = kUnknown;
}
-void AddressInfo::FillAddressAndModuleInfo(uptr addr, const char *mod_name,
- uptr mod_offset) {
- address = addr;
+void AddressInfo::FillModuleInfo(const char *mod_name, uptr mod_offset) {
module = internal_strdup(mod_name);
module_offset = mod_offset;
}
Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_symbolizer.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_symbolizer.h?rev=231061&r1=231060&r2=231061&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_symbolizer.h (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_symbolizer.h Tue Mar 3 03:18:44 2015
@@ -43,8 +43,7 @@ struct AddressInfo {
AddressInfo();
// Deletes all strings and resets all fields.
void Clear();
- void FillAddressAndModuleInfo(uptr addr, const char *mod_name,
- uptr mod_offset);
+ void FillModuleInfo(const char *mod_name, uptr mod_offset);
};
// Linked list of symbolized frames (each frame is described by AddressInfo).
Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_symbolizer_libbacktrace.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_symbolizer_libbacktrace.cc?rev=231061&r1=231060&r2=231061&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_symbolizer_libbacktrace.cc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_symbolizer_libbacktrace.cc Tue Mar 3 03:18:44 2015
@@ -95,8 +95,7 @@ struct SymbolizeCodeCallbackArg {
if (frames_symbolized > 0) {
SymbolizedStack *cur = SymbolizedStack::New(addr);
AddressInfo *info = &cur->info;
- info->FillAddressAndModuleInfo(addr, first->info.module,
- first->info.module_offset);
+ info->FillModuleInfo(first->info.module, first->info.module_offset);
last->next = cur;
last = cur;
}
Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_symbolizer_posix_libcdep.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_symbolizer_posix_libcdep.cc?rev=231061&r1=231060&r2=231061&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_symbolizer_posix_libcdep.cc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_symbolizer_posix_libcdep.cc Tue Mar 3 03:18:44 2015
@@ -74,8 +74,7 @@ static void ParseSymbolizePCOutput(const
top_frame = false;
} else {
cur = SymbolizedStack::New(res->info.address);
- cur->info.FillAddressAndModuleInfo(res->info.address, res->info.module,
- res->info.module_offset);
+ cur->info.FillModuleInfo(res->info.module, res->info.module_offset);
last->next = cur;
last = cur;
}
@@ -363,7 +362,7 @@ class POSIXSymbolizer : public Symbolize
if (!FindModuleNameAndOffsetForAddress(addr, &module_name, &module_offset))
return res;
// Always fill data about module name and offset.
- res->info.FillAddressAndModuleInfo(addr, module_name, module_offset);
+ res->info.FillModuleInfo(module_name, module_offset);
// First, try to use libbacktrace symbolizer (if it's available).
if (libbacktrace_symbolizer_ != 0) {
mu_.CheckLocked();
Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_symbolizer_win.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_symbolizer_win.cc?rev=231061&r1=231060&r2=231061&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_symbolizer_win.cc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_symbolizer_win.cc Tue Mar 3 03:18:44 2015
@@ -59,8 +59,8 @@ class WinSymbolizer : public Symbolizer
internal_memset(&mod_info, 0, sizeof(mod_info));
mod_info.SizeOfStruct = sizeof(mod_info);
if (SymGetModuleInfo64(GetCurrentProcess(), addr, &mod_info))
- frame->info.FillAddressAndModuleInfo(addr, mod_info.ImageName,
- addr - (uptr)mod_info.BaseOfImage);
+ frame->info.FillModuleInfo(mod_info.ImageName,
+ addr - (uptr)mod_info.BaseOfImage);
return frame;
}
More information about the llvm-commits
mailing list