[gimp/gimp-2-10] app: always use libunwind for symbol names in GimpBacktrace Linux backend



commit b1cba6b1428932fe6dbdbe590691e4dad471555e
Author: Ell <ell_se yahoo com>
Date:   Thu Oct 11 03:31:57 2018 -0400

    app: always use libunwind for symbol names in GimpBacktrace Linux backend
    
    In the GimpBacktrace Linux backend, always use libunwind, when
    available, to find symbol names, even if dladdr() or libbacktrace
    had already found one.  libunwind provides more descriptive names
    in certain cases, and, in particular, full symbol names for C++
    lambdas.
    
    Note that, in some cases, this can result in a discrepancy between
    the reported symbol name, and the corresponding source location.
    
    (cherry picked from commit 72fc01742bfe1f7e21a04e85184cd04851c9d53e)

 app/core/gimpbacktrace-linux.c | 9 +++++++++
 1 file changed, 9 insertions(+)
---
diff --git a/app/core/gimpbacktrace-linux.c b/app/core/gimpbacktrace-linux.c
index cef207a43a..3491e87852 100644
--- a/app/core/gimpbacktrace-linux.c
+++ b/app/core/gimpbacktrace-linux.c
@@ -665,7 +665,16 @@ gimp_backtrace_get_address_info (guintptr                  address,
 #endif /* HAVE_LIBBACKTRACE */
 
 #ifdef HAVE_LIBUNWIND
+/* we use libunwind to get the symbol name, when available, even if dladdr() or
+ * libbacktrace already found one, since it provides more descriptive names in
+ * some cases, and, in particular, full symbol names for C++ lambdas.
+ *
+ * note that, in some cases, this can result in a discrepancy between the
+ * symbol name, and the corresponding source location.
+ */
+#if 0
   if (! info->symbol_name[0])
+#endif
     {
       unw_context_t context = {};
       unw_cursor_t  cursor;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]