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

Maxim Ostapenko via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 26 14:14:15 PDT 2015


m.ostepenko added inline comments.

================
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
----------------
samsonov wrote:
> m.ostepenko wrote:
> > 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.
> Consider just making output_terminator_ a function-static - it's not used anywhere else in this class anyway.
Yes, this is an option, but if follow approach Yura suggested (do not accumulate effective_len, but recompute it in TrimOutputBuffer each time), we'll need output_terminator_ in TrimOutputBuffer either to find meaningful buffer length.


http://reviews.llvm.org/D12153





More information about the llvm-commits mailing list