[llvm] r197988 - llvm-symbolizer: add --obj flag to specify a single object file that should be symbolized.

Ed Maste emaste at freebsd.org
Tue Jan 14 16:26:31 PST 2014


On 8 January 2014 13:39, Roman Divacky <rdivacky at freebsd.org> wrote:
> It looks like a genuine bug, it outputs:
>
> unsigned long
> /tmp/dbginfo/dwarfdump-test.cc:16:0
>
> ie. "unsigned long" instead of the expected "main", no idea why.

As it happens this seems to be a bug in FreeBSD's __cxa_demangle,
which returns "unsigned long" for "main" as input.

LLDB on FreeBSD previously experienced demangler issues with complex
mangled names, but handled unmangled names correctly.  It turns out
that LLDB first checks that names are actually mangled before calling
the demangler, and so avoids this issue:

static inline bool
cstring_is_mangled (const char *s)
{
    if (s)
        return s[0] == '_' && s[1] == 'Z';
    return false;
}

Is it reasonable to introduce a similar check in llvm-symbolizer?



More information about the llvm-commits mailing list