2012-06-04 21:55:19 +08:00
|
|
|
//===-- sanitizer_symbolizer.cc -------------------------------------------===//
|
2012-06-01 14:11:13 +08:00
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This is a stub for LLVM-based symbolizer.
|
|
|
|
// This file is shared between AddressSanitizer and ThreadSanitizer
|
|
|
|
// run-time libraries. See sanitizer.h for details.
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2012-06-07 16:52:56 +08:00
|
|
|
#include "sanitizer_common.h"
|
2012-06-01 14:11:13 +08:00
|
|
|
#include "sanitizer_symbolizer.h"
|
|
|
|
|
|
|
|
namespace __sanitizer {
|
|
|
|
|
|
|
|
void AddressInfo::Clear() {
|
2012-06-07 16:52:56 +08:00
|
|
|
InternalFree(module);
|
|
|
|
InternalFree(function);
|
|
|
|
InternalFree(file);
|
2012-06-01 14:11:13 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void AddressInfoList::Clear() {
|
|
|
|
AddressInfoList *cur = this;
|
|
|
|
while (cur) {
|
|
|
|
cur->info.Clear();
|
|
|
|
AddressInfoList *nxt = cur->next;
|
2012-06-07 16:52:56 +08:00
|
|
|
InternalFree(cur);
|
2012-06-01 14:11:13 +08:00
|
|
|
cur = nxt;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
AddressInfoList* SymbolizeCode(uptr address) {
|
2012-06-07 16:52:56 +08:00
|
|
|
AddressInfoList *list = (AddressInfoList*)InternalAlloc(
|
|
|
|
sizeof(AddressInfoList));
|
2012-06-01 14:11:13 +08:00
|
|
|
list->next = 0;
|
|
|
|
list->info.address = address;
|
|
|
|
list->info.module = 0;
|
|
|
|
list->info.module_offset = 0;
|
|
|
|
list->info.function = 0;
|
|
|
|
list->info.file = 0;
|
|
|
|
list->info.line = 0;
|
|
|
|
list->info.column = 0;
|
|
|
|
return list;
|
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace __sanitizer
|