[PATCH] D27378: [asan] Teach asan_symbolize.py to use :arch with atos and llvm-symbolizer on Darwin

Filipe Cabecinhas via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 9 01:30:08 PST 2016


Not really:
[~]% touch 'a:b'
[~]% ls a*b
a:b
[~]% uname -s
Darwin

I think assuming that if it ends in one of the arch names it's a
filename:arch thing is safe enough. But making it impossible to have :
in the filename seems like too much (maybe it isn't?).
How about something like '^( *#([0-9]+) *)(0x[0-9a-f]+)
*\((.*)(:[a-z0-9]\+)?\+(0x[0-9a-f]+)\)'
Then you need to test that group to see if it matches one of the
supported archs, and join the strings if it doesn't. This is not
ideal, as it's an additional place to update when adding arches. Maybe
adding a comment to the .h file would help make sure we don't forget.
It's also a bit more complicated than we'd like :-(

Thank you,
 Filipe

On Thu, Dec 8, 2016 at 10:09 PM, Kuba (Brecka) Mracek via Phabricator
<reviews at reviews.llvm.org> wrote:
> kubabrecka added inline comments.
>
>
> ================
> Comment at: lib/asan/scripts/asan_symbolize.py:444
>      stack_trace_line_format = (
> -        '^( *#([0-9]+) *)(0x[0-9a-f]+) *\((.*)\+(0x[0-9a-f]+)\)')
> +        '^( *#([0-9]+) *)(0x[0-9a-f]+) *\(([^:]*)(:(.*))?\+(0x[0-9a-f]+)\)')
>      match = re.match(stack_trace_line_format, line)
> ----------------
> filcab wrote:
>> Isn't `:` a valid filename character on most Linux fs?
> Ah, okay.  Do you want me to restrict this to Darwin?
>
>
> Repository:
>   rL LLVM
>
> https://reviews.llvm.org/D27378
>
>
>


More information about the llvm-commits mailing list