[PATCH] D12153: Support inline functions symbolization in Addr2Line symbolizer.

Maxim Ostapenko via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 26 11:27:28 PDT 2015


m.ostepenko added inline comments.

================
Comment at: lib/sanitizer_common/sanitizer_symbolizer_internal.h:91
@@ -90,1 +90,3 @@
 
+  virtual void TrimOutputBuffer(char *buffer, const uptr read_len) {
+    buffer[read_len] = '\0';
----------------
ygribov wrote:
> Why const uptr?
Sorry, size_t is undefined here.

================
Comment at: lib/sanitizer_common/sanitizer_symbolizer_posix_libcdep.cc:198
@@ +197,3 @@
+  bool ReachedEndOfOutput(const char *buffer, uptr length) override {
+    const size_t kTerminatorLen = 8; // sizeof(output_terminator_)
+    // Skip, if we read just kTerminatorLen bytes, because Addr2Line output
----------------
ygribov wrote:
> I wonder if there's a way to avoid magic const.
We can use strlen, but this will lead to recalculation on each functon call. Or maybe use "??\n??:0\n" as it to compute kTerminatorLen.

================
Comment at: lib/sanitizer_common/sanitizer_symbolizer_posix_libcdep.cc:281
@@ -265,1 +280,3 @@
   InternalMmapVector<Addr2LineProcess*> addr2line_pool_;
+  static const uptr output_terminator_ =
+      FIRST_32_SECOND_64(UINT32_MAX, UINT64_MAX);
----------------
ygribov wrote:
> I don't think that output_terminator but rather "dummy_address" or something like this. BTW note that statics don't take underscore.
AFAIK,  they do:


> class members should end with _

Or maybe I missed something?


http://reviews.llvm.org/D12153





More information about the llvm-commits mailing list