[PATCH] [compiler-rt] Symbolizer refactoring: Abstract SymbolizerProcess better
Alexey Samsonov
vonosmas at gmail.com
Wed Feb 25 15:36:13 PST 2015
Looks like a step in right direction.
================
Comment at: lib/sanitizer_common/sanitizer_symbolizer.h:144
@@ -143,3 +143,3 @@
// __cxa_pure_virtual might be unavailable.
virtual char *SendCommand(bool is_data, const char *module_name,
uptr module_offset) {
----------------
This should also return `const char *`
================
Comment at: lib/sanitizer_common/sanitizer_symbolizer.h:156
@@ -155,4 +155,3 @@
explicit SymbolizerProcess(const char *path);
- char *SendCommand(bool is_data, const char *module_name,
- uptr module_offset) override;
+ char *SendCommand(const char *command);
----------------
This function should probably return `const char *` instead.
================
Comment at: lib/sanitizer_common/sanitizer_symbolizer_posix_libcdep.cc:374
@@ +373,3 @@
+ uptr module_offset) override {
+ internal_snprintf(buffer_, kBufferSize, "%s\"%s\" 0x%zx\n",
+ is_data ? "DATA " : "", module_name, module_offset);
----------------
Add
CHECK(module_name);
here
================
Comment at: lib/sanitizer_common/sanitizer_symbolizer_posix_libcdep.cc:419
@@ -422,3 +418,3 @@
char *SendCommand(bool is_data, const char *module_name, uptr module_offset) {
if (is_data)
----------------
add override here
================
Comment at: lib/sanitizer_common/sanitizer_symbolizer_posix_libcdep.cc:437
@@ +436,3 @@
+ char buffer_[32];
+ internal_snprintf(buffer_, sizeof(buffer_), "0x%zx\n", module_offset);
+ return addr2line->SendCommand(buffer_);
----------------
ARRAY_SIZE(buffer_), or use named constant.
http://reviews.llvm.org/D7889
EMAIL PREFERENCES
http://reviews.llvm.org/settings/panel/emailpreferences/
More information about the llvm-commits
mailing list