[Mesa-dev] [PATCH 2/2] gallium/util: libunwind support

Thomas Hellstrom thellstrom at vmware.com
Mon Apr 3 17:33:20 UTC 2017


On 04/03/2017 07:13 PM, Rob Clark wrote:
> On Mon, Apr 3, 2017 at 12:56 PM, Thomas Hellstrom <thellstrom at vmware.com> wrote:
>> Hi, Rob,
>>
>> On 03/24/2017 10:21 PM, Rob Clark wrote:
>>> It's kinda sad that (a) we don't have debug_backtrace support on !X86
>>> and that (b) we re-invent our own crude backtrace support in the first
>>> place.  If available, use libunwind instead.  The backtrace format is
>>> based on what xserver and weston use, since it is nice not to have to
>>> figure out a different format.
>>>
>>> Signed-off-by: Rob Clark <robdclark at gmail.com>
>> Did you consider glibc "backtrace()", I think it's also available on ARM...
> I had not.. although xserver and weston are already using libunwind.
> I'm not sure about portability of libunwind to other libc
> implementations (but I guess it is at least not worse than using a
> glibc specific API).
>
> I suppose we could always add a fallback to backtrace().
>
>> Also is the output format the same as before, or at least compatible with
>> gallium/tools/addr2line.sh?
> quite possibly not.. I chose to align to the format that xserver and
> weston was already using.  Otoh, not sure if you would need to use
> addr2line.sh since it already decodes things to human readable
> fxn/file names.
>
> BR,
> -R

backtrace() (or the homebrew i386 implementation) + addr2line.sh gives
you both function name, source file and line number, which IMO is pretty
useful. I'll give the new format a shot. Perhaps if needed we could have
a config option to choose the method. I guess this is mostly used in
DEBUG builds anyway, so a developer can choose the desired method...

/Thomas



>
>> Thanks,
>> Thomas
>>




More information about the mesa-dev mailing list