[PATCH] [compiler-rt] Symbolizer refactoring: Move string parsing into separate functions

Alexey Samsonov vonosmas at gmail.com
Tue Feb 24 17:17:01 PST 2015


================
Comment at: lib/sanitizer_common/sanitizer_symbolizer_posix_libcdep.cc:312
@@ +311,3 @@
+
+// Parses a two-line string in the following format:
+//   <function_name>
----------------
In fact, no, we parse multiple two-line string entries.

================
Comment at: lib/sanitizer_common/sanitizer_symbolizer_posix_libcdep.cc:315
@@ +314,3 @@
+//   <file_name>:<line_number>:<column_number>
+// or this format (without the column number):
+//   <function_name>
----------------
You can just write it as
  <function_name>
  <file_name>:<line_number>[:<column_number>]


================
Comment at: lib/sanitizer_common/sanitizer_symbolizer_posix_libcdep.cc:321
@@ +320,3 @@
+static void ParseSymbolizePCOutput(const char *str, SymbolizedStack *res) {
+  uptr orig_addr = res->info.address;
+  const char *orig_module_name = res->info.module;
----------------
Why do you need these temp variables, you never actually modify these res->info fields.

================
Comment at: lib/sanitizer_common/sanitizer_symbolizer_posix_libcdep.cc:380
@@ +379,3 @@
+  str = ExtractUptr(str, "\n", &info->size);
+  info->start += (addr - info->module_offset);  // Add the module base address.
+}
----------------
Wait, this line should remain in `SymbolizeData`, it has nothing to do with parsing.

http://reviews.llvm.org/D7869

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list