[PATCH v1] [gdb/python] Bploc should try to return full path

Andrew Burgess aburgess@redhat.com
Mon Jan 13 16:28:21 GMT 2025


Simon Farre <simon.farre.cx@gmail.com> writes:

> Compilers often emit relative paths in the line number program,
> relative to the build directory for that compilation unit (if it's
> DWARF>=4 I think).
>
> Therefore use symtab->fullname() when not null as this seemingly
> has attempted path normalization for the symtab and only
> fall back on symtab->filename which will never be null if that fails.

I think some of this code is showing its pre-C++ origins, but I wonder
if you'd be better using symtab_to_fullname() instead of accessing
symtab::fullname() directly?

It's not entirely clear, but I think, this will always return
non-nullptr, and will have set symtab::fullname() if needed.

Thanks,
Andrew



More information about the Gdb-patches mailing list