This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch+doc 1/2] filename-display: 1->4 options {inferior,libs}{,-sepdebug}
On Thu, 07 Mar 2013 14:36:07 +0100, Pedro Alves wrote:
> The set of system paths is defined by the OS
> integrator, so seemed closer to being bounded to me.
> The user can well put files wherever it wants.
[...]
> Irrespective of glass half empty vs half full, I guess the first
> question is whether by-path is a better approach than by
> have-sep-debug. It _feels_ more to the point, therefore better to
> me, but I'm not really trying to impose it or block the other
> approach. I wonder what others think.
[...]
> Using sepdebug for system/non-system also feels like will always
> have corner cases, though.
It complex to configure - it will need setting it by distros (from gdb.spec
and similar files) and after all it is also not foolproof, people install
their own binaries to /usr/bin and one may ask how should those be displayed.
The primary problem is that making the setup non-trivial is IMO not worth it
as the "relative" setting does not work correctly anyway. It should be IMO
relative to the package build directory but in reality it is:
* either "absolute" anyway if package always calls: gcc $PWD/parser/file.c
* or "basename" if package always calls: cd parser; gcc file.c
* or what is expected as relative if package calls: gcc parser/file.c
(BTW sure one can always detect the full $PWD/parser/file.c path by looking
also at DW_AT_comp_dir but that is not what "relative" does.)
So if some complex solution should be done one should first fix the "relative"
behavior so that it makes sense (=introduce a 4th new option). I hope
everyone agrees the correct behavior is to display source filesnames relative
to the unpacked package base source directory.
If we already get configured distro-configurable system directories I have an
idea - strip all common directories of all the source files but excluding
source files which come from the distro-configurable system directories. This
is where I failed with the common directories stripping draft patch before as
one gets included files like
/builddir/build/BUILD/glibc-2.15-a316c1f/malloc/mcheck-init.c:
[patch FYI not for commit] Attempt to properly relativize executable's filenames
http://sourceware.org/ml/gdb-patches/2013-02/msg00412.html
Message-ID: <20130215195801.GA18966@host2.jankratochvil.net>
It goes all a bit more far than I planned but OK, when you ask for it.
Thanks,
Jan