Review Request 121213: [OS X] correctly parse backtrace for demangling symbols

René J.V. Bertin rjvbertin-Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org
Mon Nov 24 17:53:28 GMT 2014



> On Nov. 23, 2014, 12:20 a.m., Thomas Lübking wrote:
> > kdecore/io/kdebug.cpp, line 717
> > <https://git.reviewboard.kde.org/r/121213/diff/1/?file=329504#file329504line717>
> >
> >     Why do you need to sharpen the match?
> 
> René J.V. Bertin wrote:
>     Because otherwise the symbol to be demangled is left with a trailing space, which causes the demangle to fail. Wanna know how I know?
> 
> Thomas Lübking wrote:
>     Don't know about the GCC behavior on trailing spaces, but one should probably have some "while (in.at(mangledNameEnd) == ' ') --mangledNameEnd;" loop?
> 
> René J.V. Bertin wrote:
>     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 ...
> 
> Thomas Lübking wrote:
>     ... or not at all or thrice - depending on how the mangler feels today.
>     
>     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.

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 `+` 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.


- René J.V.


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/121213/#review70796
-----------------------------------------------------------


On Nov. 23, 2014, 12:02 a.m., René J.V. Bertin wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/121213/
> -----------------------------------------------------------
> 
> (Updated Nov. 23, 2014, 12:02 a.m.)
> 
> 
> Review request for KDE Software on Mac OS X and kdelibs.
> 
> 
> Repository: kdelibs
> 
> 
> Description
> -------
> 
> This patch adapts the parser in `maybeDemangledName` to the backtrace obtained in `kRealBacktrace` on OS X.
> 
> 
> Diffs
> -----
> 
>   kdecore/io/kdebug.cpp 872a05a 
> 
> Diff: https://git.reviewboard.kde.org/r/121213/diff/
> 
> 
> Testing
> -------
> 
> Works as expected on OS X 10.9.4 .
> 
> 
> Thanks,
> 
> René J.V. Bertin
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20141124/2608871b/attachment.htm>


More information about the kde-core-devel mailing list