<html>
<body>
<div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
<table bgcolor="#f9f3c9" width="100%" cellpadding="12" style="border: 1px #c9c399 solid; border-radius: 6px; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
<tr>
<td>
This is an automatically generated e-mail. To reply, visit:
<a href="https://git.reviewboard.kde.org/r/121213/">https://git.reviewboard.kde.org/r/121213/</a>
</td>
</tr>
</table>
<br />
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<p style="margin-top: 0;">On November 22nd, 2014, 11:20 nachm. UTC, <b>Thomas Lübking</b> wrote:</p>
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; border-collapse: collapse; margin: 2px padding: 2px;">
<thead>
<tr>
<th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; font-size: 9pt; padding: 4px 8px; text-align: left;">
<a href="https://git.reviewboard.kde.org/r/121213/diff/1/?file=329504#file329504line717" style="color: black; font-weight: bold; text-decoration: underline;">kdecore/io/kdebug.cpp</a>
<span style="font-weight: normal;">
(Diff revision 1)
</span>
</th>
</tr>
</thead>
<tbody style="background-color: #e4d9cb; padding: 4px 8px; text-align: center;">
<tr>
<td colspan="4"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">K_GLOBAL_STATIC(KDebugPrivate, kDebug_data)</pre></td>
</tr>
</tbody>
<tbody>
<tr>
<th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
<th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">717</font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "> <span class="k">const</span> <span class="kt">int</span> <span class="n">mangledNameEnd</span> <span class="o">=</span> <span class="n">in</span><span class="p">.</span><span class="n">indexOf</span><span class="p">(</span><span class="s">" + "</span><span class="p">,</span> <span class="n">mangledNameStart</span> <span class="o">+</span> <span class="mi">2</span><span class="p">);</span></pre></td>
</tr>
</tbody>
</table>
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Why do you need to sharpen the match?</p></pre>
</blockquote>
<p>On November 22nd, 2014, 11:32 nachm. UTC, <b>René J.V. Bertin</b> wrote:</p>
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Because otherwise the symbol to be demangled is left with a trailing space, which causes the demangle to fail. Wanna know how I know?</p></pre>
</blockquote>
<p>On November 22nd, 2014, 11:44 nachm. UTC, <b>Thomas Lübking</b> wrote:</p>
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Don't know about the GCC behavior on trailing spaces, but one should probably have some "while (in.at(mangledNameEnd) == ' ') --mangledNameEnd;" loop?</p></pre>
</blockquote>
<p>On November 23rd, 2014, 12:20 vorm. UTC, <b>René J.V. Bertin</b> wrote:</p>
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">One could, but why? The start is found with a string, I don't see why the end wouldn't be, given that that loop of yours will always loop just once ...</p></pre>
</blockquote>
<p>On November 23rd, 2014, 12:31 vorm. UTC, <b>Thomas Lübking</b> wrote:</p>
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">... or not at all or thrice - depending on how the mangler feels today.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">What I mean is that if untrimmed strings are a problem for demangling, one should seek to get rid of all the whitespace generically - i don't care about whether seeking for a string or char, this context is hardly performance critical.</p></pre>
</blockquote>
<p>On November 24th, 2014, 5:53 nachm. UTC, <b>René J.V. Bertin</b> wrote:</p>
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">this particular bit of whitespace has nothing to do with the mangler or how it feels today. It's formatting done by the backtrace function, which clearly always puts a space-padded <code style="text-rendering: inherit;color: #4444cc;padding: 0;white-space: normal;margin: 0;line-height: inherit;">+</code> rather than one without padding as under Linux.
Frankly, in general I'd agree with you, but here I don't see any reason to make the code more complex than it is.</p></pre>
</blockquote>
<p>On November 24th, 2014, 8:06 nachm. UTC, <b>Thomas Lübking</b> wrote:</p>
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">backtrace() is provided by glibc resp. the apple (darwin) libc (i hope).
-> What provides /usr/include/execinfo.h on OSX?
That's what is needed to be detected (I assume this would affect <em style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;">all</em> BSD variants?)</p>
<blockquote style="text-rendering: inherit;padding: 0 0 0 1em;border-left: 1px solid #bbb;white-space: normal;margin: 0 0 0 0.5em;line-height: inherit;">
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">I don't see any reason to make the code more complex than it is.</p>
</blockquote>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">If we're dealing w/ unspecified output and need to sanitize it, we may have to do this generically if we must consider random toolchains aside gcc+glibc.
I know that you only care about OSX, but actually OSX is just a good testcase to see whether the code is "correct" or just happens to work.</p>
<ul style="padding: 0;text-rendering: inherit;margin: 0 0 0 1em;line-height: inherit;white-space: normal;">
<li style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;">Do you compile with gcc or clang?</li>
<li style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;">Did you check whether the glibc backtrace() output is actually stripped?</li>
<li style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;">What if we compile glibc w/ llvm and glibc backtrace() fires padded " + " which llvm __cxa_demangle() cannot handle? (ok, rethorical question ;-)</li>
</ul></pre>
</blockquote>
<p>On November 24th, 2014, 9:41 nachm. UTC, <b>René J.V. Bertin</b> wrote:</p>
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><blockquote style="text-rendering: inherit;padding: 0 0 0 1em;border-left: 1px solid #bbb;white-space: normal;margin: 0 0 0 0.5em;line-height: inherit;">
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">backtrace() is provided by glibc resp. the apple (darwin) libc (i hope).</p>
</blockquote>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Not that we have something called libc on OS X, but I think that just underlines my point. The C Library is more part of the system than it is of the C "package", so the only check on compiler that would make sense IMHO is on the system compiler, as far as that's possible (like the Apple-provided <strong style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;">APPLE_CC</strong>).</p>
<blockquote style="text-rendering: inherit;padding: 0 0 0 1em;border-left: 1px solid #bbb;white-space: normal;margin: 0 0 0 0.5em;line-height: inherit;">
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">What provides /usr/include/execinfo.h on OSX?</p>
</blockquote>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">If you're talking about packages: either the standard install, or Xcode and/or "Command Line Tools".
One shouldn't take OS X as a guideline for any BSD variant, it might even have diverged too much to use BSD as a guideline for what ought to work on OS X.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">I agree about the sanitising/generalising, which is why I pulled the suppression of trailing whitespace out of the end token search (and you'll notice I don't just suppress spaces). I just don't think it'd make any sense to have a os/toolchain-specific constant and then the actual search one-liner. Just put that search statement in the conditional block and be done with it.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">This patch has currently been tested only on 10.9(.4), which means I can basically only test with clang. I can affirm though that the existing code doesn't demangle on 10.6 either, whether I use clang or gcc.</p>
<blockquote style="text-rendering: inherit;padding: 0 0 0 1em;border-left: 1px solid #bbb;white-space: normal;margin: 0 0 0 0.5em;line-height: inherit;">
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Did you check whether the glibc backtrace() output is actually stripped?</p>
</blockquote>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">I don't understand the question?</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">This is what unparsed output from backtrace_symbols looks like (even adding the counter: isn't required):</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;"><div class="codehilite" style="background: #f8f8f8"><pre style="line-height: 125%"><span style="color: #666666">0:</span> <span style="color: #BA2121">"0 libkdecore.5.dylib 0x0000000106656f71 _Z14kRealBacktracei + 81"</span>
<span style="color: #666666">1:</span> <span style="color: #BA2121">"1 kwindowtest 0x0000000105e322e1 _ZN10TestWindow8slotOpenEv + 2753"</span>
<span style="color: #666666">2:</span> <span style="color: #BA2121">"2 kwindowtest 0x0000000105e33d68 _ZN10TestWindow18qt_static_metacallEP7QObjectN11QMetaObject4CallEiPPv + 184"</span>
<span style="color: #666666">3:</span> <span style="color: #BA2121">"3 QtCore 0x0000000106c8d3fd _ZN11QMetaObject8activateEP7QObjectPKS_iPPv + 1693"</span>
<span style="color: #666666">4:</span> <span style="color: #BA2121">"4 QtGui 0x0000000106faf419 _ZN7QAction8activateENS_11ActionEventE + 233"</span>
<span style="color: #666666">5:</span> <span style="color: #BA2121">"5 QtGui 0x00000001073141e4 _ZN22QAbstractButtonPrivate5clickEv + 84"</span>
<span style="color: #666666">6:</span> <span style="color: #BA2121">"6 QtGui 0x0000000107314fc8 _ZN15QAbstractButton17mouseReleaseEventEP11QMouseEvent + 88"</span>
<span style="color: #666666">7:</span> <span style="color: #BA2121">"7 QtGui 0x00000001073db67f _ZN11QToolButton17mouseReleaseEventEP11QMouseEvent + 15"</span>
<span style="color: #666666">8:</span> <span style="color: #BA2121">"8 QtGui 0x00000001070069bd _ZN7QWidget5eventEP6QEvent + 717"</span>
<span style="color: #666666">9:</span> <span style="color: #BA2121">"9 QtGui 0x0000000107314ed4 _ZN15QAbstractButton5eventEP6QEvent + 180"</span>
<span style="color: #666666">10:</span> <span style="color: #BA2121">"10 QtGui 0x00000001073dbb2a _ZN11QToolButton5eventEP6QEvent + 170"</span>
<span style="color: #666666">11:</span> <span style="color: #BA2121">"11 QtGui 0x0000000106fb840c _ZN19QApplicationPrivate13notify_helperEP7QObjectP6QEvent + 252"</span>
<span style="color: #666666">12:</span> <span style="color: #BA2121">"12 QtGui 0x0000000106fba357 _ZN12QApplication6notifyEP7QObjectP6QEvent + 2919"</span>
<span style="color: #666666">13:</span> <span style="color: #BA2121">"13 QtCore 0x0000000106c75516 _ZN16QCoreApplication14notifyInternalEP7QObjectP6QEvent + 118"</span>
<span style="color: #666666">14:</span> <span style="color: #BA2121">"14 QtGui 0x0000000106fb8df6 _ZN19QApplicationPrivate14sendMouseEventEP7QWidgetP11QMouseEventS1_S1_PS1_R8QPointerIS0_Eb + 470"</span>
<span style="color: #666666">15:</span> <span style="color: #BA2121">"15 QtGui 0x0000000106f67a2a _Z23qt_mac_handleMouseEventP7NSEventN6QEvent4TypeEN2Qt11MouseButtonEP7QWidgetb + 922"</span>
<span style="color: #666666">16:</span> <span style="color: #BA2121">"16 AppKit 0x00007fff9491f145 -[NSWindow sendEvent:] + 781"</span>
<span style="color: #666666">17:</span> <span style="color: #BA2121">"17 QtGui 0x0000000106f5f2f1 -[QCocoaWindow sendEvent:] + 113"</span>
<span style="color: #666666">18:</span> <span style="color: #BA2121">"18 AppKit 0x00007fff948c05d4 -[NSApplication sendEvent:] + 2021"</span>
<span style="color: #666666">19:</span> <span style="color: #BA2121">"19 QtGui 0x0000000106f640fe -[QNSApplication sendEvent:] + 78"</span>
<span style="color: #666666">20:</span> <span style="color: #BA2121">"20 AppKit 0x00007fff947109f9 -[NSApplication run] + 646"</span>
<span style="color: #666666">21:</span> <span style="color: #BA2121">"21 QtGui 0x0000000106f6cba0 _ZN19QEventDispatcherMac13processEventsE6QFlagsIN10QEventLoop17ProcessEventsFlagEE + 528"</span>
<span style="color: #666666">22:</span> <span style="color: #BA2121">"22 QtCore 0x0000000106c728ad _ZN10QEventLoop4execE6QFlagsINS_17ProcessEventsFlagEE + 477"</span>
<span style="color: #666666">23:</span> <span style="color: #BA2121">"23 QtCore 0x0000000106c75ac7 _ZN16QCoreApplication4execEv + 199"</span>
<span style="color: #666666">24:</span> <span style="color: #BA2121">"24 kwindowtest 0x0000000105e33bdc main + 316"</span>
<span style="color: #666666">25:</span> <span style="color: #BA2121">"25 libdyld.dylib 0x00007fff93bb75fd start + 1"</span>
<span style="color: #666666">26:</span> <span style="color: #BA2121">"26 ??? 0x0000000000000002 0x0 + 2"</span>
</pre></div>
</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">which is converted to:</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;"><div class="codehilite" style="background: #f8f8f8"><pre style="line-height: 125%"><span style="color: #666666">0:</span> <span style="color: #666666">0</span> libkdecore<span style="color: #666666">.5</span>.dylib <span style="color: #666666">0x0000000106656f71</span> kRealBacktrace(<span style="color: #B00040">int</span>) <span style="color: #666666">+</span> <span style="color: #666666">81</span>
<span style="color: #666666">1:</span> <span style="color: #666666">1</span> kwindowtest <span style="color: #666666">0x0000000105e322e1</span> TestWindow<span style="color: #666666">::</span>slotOpen() <span style="color: #666666">+</span> <span style="color: #666666">2753</span>
<span style="color: #666666">2:</span> <span style="color: #666666">2</span> kwindowtest <span style="color: #666666">0x0000000105e33d68</span> TestWindow<span style="color: #666666">::</span>qt_static_metacall(QObject<span style="color: #666666">*</span>, QMetaObject<span style="color: #666666">::</span>Call, <span style="color: #B00040">int</span>, <span style="color: #B00040">void</span><span style="color: #666666">**</span>) <span style="color: #666666">+</span> <span style="color: #666666">184</span>
<span style="color: #666666">3:</span> <span style="color: #666666">3</span> QtCore <span style="color: #666666">0x0000000106c8d3fd</span> QMetaObject<span style="color: #666666">::</span>activate(QObject<span style="color: #666666">*</span>, QMetaObject <span style="color: #008000; font-weight: bold">const</span><span style="color: #666666">*</span>, <span style="color: #B00040">int</span>, <span style="color: #B00040">void</span><span style="color: #666666">**</span>) <span style="color: #666666">+</span> <span style="color: #666666">1693</span>
<span style="color: #666666">4:</span> <span style="color: #666666">4</span> QtGui <span style="color: #666666">0x0000000106faf419</span> QAction<span style="color: #666666">::</span>activate(QAction<span style="color: #666666">::</span>ActionEvent) <span style="color: #666666">+</span> <span style="color: #666666">233</span>
<span style="color: #666666">5:</span> <span style="color: #666666">5</span> QtGui <span style="color: #666666">0x00000001073141e4</span> QAbstractButtonPrivate<span style="color: #666666">::</span>click() <span style="color: #666666">+</span> <span style="color: #666666">84</span>
<span style="color: #666666">6:</span> <span style="color: #666666">6</span> QtGui <span style="color: #666666">0x0000000107314fc8</span> QAbstractButton<span style="color: #666666">::</span>mouseReleaseEvent(QMouseEvent<span style="color: #666666">*</span>) <span style="color: #666666">+</span> <span style="color: #666666">88</span>
<span style="color: #666666">7:</span> <span style="color: #666666">7</span> QtGui <span style="color: #666666">0x00000001073db67f</span> QToolButton<span style="color: #666666">::</span>mouseReleaseEvent(QMouseEvent<span style="color: #666666">*</span>) <span style="color: #666666">+</span> <span style="color: #666666">15</span>
<span style="color: #666666">8:</span> <span style="color: #666666">8</span> QtGui <span style="color: #666666">0x00000001070069bd</span> QWidget<span style="color: #666666">::</span>event(QEvent<span style="color: #666666">*</span>) <span style="color: #666666">+</span> <span style="color: #666666">717</span>
<span style="color: #666666">9:</span> <span style="color: #666666">9</span> QtGui <span style="color: #666666">0x0000000107314ed4</span> QAbstractButton<span style="color: #666666">::</span>event(QEvent<span style="color: #666666">*</span>) <span style="color: #666666">+</span> <span style="color: #666666">180</span>
<span style="color: #666666">10:</span> <span style="color: #666666">10</span> QtGui <span style="color: #666666">0x00000001073dbb2a</span> QToolButton<span style="color: #666666">::</span>event(QEvent<span style="color: #666666">*</span>) <span style="color: #666666">+</span> <span style="color: #666666">170</span>
<span style="color: #666666">11:</span> <span style="color: #666666">11</span> QtGui <span style="color: #666666">0x0000000106fb840c</span> QApplicationPrivate<span style="color: #666666">::</span>notify_helper(QObject<span style="color: #666666">*</span>, QEvent<span style="color: #666666">*</span>) <span style="color: #666666">+</span> <span style="color: #666666">252</span>
<span style="color: #666666">12:</span> <span style="color: #666666">12</span> QtGui <span style="color: #666666">0x0000000106fba357</span> QApplication<span style="color: #666666">::</span>notify(QObject<span style="color: #666666">*</span>, QEvent<span style="color: #666666">*</span>) <span style="color: #666666">+</span> <span style="color: #666666">2919</span>
<span style="color: #666666">13:</span> <span style="color: #666666">13</span> QtCore <span style="color: #666666">0x0000000106c75516</span> QCoreApplication<span style="color: #666666">::</span>notifyInternal(QObject<span style="color: #666666">*</span>, QEvent<span style="color: #666666">*</span>) <span style="color: #666666">+</span> <span style="color: #666666">118</span>
<span style="color: #666666">14:</span> <span style="color: #666666">14</span> QtGui <span style="color: #666666">0x0000000106fb8df6</span> QApplicationPrivate<span style="color: #666666">::</span>sendMouseEvent(QWidget<span style="color: #666666">*</span>, QMouseEvent<span style="color: #666666">*</span>, QWidget<span style="color: #666666">*</span>, QWidget<span style="color: #666666">*</span>, QWidget<span style="color: #666666">**</span>, QPointer<span style="color: #666666"><</span>QWidget<span style="color: #666666">>&</span>, <span style="color: #B00040">bool</span>) <span style="color: #666666">+</span> <span style="color: #666666">470</span>
<span style="color: #666666">15:</span> <span style="color: #666666">15</span> QtGui <span style="color: #666666">0x0000000106f67a2a</span> qt_mac_handleMouseEvent(NSEvent<span style="color: #666666">*</span>, QEvent<span style="color: #666666">::</span>Type, Qt<span style="color: #666666">::</span>MouseButton, QWidget<span style="color: #666666">*</span>, <span style="color: #B00040">bool</span>) <span style="color: #666666">+</span> <span style="color: #666666">922</span>
<span style="color: #666666">16:</span> <span style="color: #666666">16</span> AppKit <span style="color: #666666">0x00007fff9491f145</span> <span style="color: #666666">-</span>[NSWindow sendEvent<span style="color: #666666">:</span>] <span style="color: #666666">+</span> <span style="color: #666666">781</span>
<span style="color: #666666">17:</span> <span style="color: #666666">17</span> QtGui <span style="color: #666666">0x0000000106f5f2f1</span> <span style="color: #666666">-</span>[QCocoaWindow sendEvent<span style="color: #666666">:</span>] <span style="color: #666666">+</span> <span style="color: #666666">113</span>
<span style="color: #666666">18:</span> <span style="color: #666666">18</span> AppKit <span style="color: #666666">0x00007fff948c05d4</span> <span style="color: #666666">-</span>[NSApplication sendEvent<span style="color: #666666">:</span>] <span style="color: #666666">+</span> <span style="color: #666666">2021</span>
<span style="color: #666666">19:</span> <span style="color: #666666">19</span> QtGui <span style="color: #666666">0x0000000106f640fe</span> <span style="color: #666666">-</span>[QNSApplication sendEvent<span style="color: #666666">:</span>] <span style="color: #666666">+</span> <span style="color: #666666">78</span>
<span style="color: #666666">20:</span> <span style="color: #666666">20</span> AppKit <span style="color: #666666">0x00007fff947109f9</span> <span style="color: #666666">-</span>[NSApplication run] <span style="color: #666666">+</span> <span style="color: #666666">646</span>
<span style="color: #666666">21:</span> <span style="color: #666666">21</span> QtGui <span style="color: #666666">0x0000000106f6cba0</span> QEventDispatcherMac<span style="color: #666666">::</span>processEvents(QFlags<span style="color: #666666"><</span>QEventLoop<span style="color: #666666">::</span>ProcessEventsFlag<span style="color: #666666">></span>) <span style="color: #666666">+</span> <span style="color: #666666">528</span>
<span style="color: #666666">22:</span> <span style="color: #666666">22</span> QtCore <span style="color: #666666">0x0000000106c728ad</span> QEventLoop<span style="color: #666666">::</span>exec(QFlags<span style="color: #666666"><</span>QEventLoop<span style="color: #666666">::</span>ProcessEventsFlag<span style="color: #666666">></span>) <span style="color: #666666">+</span> <span style="color: #666666">477</span>
<span style="color: #666666">23:</span> <span style="color: #666666">23</span> QtCore <span style="color: #666666">0x0000000106c75ac7</span> QCoreApplication<span style="color: #666666">::</span>exec() <span style="color: #666666">+</span> <span style="color: #666666">199</span>
<span style="color: #666666">24:</span> <span style="color: #666666">24</span> kwindowtest <span style="color: #666666">0x0000000105e33bdc</span> main <span style="color: #666666">+</span> <span style="color: #666666">316</span>
<span style="color: #666666">25:</span> <span style="color: #666666">25</span> libdyld.dylib <span style="color: #666666">0x00007fff93bb75fd</span> start <span style="color: #666666">+</span> <span style="color: #666666">1</span>
<span style="color: #666666">26:</span> <span style="color: #666666">26</span> <span style="color: #666666">???</span> <span style="color: #666666">0x0000000000000002</span> <span style="color: #666666">0x0</span> <span style="color: #666666">+</span> <span style="color: #666666">2</span>
</pre></div>
</p></pre>
</blockquote>
<p>On November 25th, 2014, 2:11 nachm. UTC, <b>René J.V. Bertin</b> wrote:</p>
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Using a very simple standalone test application I have compared the <code style="text-rendering: inherit;color: #4444cc;padding: 0;white-space: normal;margin: 0;line-height: inherit;">backtrace_symbols</code> output under 10.9.4, using clang and gcc-4.8. Apparently this particular case is simple enough to avoid C++ runtime conflicts (there's main(), a <code style="text-rendering: inherit;color: #4444cc;padding: 0;white-space: normal;margin: 0;line-height: inherit;">show_backtrace</code> function that mimicks <code style="text-rendering: inherit;color: #4444cc;padding: 0;white-space: normal;margin: 0;line-height: inherit;">kRealBacktrace</code> and optionally a <code style="text-rendering: inherit;color: #4444cc;padding: 0;white-space: normal;margin: 0;line-height: inherit;">maybeDemangledName</code> when building as C++).</p>
<ul style="padding: 0;text-rendering: inherit;margin: 0 0 0 1em;line-height: inherit;white-space: normal;">
<li style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;">In pure C, both compilers give</li>
</ul>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;"><div class="codehilite" style="background: #f8f8f8"><pre style="line-height: 125%"><span style="color: #666666">0</span> backtrace <span style="color: #666666">0x0000000104d57d9c</span> show_backtrace <span style="color: #666666">+</span> <span style="color: #666666">60</span>
</pre></div>
</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">so the current parser would fail (but it's called from C++ so that's a moot point, or so I hope).</p>
<ul style="padding: 0;text-rendering: inherit;margin: 0 0 0 1em;line-height: inherit;white-space: normal;">
<li style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;">In C++ mode, both compilers give</li>
</ul>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;"><div class="codehilite" style="background: #f8f8f8"><pre style="line-height: 125%"><span style="color: #666666">0</span> backtrace <span style="color: #666666">0x000000010656dbed</span> _Z14show_backtracev <span style="color: #666666">+</span> <span style="color: #666666">61</span>
</pre></div>
</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">I'll attach the code so that it can be tested on other platforms too.</p></pre>
</blockquote>
</blockquote>
<pre style="margin-left: 1em; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Very good - I already felt stupid.
The demangled is always nullptr here and the backtrace strings do not end w/ " + *" at all. No matter whether gcc, g++, clang or clang++</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;"><em style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;">shrug</em></p></pre>
<br />
<p>- Thomas</p>
<br />
<p>On November 25th, 2014, 2:12 nachm. UTC, René J.V. Bertin wrote:</p>
<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="12" style="border: 1px #888a85 solid; border-radius: 6px; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
<tr>
<td>
<div>Review request for KDE Software on Mac OS X and kdelibs.</div>
<div>By René J.V. Bertin.</div>
<p style="color: grey;"><i>Updated Nov. 25, 2014, 2:12 nachm.</i></p>
<div style="margin-top: 1.5em;">
<b style="color: #575012; font-size: 10pt;">Repository: </b>
kdelibs
</div>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
<tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">This patch adapts the parser in <code style="text-rendering: inherit;color: #4444cc;padding: 0;white-space: normal;margin: 0;line-height: inherit;">maybeDemangledName</code> to the backtrace obtained in <code style="text-rendering: inherit;color: #4444cc;padding: 0;white-space: normal;margin: 0;line-height: inherit;">kRealBacktrace</code> on OS X.</p></pre>
</td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
<tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Works as expected on OS X 10.9.4 .</p></pre>
</td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">
<li>kdecore/io/kdebug.cpp <span style="color: grey">(872a05a)</span></li>
</ul>
<p><a href="https://git.reviewboard.kde.org/r/121213/diff/" style="margin-left: 3em;">View Diff</a></p>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">File Attachments </h1>
<li><a href="https://git.reviewboard.kde.org/media/uploaded/files/2014/11/25/e9d48fea-2506-493c-b068-26a8e7d12b6c__backtrace.c">minimal test for backtrace functionality and parsing; can be built as C and C++</a></li>
</ul>
</td>
</tr>
</table>
</div>
</body>
</html>