<div dir="ltr">"almost identical"? Mind expanding on this?<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Oct 29, 2013 at 7:25 PM, Peter Hutterer <span dir="ltr"><<a href="mailto:peter.hutterer@who-t.net" target="_blank">peter.hutterer@who-t.net</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">The recent change to use elfutils made these conditions almost identical.<br>
<br>
Signed-off-by: Peter Hutterer <<a href="mailto:peter.hutterer@who-t.net">peter.hutterer@who-t.net</a>><br>
---<br>
 os/backtrace.c | 29 +++++++++++------------------<br>
 1 file changed, 11 insertions(+), 18 deletions(-)<br>
<br>
diff --git a/os/backtrace.c b/os/backtrace.c<br>
index acf110a..c3a31bc 100644<br>
--- a/os/backtrace.c<br>
+++ b/os/backtrace.c<br>
@@ -134,32 +134,25 @@ xorg_backtrace(void)<br>
     size = backtrace(array, BT_SIZE);<br>
     for (i = 0; i < size; i++) {<br>
         int rc = dladdr(array[i], &info);<br>
+        const char *name;<br>
+        unsigned int addr;<br>
<br>
         if (rc == 0) {<br>
             ErrorFSigSafe("%u: ?? [%p]\n", i, array[i]);<br>
             continue;<br>
         }<br>
         mod = (info.dli_fname && *info.dli_fname) ? info.dli_fname : "(vdso)";<br>
-        if (info.dli_saddr)<br>
-            ErrorFSigSafe(<br>
-                "%u: %s (%s+0x%x) [%p]\n",<br>
-                i,<br>
-                mod,<br>
-                info.dli_sname,<br>
-                (unsigned int)((char *) array[i] -<br>
-                               (char *) info.dli_saddr),<br>
-                array[i]);<br>
+<br>
+        if (info.dli_saddr) {<br>
+            name = info.dli_sname;<br>
+            addr = (unsigned int)((char *) array[i] - (char *) info.dli_saddr);<br>
+        }<br>
         else {<br>
-            const char *name = symbol_name(array[i], info.dli_fbase);<br>
-            ErrorFSigSafe(<br>
-                "%u: %s (%s+0x%x) [%p]\n",<br>
-                i,<br>
-                mod,<br>
-                name,<br>
-                (unsigned int)((char *) array[i] -<br>
-                               (char *) info.dli_fbase),<br>
-                array[i]);<br>
+            name = symbol_name(array[i], info.dli_fbase);<br>
+            addr = (unsigned int)((char *) array[i] - (char *) info.dli_fbase);<br>
         }<br>
+<br>
+        ErrorFSigSafe("%u: %s (%s+0x%x) [%p]\n", i, mod, name, addr, array[i]);<br>
     }<br>
     ErrorFSigSafe("\n");<br>
 }<br>
<span class="HOEnZb"><font color="#888888">--<br>
1.8.3.1<br>
<br>
_______________________________________________<br>
<a href="mailto:xorg-devel@lists.x.org">xorg-devel@lists.x.org</a>: X.Org development<br>
Archives: <a href="http://lists.x.org/archives/xorg-devel" target="_blank">http://lists.x.org/archives/xorg-devel</a><br>
Info: <a href="http://lists.x.org/mailman/listinfo/xorg-devel" target="_blank">http://lists.x.org/mailman/listinfo/xorg-devel</a><br>
</font></span></blockquote></div><br><br clear="all"><br>-- <br>  Jasper<br>
</div>