On Mon, Oct 29, 2012 at 10:48:24AM +0000, Philip Ashmore wrote: > >>On Mon, Oct 29, 2012 at 8:50 AM, Philip Ashmore wrote: > >>>While this feature allows gdb to know the correct source locations, using > >>>it > >>>implies that packages requiring the feature contain incorrect source paths > >>>- > >>>wouldn't it be better for these packages to contain correct source paths in > >>>the first place? [...] > In Fedora, the dbg package includes the source code for the package, > and the debug information points to it.
In Debian, they do not, and that's a feature; first, there are many valid use cases of using debug packages that do not require the source code. Second, having the source in the debug package implies duplication of said source, which is a waste of space. > In Fedora, by convention, such source code goes under /usr/src. Actually, on RPM-based systems, installing a source package implies the source goes in to /usr/src somewhere; even if you built an RPM source package with source living in $HOME, installing it will still make the source go into /usr/src. In that light, it makes sense that they have their debug packages point towards that directory. In Debian, installing a source package is just not possible technically; you can only unpack them. When you do that, by default they get unpacked in your current working directory. In other words, the location of the actual source in a source package on a Debian system is utterly unpredictable, and so there is no such concept as a "correct source location" on Debian-based systems. > If you prefer your users mess with .gdbinit so they can create a > useful stack trace then that's up to you. There is no need for source to be able to produce a useful stack trace; the file and function names are part of the debugging symbols. In other words, once you install the debugging symbols -- regardless of where they think the source lives -- you will be able to produce a useful stack trace. The only reason why you'd want to connect the source to the debugging symbold is because you need to connect the original source lines to the object code that you're inspecting -- e.g., because you're single-stepping through a library. While doing that can be useful in some corner cases, it's not something I expect a random user would ever need to do. -- Copyshops should do vouchers. So that next time some bureaucracy requires you to mail a form in triplicate, you can mail it just once, add a voucher, and save on postage.
signature.asc
Description: Digital signature