Re: relative path in -dbg packages

2015-05-21 Thread Mathieu Malaterre
For reference.

On Fri, Nov 14, 2014 at 2:34 PM, Mathieu Malaterre ma...@debian.org wrote:
 While reading the wiki page for AutomaticDebugPackages, I was
 wondering if it is possible to post-processed object file to
 manipulate relatives path for debug info ?

 Typical use case is that after installing the -dbg package, you end up
 with a gdb backtrace saying:

 [...]
 brw_meta_fast_clear (brw=brw@entry=0x7fffd4097a08,
 fb=fb@entry=0x7fffd40fa900, buffers=buffers@entry=2,
 partial_clear=partial_clear@entry=false)
 at 
 ../../../../../../../src/mesa/drivers/dri/i965/brw_meta_fast_clear.c:447
 447 ../../../../../../../src/mesa/drivers/dri/i965/brw_meta_fast_clear.c:
 No such file or directory.
 [...]

 Unless you create a fake directory tree, it is tedious to get any
 sense of the above.

Technically this case is easy (no need for `substitute` keyword), all
'..' gets replaced automatically. So you only need to have a 'src'
directory pointing to mesa-X.Y/src.

Ref:
https://sourceware.org/gdb/onlinedocs/gdb/Source-Path.html

[...]
Plain file names, relative file names with leading directories, file
names containing dots, etc. are all treated as described above; for
instance, if the source path is /mnt/cross, and the source file is
recorded as ../lib/foo.c, gdb would first try ../lib/foo.c, then
/mnt/cross/../lib/foo.c, and after that—/mnt/cross/foo.c.
[...]


--
To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: 
https://lists.debian.org/ca+7wuszqe6ji_eamzrtzpsjsfs+1lj33b1gqqlnawoshs_r...@mail.gmail.com



Re: relative path in -dbg packages

2014-11-15 Thread Jérémy Bobbio
Mathieu Malaterre:
 While reading the wiki page for AutomaticDebugPackages, I was
 wondering if it is possible to post-processed object file to
 manipulate relatives path for debug info ?

As part of the reproducible builds effort [1], it has so far proven to
be very difficult to do so in a consistant manner. Be it with debugedit
or -fdebug-prefix-map. Building packages in the right directory from the
beginning is much more easier.

 2. Is it possible to reserve a system path for debug information, eg
 all debug paths should start with /usr/src/debug

During discussions at DebConf14 [2], there was a consensus that a
canonical build path in (at least) pbuilder and sbuild would be a pretty
sensible requirement. We thought of `/usr/src/debian/hello-2.8-1`.
Users would then be able to unpack a source package in the same location
and have gdb happy without further configuration.

 [1]: https://wiki.debian.org/ReproducibleBuilds
 [2]: 
https://lists.alioth.debian.org/pipermail/reproducible-builds/Week-of-Mon-20140901/000198.html

(Please Cc: me in replies, I am not subscribed to -devel.)

-- 
Lunar.''`. 
lu...@debian.org: :Ⓐ  :  # apt-get install anarchism
`. `'` 
  `-   


signature.asc
Description: Digital signature


relative path in -dbg packages

2014-11-14 Thread Mathieu Malaterre
While reading the wiki page for AutomaticDebugPackages, I was
wondering if it is possible to post-processed object file to
manipulate relatives path for debug info ?

Typical use case is that after installing the -dbg package, you end up
with a gdb backtrace saying:

[...]
brw_meta_fast_clear (brw=brw@entry=0x7fffd4097a08,
fb=fb@entry=0x7fffd40fa900, buffers=buffers@entry=2,
partial_clear=partial_clear@entry=false)
at ../../../../../../../src/mesa/drivers/dri/i965/brw_meta_fast_clear.c:447
447 ../../../../../../../src/mesa/drivers/dri/i965/brw_meta_fast_clear.c:
No such file or directory.
[...]

Unless you create a fake directory tree, it is tedious to get any
sense of the above.

Sometimes you even get a hardcoded /buildd toplevel path, which may
be annoying to create just to get proper context (function name,
instruction...) for reporting a bug.

So my questions are:
1. Is it possible to post-processed those objects file and change
relative path to full path
2. Is it possible to reserve a system path for debug information, eg
all debug paths should start with /usr/src/debug

Thanks for comments,


-- 
To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: 
https://lists.debian.org/CA+7wUsxjQE66LmQAwm1by_wsvtjxsMeNY9Uyw1Si6=wpxqb...@mail.gmail.com



Re: relative path in -dbg packages

2014-11-14 Thread Neil Williams
On Fri, 14 Nov 2014 14:34:19 +0100
Mathieu Malaterre ma...@debian.org wrote:

 While reading the wiki page for AutomaticDebugPackages, I was
 wondering if it is possible to post-processed object file to
 manipulate relatives path for debug info ?
 
 Typical use case is that after installing the -dbg package, you end up
 with a gdb backtrace saying:
 
 [...]
 brw_meta_fast_clear (brw=brw@entry=0x7fffd4097a08,
 fb=fb@entry=0x7fffd40fa900, buffers=buffers@entry=2,
 partial_clear=partial_clear@entry=false)
 at 
 ../../../../../../../src/mesa/drivers/dri/i965/brw_meta_fast_clear.c:447
 447 ../../../../../../../src/mesa/drivers/dri/i965/brw_meta_fast_clear.c:
 No such file or directory.
 [...]
 
 Unless you create a fake directory tree, it is tedious to get any
 sense of the above.
 
 Sometimes you even get a hardcoded /buildd toplevel path, which may
 be annoying to create just to get proper context (function name,
 instruction...) for reporting a bug.
 
 So my questions are:
 1. Is it possible to post-processed those objects file and change
 relative path to full path
 2. Is it possible to reserve a system path for debug information, eg
 all debug paths should start with /usr/src/debug

Isn't there just a gdb user configuration option to set the paths into
which you want gdb to look for these paths? source packages do not
unpack to /usr/src (that sounds like an rpm-ism), so these paths are
entirely arbitrary. This isn't about the debug symbols (which are in a
standard system path /usr/lib/debug/) - this is about the particular
copy of the source code to look up those symbols and apt-get source
will put that wherever you want it. You then need to tell gdb where to
find the .c files.

So your second question is invalid. The debug information could mean
two things - the debug symbols which are in a standard path and the
source code which is not. This also means that there is no point in
pre-processing - gdb can do it on a per-user (per project?) basis. (I
just can't remember the syntax offhand).



-- 


Neil Williams
=
http://www.linux.codehelp.co.uk/



pgpmSqLV1821X.pgp
Description: OpenPGP digital signature


Re: relative path in -dbg packages

2014-11-14 Thread Jakub Wilk

* Neil Williams codeh...@debian.org, 2014-11-14, 15:21:

Mathieu Malaterre ma...@debian.org wrote:

[...]

Sometimes you even get a hardcoded /buildd toplevel path,


Or /tmp/buildd/, or /home/bob/, which both smell like a (small) security 
hole.



So my questions are:
1. Is it possible to post-processed those objects file and change 
relative path to full path


https://packages.debian.org/sid/debugedit

2. Is it possible to reserve a system path for debug information, eg 
all debug paths should start with /usr/src/debug


Isn't there just a gdb user configuration option to set the paths into 
which you want gdb to look for these paths?


https://sourceware.org/gdb/onlinedocs/gdb/Source-Path.html

--
Jakub Wilk


--
To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: https://lists.debian.org/20141114183158.ga7...@jwilk.net