public inbox for cygwin-apps@cygwin.com
 help / color / mirror / Atom feed
* [RFC] cygport: split debuginfo packages
@ 2012-06-21  6:24 Yaakov (Cygwin/X)
  2012-06-21  9:03 ` Corinna Vinschen
                   ` (4 more replies)
  0 siblings, 5 replies; 22+ messages in thread
From: Yaakov (Cygwin/X) @ 2012-06-21  6:24 UTC (permalink / raw)
  To: cygwin-apps

[-- Attachment #1: Type: text/plain, Size: 1339 bytes --]

Attached is a first draft of a patch to support split debuginfo packages 
automatically in cygport.  I'm looking for comments and suggestions, 
particularly on the following:

1) I propose adding a Debug category for all -debuginfo packages.

2) This places the debuginfo from e.g. /usr/bin/cygfoo-X.dll into 
/usr/lib/debug/usr/bin/cygfoo-X.dbg.  Unfortunately, when gdb finds 
library dependencies, they show up as e.g. 
/cygdrive/c/cygwin/bin/cygfoo-X.dll instead of as in /usr/bin, causing 
gdb to not find the debug file.  There are at least three solutions to this:

a. Fix (cygwin or) gdb to use /usr paths over /cygdrive/c/cygwin paths;
b. Move debug files to a .debug subdirectory (e.g. 
/usr/bin/.debug/cygfoo-X.dbg);
c. Move debug files alongside binaries (e.g. /usr/bin/cygfoo-X.dbg).

3) Sources referenced by the .dbg files are placed under 
/usr/src/debug/${PF}, as indicated by the -fdebug-prefix-map flags. 
Unfortunately, this breaks in-tree debugging (e.g. a noinst test or 
sample application).  AFAICS, binutils doesn't support changing the 
debug-prefix-map after the fact.  Does anyone have any suggestions on 
how to handle this?

4) The resulting binaries are somewhat larger, having only been 
--strip-debug'ed; what more is lost by --strip-unneeded or --strip-all 
to justify the larger binaries?

TIA,


Yaakov

[-- Attachment #2: 0001-debuginfo.patch --]
[-- Type: application/x-itunes-itlp, Size: 6380 bytes --]

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [RFC] cygport: split debuginfo packages
  2012-06-21  6:24 [RFC] cygport: split debuginfo packages Yaakov (Cygwin/X)
@ 2012-06-21  9:03 ` Corinna Vinschen
  2012-06-21  9:35   ` Corinna Vinschen
  2012-06-21 19:47   ` Yaakov (Cygwin/X)
  2012-06-21 12:56 ` Christopher Faylor
                   ` (3 subsequent siblings)
  4 siblings, 2 replies; 22+ messages in thread
From: Corinna Vinschen @ 2012-06-21  9:03 UTC (permalink / raw)
  To: cygwin-apps

On Jun 21 01:24, Yaakov (Cygwin/X) wrote:
> Attached is a first draft of a patch to support split debuginfo
> packages automatically in cygport.  I'm looking for comments and
> suggestions, particularly on the following:
> 
> 1) I propose adding a Debug category for all -debuginfo packages.
> 
> 2) This places the debuginfo from e.g. /usr/bin/cygfoo-X.dll into
> /usr/lib/debug/usr/bin/cygfoo-X.dbg.  Unfortunately, when gdb finds
> library dependencies, they show up as e.g.
> /cygdrive/c/cygwin/bin/cygfoo-X.dll instead of as in /usr/bin,
> causing gdb to not find the debug file.  There are at least three
> solutions to this:
> 
> a. Fix (cygwin or) gdb to use /usr paths over /cygdrive/c/cygwin paths;

I just had a quick look into this issue and it turns out that GDB
doesn't use cygwin_conv_path in all circumstances.  Rather, it uses
realpath in most circumstances.

The problem is a long standing behaviour (since 2005) of realpath:
A DOS path is always converted to its /cygdrive equivalent.

I think the right thing to do here is to fix realpath.  It just has
to be done carefully so as not to re-introduce the bugs fixed by
introducing this behaviour back then.

> b. Move debug files to a .debug subdirectory (e.g.
> /usr/bin/.debug/cygfoo-X.dbg);
> c. Move debug files alongside binaries (e.g. /usr/bin/cygfoo-X.dbg).

The upside of c is that debug files alongside the binaries always works.
The downside is the enormous clutter in /bin.  I'll fix realpath in the
first place and then we can see how /usr/lib/debug works out, I guess.

> 3) Sources referenced by the .dbg files are placed under
> /usr/src/debug/${PF}, as indicated by the -fdebug-prefix-map flags.

I don't quite understand that.  The sources are not part of the
debuginfo package.  And usually you'd want to reference the sources
from your builds.  Wouldn't /usr/src/${PVR}/src make more sense?

> Unfortunately, this breaks in-tree debugging (e.g. a noinst test or
> sample application).  AFAICS, binutils doesn't support changing the
> debug-prefix-map after the fact.  Does anyone have any suggestions
> on how to handle this?

Well, there's the "dir" command on the GDB command line...

> 4) The resulting binaries are somewhat larger, having only been
> --strip-debug'ed; what more is lost by --strip-unneeded or
> --strip-all to justify the larger binaries?

I don't know.  Did you look with objdump -h what the difference is?


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [RFC] cygport: split debuginfo packages
  2012-06-21  9:03 ` Corinna Vinschen
@ 2012-06-21  9:35   ` Corinna Vinschen
  2012-06-21 19:47   ` Yaakov (Cygwin/X)
  1 sibling, 0 replies; 22+ messages in thread
From: Corinna Vinschen @ 2012-06-21  9:35 UTC (permalink / raw)
  To: cygwin-apps

On Jun 21 11:03, Corinna Vinschen wrote:
> On Jun 21 01:24, Yaakov (Cygwin/X) wrote:
> > Attached is a first draft of a patch to support split debuginfo
> > packages automatically in cygport.  I'm looking for comments and
> > suggestions, particularly on the following:
> > 
> > 1) I propose adding a Debug category for all -debuginfo packages.
> > 
> > 2) This places the debuginfo from e.g. /usr/bin/cygfoo-X.dll into
> > /usr/lib/debug/usr/bin/cygfoo-X.dbg.  Unfortunately, when gdb finds
> > library dependencies, they show up as e.g.
> > /cygdrive/c/cygwin/bin/cygfoo-X.dll instead of as in /usr/bin,
> > causing gdb to not find the debug file.  There are at least three
> > solutions to this:
> > 
> > a. Fix (cygwin or) gdb to use /usr paths over /cygdrive/c/cygwin paths;
> 
> I just had a quick look into this issue and it turns out that GDB
> doesn't use cygwin_conv_path in all circumstances.  Rather, it uses
> realpath in most circumstances.
> 
> The problem is a long standing behaviour (since 2005) of realpath:
> A DOS path is always converted to its /cygdrive equivalent.
> 
> I think the right thing to do here is to fix realpath.  It just has
> to be done carefully so as not to re-introduce the bugs fixed by
> introducing this behaviour back then.
> 
> > b. Move debug files to a .debug subdirectory (e.g.
> > /usr/bin/.debug/cygfoo-X.dbg);
> > c. Move debug files alongside binaries (e.g. /usr/bin/cygfoo-X.dbg).
> 
> The upside of c is that debug files alongside the binaries always works.
> The downside is the enormous clutter in /bin.  I'll fix realpath in the
> first place and then we can see how /usr/lib/debug works out, I guess.

That was easier thatn I thought.  I applied a patch so realpath now
returns a "real" POSIX path, just like cygwin_conv_path.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [RFC] cygport: split debuginfo packages
  2012-06-21  6:24 [RFC] cygport: split debuginfo packages Yaakov (Cygwin/X)
  2012-06-21  9:03 ` Corinna Vinschen
@ 2012-06-21 12:56 ` Christopher Faylor
  2012-06-21 14:22   ` Jon TURNEY
  2012-06-22 15:23 ` Ken Brown
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 22+ messages in thread
From: Christopher Faylor @ 2012-06-21 12:56 UTC (permalink / raw)
  To: cygwin-apps

On Thu, Jun 21, 2012 at 01:24:36AM -0500, Yaakov (Cygwin/X) wrote:
>Attached is a first draft of a patch to support split debuginfo packages 
>automatically in cygport.  I'm looking for comments and suggestions, 
>particularly on the following:
>
>1) I propose adding a Debug category for all -debuginfo packages.
>
>2) This places the debuginfo from e.g. /usr/bin/cygfoo-X.dll into 
>/usr/lib/debug/usr/bin/cygfoo-X.dbg.  Unfortunately, when gdb finds 
>library dependencies, they show up as e.g. 
>/cygdrive/c/cygwin/bin/cygfoo-X.dll instead of as in /usr/bin, causing 
>gdb to not find the debug file.  There are at least three solutions to this:
>
>a. Fix (cygwin or) gdb to use /usr paths over /cygdrive/c/cygwin paths;

Why is this necessary?  The path to the debuginfo file is supposed to be
in the executable.  cygwin1.dll doesn't use cygdrive.

cgf

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [RFC] cygport: split debuginfo packages
  2012-06-21 12:56 ` Christopher Faylor
@ 2012-06-21 14:22   ` Jon TURNEY
  2012-06-21 16:10     ` Christopher Faylor
  0 siblings, 1 reply; 22+ messages in thread
From: Jon TURNEY @ 2012-06-21 14:22 UTC (permalink / raw)
  To: cygwin-apps

On 21/06/2012 13:56, Christopher Faylor wrote:
> On Thu, Jun 21, 2012 at 01:24:36AM -0500, Yaakov (Cygwin/X) wrote:
>> Attached is a first draft of a patch to support split debuginfo packages 
>> automatically in cygport.  I'm looking for comments and suggestions, 
>> particularly on the following:
>>
>> 1) I propose adding a Debug category for all -debuginfo packages.
>>
>> 2) This places the debuginfo from e.g. /usr/bin/cygfoo-X.dll into 
>> /usr/lib/debug/usr/bin/cygfoo-X.dbg.  Unfortunately, when gdb finds 
>> library dependencies, they show up as e.g. 
>> /cygdrive/c/cygwin/bin/cygfoo-X.dll instead of as in /usr/bin, causing 
>> gdb to not find the debug file.  There are at least three solutions to this:
>>
>> a. Fix (cygwin or) gdb to use /usr paths over /cygdrive/c/cygwin paths;
> 
> Why is this necessary?  The path to the debuginfo file is supposed to be
> in the executable.  cygwin1.dll doesn't use cygdrive.

The .gnu_debuglink section is supposed to contain a filename, not a pathname.
 It's up to the debugger to work out where the file is.

[1] http://sourceware.org/gdb/onlinedocs/gdb/Separate-Debug-Files.html

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [RFC] cygport: split debuginfo packages
  2012-06-21 14:22   ` Jon TURNEY
@ 2012-06-21 16:10     ` Christopher Faylor
  0 siblings, 0 replies; 22+ messages in thread
From: Christopher Faylor @ 2012-06-21 16:10 UTC (permalink / raw)
  To: cygwin-apps

On Thu, Jun 21, 2012 at 03:21:49PM +0100, Jon TURNEY wrote:
>On 21/06/2012 13:56, Christopher Faylor wrote:
>> On Thu, Jun 21, 2012 at 01:24:36AM -0500, Yaakov (Cygwin/X) wrote:
>>> Attached is a first draft of a patch to support split debuginfo packages 
>>> automatically in cygport.  I'm looking for comments and suggestions, 
>>> particularly on the following:
>>>
>>> 1) I propose adding a Debug category for all -debuginfo packages.
>>>
>>> 2) This places the debuginfo from e.g. /usr/bin/cygfoo-X.dll into 
>>> /usr/lib/debug/usr/bin/cygfoo-X.dbg.  Unfortunately, when gdb finds 
>>> library dependencies, they show up as e.g. 
>>> /cygdrive/c/cygwin/bin/cygfoo-X.dll instead of as in /usr/bin, causing 
>>> gdb to not find the debug file.  There are at least three solutions to this:
>>>
>>> a. Fix (cygwin or) gdb to use /usr paths over /cygdrive/c/cygwin paths;
>> 
>> Why is this necessary?  The path to the debuginfo file is supposed to be
>> in the executable.  cygwin1.dll doesn't use cygdrive.
>
>The .gnu_debuglink section is supposed to contain a filename, not a pathname.
> It's up to the debugger to work out where the file is.
>
>[1] http://sourceware.org/gdb/onlinedocs/gdb/Separate-Debug-Files.html

Ah, ok.  Thanks.  You'd think that I would know this since I maintain gdb
and set up cygwin1.dbg.

cgf

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [RFC] cygport: split debuginfo packages
  2012-06-21  9:03 ` Corinna Vinschen
  2012-06-21  9:35   ` Corinna Vinschen
@ 2012-06-21 19:47   ` Yaakov (Cygwin/X)
  2012-06-22  9:51     ` Corinna Vinschen
  1 sibling, 1 reply; 22+ messages in thread
From: Yaakov (Cygwin/X) @ 2012-06-21 19:47 UTC (permalink / raw)
  To: cygwin-apps

On 2012-06-21 04:03, Corinna Vinschen wrote:
> On Jun 21 01:24, Yaakov (Cygwin/X) wrote:
>> 2) This places the debuginfo from e.g. /usr/bin/cygfoo-X.dll into
>> /usr/lib/debug/usr/bin/cygfoo-X.dbg.  Unfortunately, when gdb finds
>> library dependencies, they show up as e.g.
>> /cygdrive/c/cygwin/bin/cygfoo-X.dll instead of as in /usr/bin,
>> causing gdb to not find the debug file.  There are at least three
>> solutions to this:
>>
>> a. Fix (cygwin or) gdb to use /usr paths over /cygdrive/c/cygwin paths;
>
> I just had a quick look into this issue and it turns out that GDB
> doesn't use cygwin_conv_path in all circumstances.  Rather, it uses
> realpath in most circumstances.
>
> The problem is a long standing behaviour (since 2005) of realpath:
> A DOS path is always converted to its /cygdrive equivalent.
>
> I think the right thing to do here is to fix realpath.

Thanks for tracking that down.

>> 3) Sources referenced by the .dbg files are placed under
>> /usr/src/debug/${PF}, as indicated by the -fdebug-prefix-map flags.
>
> I don't quite understand that.  The sources are not part of the
> debuginfo package.  And usually you'd want to reference the sources
> from your builds.  Wouldn't /usr/src/${PVR}/src make more sense?

Fedora -debuginfo packages include referenced sources in a 
package-specific subdir of /usr/src/debug.  There are several reasons 
for this:

* packages may be built anywhere on the system (a single location is 
required to be useful by all);
* relying on -src means -debuginfo isn't usable by itself (requires an 
extra installation step);
* sources generated during the build won't be found (this is why 
__prepdebugsrc checks in $B as well as $S for sources).

It seems RPM solves this dilemma by changing the encoded 
debug-prefix-map on the fly[1], but that program is ELF-specific.

>> Unfortunately, this breaks in-tree debugging (e.g. a noinst test or
>> sample application).  AFAICS, binutils doesn't support changing the
>> debug-prefix-map after the fact.  Does anyone have any suggestions
>> on how to handle this?
>
> Well, there's the "dir" command on the GDB command line...

That is a pain, as all but the smallest packages have sources in more 
than one (sub)directory.  But now that you mention it, substitute-path 
would be a feasible solution in most cases.

So the question is, are package maintainers okay with an additional 
directory or substitute-path for in-tree debugging, or can we find an 
equivalent to RPM's debugedit?

>> 4) The resulting binaries are somewhat larger, having only been
>> --strip-debug'ed; what more is lost by --strip-unneeded or
>> --strip-all to justify the larger binaries?
>
> I don't know.  Did you look with objdump -h what the difference is?

There is no difference in objdump -h output between the results of any 
of the --strip-* options, but the file sizes definitely change, e.g.:

unstripped        4766253 bytes
split .dbg file   3765748
--strip-debug     1479875
--strip-unneeded  1069624
--strip-all       1024014

(This is before --add-gnu-debuglink, which adds 527 bytes.)

Unfortunately, the manpages aren't clear; what exactly is meant by 
"symbols needed for relocation processing" and "[non-debugging] symbols 
that are not needed for relocation processing"?


Yaakov

[1] http://rpm.org/gitweb?p=rpm.git;a=blob;f=tools/debugedit.c;hb=HEAD

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [RFC] cygport: split debuginfo packages
  2012-06-21 19:47   ` Yaakov (Cygwin/X)
@ 2012-06-22  9:51     ` Corinna Vinschen
  0 siblings, 0 replies; 22+ messages in thread
From: Corinna Vinschen @ 2012-06-22  9:51 UTC (permalink / raw)
  To: cygwin-apps

On Jun 21 14:47, Yaakov (Cygwin/X) wrote:
> On 2012-06-21 04:03, Corinna Vinschen wrote:
> >On Jun 21 01:24, Yaakov (Cygwin/X) wrote:
> >>3) Sources referenced by the .dbg files are placed under
> >>/usr/src/debug/${PF}, as indicated by the -fdebug-prefix-map flags.
> >
> >I don't quite understand that.  The sources are not part of the
> >debuginfo package.  And usually you'd want to reference the sources
> >from your builds.  Wouldn't /usr/src/${PVR}/src make more sense?
> 
> Fedora -debuginfo packages include referenced sources in a > package-specific subdir of /usr/src/debug.  There are several
> reasons for this:
> 
> * packages may be built anywhere on the system (a single location is
> required to be useful by all);
> * relying on -src means -debuginfo isn't usable by itself (requires
> an extra installation step);
> * sources generated during the build won't be found (this is why
> __prepdebugsrc checks in $B as well as $S for sources).
> 
> It seems RPM solves this dilemma by changing the encoded
> debug-prefix-map on the fly[1], but that program is ELF-specific.

Hmm, too bad.  In theory it should be possible to tweak the tool to work
on PE-COFF files as well.  After all, we also use Dwarf2 debug
information, so the core of the application is the same.  Just the way
how to read and write the sections has to be changed.  Could be a bit
tricky, though.

> >>Unfortunately, this breaks in-tree debugging (e.g. a noinst test or
> >>sample application).  AFAICS, binutils doesn't support changing the
> >>debug-prefix-map after the fact.  Does anyone have any suggestions
> >>on how to handle this?

Just an idle idea.  What if the compile step omits -fdebug-prefix-map,
and the install step rebuilds the binaries with -fdebug-prefix-map?
Could take quite a while on big packages, though...

> >Well, there's the "dir" command on the GDB command line...
> 
> That is a pain, as all but the smallest packages have sources in
> more than one (sub)directory.  But now that you mention it,
> substitute-path would be a feasible solution in most cases.
> 
> So the question is, are package maintainers okay with an additional
> directory or substitute-path for in-tree debugging, or can we find
> an equivalent to RPM's debugedit?

Or, what about this?  Always build with -fdebug-prefix-map, but also
add a .gdbinit file to the bin directory which sets the search directories
accordingly for the local debugging of the maintainer?  GDB itself does the
same to enable to debug the just built GDB with the system GDB.

> >>4) The resulting binaries are somewhat larger, having only been
> >>--strip-debug'ed; what more is lost by --strip-unneeded or
> >>--strip-all to justify the larger binaries?
> >
> >I don't know.  Did you look with objdump -h what the difference is?
> 
> There is no difference in objdump -h output between the results of
> any of the --strip-* options, but the file sizes definitely change,
> e.g.:
> 
> unstripped        4766253 bytes
> split .dbg file   3765748
> --strip-debug     1479875
> --strip-unneeded  1069624
> --strip-all       1024014
> 
> (This is before --add-gnu-debuglink, which adds 527 bytes.)
> 
> Unfortunately, the manpages aren't clear; what exactly is meant by
> "symbols needed for relocation processing" and "[non-debugging]
> symbols that are not needed for relocation processing"?

I have no idea, sorry.  WHy don't you just call strip without option?
This always worked so far, afaics.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [RFC] cygport: split debuginfo packages
  2012-06-21  6:24 [RFC] cygport: split debuginfo packages Yaakov (Cygwin/X)
  2012-06-21  9:03 ` Corinna Vinschen
  2012-06-21 12:56 ` Christopher Faylor
@ 2012-06-22 15:23 ` Ken Brown
  2012-06-29 19:48 ` Yaakov (Cygwin/X)
  2012-07-17 18:37 ` Achim Gratz
  4 siblings, 0 replies; 22+ messages in thread
From: Ken Brown @ 2012-06-22 15:23 UTC (permalink / raw)
  To: cygwin-apps

On 6/21/2012 2:24 AM, Yaakov (Cygwin/X) wrote:
> Attached is a first draft of a patch to support split debuginfo packages
> automatically in cygport.

Thanks for doing this.  I tested it on my emacs package, and the build 
seemed to work as expected except for two minor glitches:

* In line 82 of your patch, "-d" should be "-f".

* In line 174 of your patch, "-f" should be "-d".

Ken

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [RFC] cygport: split debuginfo packages
  2012-06-21  6:24 [RFC] cygport: split debuginfo packages Yaakov (Cygwin/X)
                   ` (2 preceding siblings ...)
  2012-06-22 15:23 ` Ken Brown
@ 2012-06-29 19:48 ` Yaakov (Cygwin/X)
  2012-06-30 16:49   ` Ken Brown
  2012-07-07 13:11   ` Jon TURNEY
  2012-07-17 18:37 ` Achim Gratz
  4 siblings, 2 replies; 22+ messages in thread
From: Yaakov (Cygwin/X) @ 2012-06-29 19:48 UTC (permalink / raw)
  To: cygwin-apps

[-- Attachment #1: Type: text/plain, Size: 204 bytes --]

On Thu, 2012-06-21 at 01:24 -0500, Yaakov (Cygwin/X) wrote:
> Attached is a first draft of a patch to support split debuginfo packages 
> automatically in cygport.

Second draft patch attached.


Yaakov


[-- Attachment #2: 0001-debuginfo.patch --]
[-- Type: text/x-patch, Size: 7576 bytes --]

diff --git a/bin/cygport.in b/bin/cygport.in
index 32e7dd1..b3d953b 100755
--- a/bin/cygport.in
+++ b/bin/cygport.in
@@ -589,6 +589,23 @@ declare -r src_patchfile=${PF}.src.patch;
 declare -ar pkg_name=(${PKG_NAMES:-${PN}});
 declare -r  pkg_count=${#pkg_name[*]};
 
+# this requires S and B to be already defined
+if ! defined _CYGPORT_RESTRICT_debuginfo_
+then
+	for flags in {C,CXX,F,FC,GCJ,GO,OBJC,OBJCXX}FLAGS
+	do
+		for map in ${DEBUG_PREFIX_MAPS[*]}
+		do
+			declare ${flags}+=" -fdebug-prefix-map=${map}=/usr/src/debug/${PF}"
+		done
+		declare ${flags}+=" -fdebug-prefix-map==/usr/src/debug/${PF}/"
+		declare ${flags}+=" -fdebug-prefix-map=/usr=/usr"
+		declare ${flags}+=" -fdebug-prefix-map=${B}=/usr/src/debug/${PF}"
+		declare ${flags}+=" -fdebug-prefix-map=${S}=/usr/src/debug/${PF}"
+	done
+	unset flags map
+fi
+
 ################################################################################
 #
 # Command processing
diff --git a/cygclass/qt4-qmake.cygclass b/cygclass/qt4-qmake.cygclass
index 521b0a3..452f02e 100644
--- a/cygclass/qt4-qmake.cygclass
+++ b/cygclass/qt4-qmake.cygclass
@@ -49,8 +49,12 @@ cygqmake4() {
 		error "libQtCore4-devel is required to build this package"
 	fi
 
-	${QT4_QMAKE} -spec ${QMAKESPEC} -recursive ${CYGQMAKE4_ARGS} ${@} \
-			|| error "qmake failed"
+	${QT4_QMAKE} -spec ${QMAKESPEC} -recursive \
+		QMAKE_CFLAGS_RELEASE="${CFLAGS}" \
+		QMAKE_CXXFLAGS_RELEASE="${CXXFLAGS}" \
+		QMAKE_STRIP=: \
+		${CYGQMAKE4_ARGS} ${@} \
+		|| error "qmake failed"
 }
 
 #****C* qt4-qmake.cygclass/qt4_qmake_compile
diff --git a/lib/compilers.cygpart b/lib/compilers.cygpart
index c543218..29882aa 100644
--- a/lib/compilers.cygpart
+++ b/lib/compilers.cygpart
@@ -33,7 +33,7 @@ declare -x CC="gcc";
 #  DEFAULT VALUE
 #  -g -O2 -pipe
 #****
-declare -x CFLAGS="-g -O2 -pipe ";
+declare -x CFLAGS="-ggdb -O2 -pipe";
 
 #****v* Compiling/CPPFLAGS
 #  DESCRIPTION
diff --git a/lib/pkg_pkg.cygpart b/lib/pkg_pkg.cygpart
index b645255..2952682 100644
--- a/lib/pkg_pkg.cygpart
+++ b/lib/pkg_pkg.cygpart
@@ -128,7 +128,7 @@ __pkg_binpkg() {
 
 		if defined pkg_contents
 		then
-			tar jcvf ${top}/${pkg_name[${n}]}-${PVR}.tar.bz2 ${pkg_contents} \
+			tar jcvf ${top}/${pkg_name[${n}]}-${PVR}.tar.bz2 --exclude=usr/lib/debug --exclude=usr/src ${pkg_contents} \
 				|| error "Binary package creation failed: ${pkg_name[${n}]}"
 		else
 			inform "Creating empty package"
@@ -138,6 +138,17 @@ __pkg_binpkg() {
 		echo;
 		n+=1;
 	done
+
+	if [ -d ${D}/usr/lib/debug -a -d ${D}/usr/src/debug ]
+	then
+		__step "${PN}-debuginfo-${PVR}.tar.bz2";
+		tar jcvf ${top}/${PN}-debuginfo-${PVR}.tar.bz2 usr/lib/debug/ usr/src/debug/ \
+				|| error "Debuginfo package creation failed: ${PN}-debuginfo"
+		echo;
+	else
+		inform "No debug files, skipping debuginfo subpackage"
+		echo;
+	fi
 }
 
 __pkg_pkgcheck() {
@@ -156,6 +167,11 @@ __pkg_pkgcheck() {
 		n+=1
 	done
 
+	if [ -f ${top}/${PN}-debuginfo-${PVR}.tar.bz2 ]
+	then
+		tar tjf ${top}/${PN}-debuginfo-${PVR}.tar.bz2 | grep -Ev "/$" >> ${tmp1}
+	fi
+
 #****v* Packaging/PKG_IGNORE
 #  DESCRIPTION
 #  A list of files that should not be included in any package, in the same
@@ -470,6 +486,28 @@ __pkg_dist() {
 		n+=1;
 	done
 
+	if [ -f ${top}/${PN}-debuginfo-${PVR}.tar.bz2 ]
+	then
+		mkdir -p ${distdir}/${PN}/${PN}-debuginfo
+		cp ${top}/${PN}-debuginfo-${PVR}.tar.bz2 ${distdir}/${PN}/${PN}-debuginfo/
+
+		if [ -f ${C}/${PN}-debuginfo.hint ]
+		then
+			cp ${C}/${PN}-debuginfo.hint ${distdir}/${PN}/${PN}-debuginfo/setup.hint
+		elif [ -f ${C}/debuginfo.hint ]
+		then
+			cp ${C}/debuginfo.hint ${distdir}/${PN}/${PN}-debuginfo/setup.hint
+		else
+			cat > ${distdir}/${PN}/${PN}-debuginfo/setup.hint <<-_EOF
+category: Debug
+requires:
+sdesc: "Debug info for ${PN}"
+ldesc: "This package contains files necessary for debugging the
+${PN} package with gdb."
+_EOF
+		fi
+	fi
+
 	# e.g. split library package w/o PN in PKG_NAMES
 	if [ ! -f ${distdir}/${PN}/setup.hint ]
 	then
diff --git a/lib/src_postinst.cygpart b/lib/src_postinst.cygpart
index 0ba272a..84269e0 100644
--- a/lib/src_postinst.cygpart
+++ b/lib/src_postinst.cygpart
@@ -834,9 +834,11 @@ __prep_empty_dirs() {
 #****
 
 __prepstrip() {
+	local dbg;
 	local exe;
 	local all_exes;
-	local strip;
+	local objcopy;
+	local objdump;
 
 	if defined _CYGPORT_RESTRICT_strip_
 	then
@@ -865,18 +867,21 @@ __prepstrip() {
 				mv ${exe} ${exe%.exe} ;;
 			esac
 			continue
-		elif check_prog ${CTARGET}-strip && ${CTARGET}-size -f ${exe} &>/dev/null
+		elif check_prog ${CTARGET}-objcopy && ${CTARGET}-size -f ${exe} &>/dev/null
 		then
 			# for cross-compiled libs, cross-GCC target libs,
 			# or non-cross packages built on non-Cygwin systems
-			strip="${CTARGET}-strip"
-		elif check_prog ${CHOST}-strip && ${CHOST}-size -f ${exe} &>/dev/null
+			objcopy="${CTARGET}-objcopy"
+			objdump="${CTARGET}-objdump"
+		elif check_prog ${CHOST}-objcopy && ${CHOST}-size -f ${exe} &>/dev/null
 		then
 			# for cross-compilers built on non-Cygwin systems
-			strip="${CHOST}-strip"
+			objcopy="${CHOST}-objcopy"
+			objdump="${CHOST}-objdump"
 		elif size -f ${exe} &>/dev/null
 		then
-			strip="strip"
+			objcopy="objcopy"
+			objdump="objdump"
 		else
 			continue
 		fi
@@ -912,8 +917,50 @@ __prepstrip() {
 
 		echo "        ${exe}";
 		chmod 0755 ${exe};
-		${strip} ${exe};
+
+		if defined _CYGPORT_RESTRICT_debuginfo_
+		then
+			${objcopy} --strip-all ${exe};
+		else
+			dbg="/usr/lib/debug/${exe}.dbg";
+
+			dodir ${dbg%/*}
+			${objcopy} --only-keep-debug ${exe} ${D}${dbg};
+			${objdump} -dl ${exe} | grep /usr/src/debug | sed -e 's/:.*$//g' > ${D}${dbg}.list
+			${objcopy} --strip-all ${exe};
+			${objcopy} --add-gnu-debuglink=${D}${dbg} ${exe};
+		fi
+	done
+}
+
+__prepdebugsrc() {
+	local dbg;
+	local dbgdir="/usr/lib/debug";
+	local dbgsrc;
+	local dbgsrcdir="/usr/src/debug/${PF}";
+	local srcf;
+
+	if defined _CYGPORT_RESTRICT_debuginfo_ || [ ! -d ${D}${dbgdir} ]
+	then
+		return;
+	fi
+
+	echo "Preparing debuginfo source files:";
+
+	for dbgsrc in $(cat $(find ${D}${dbgdir} -name '*.dbg.list') | sort -u)
+	do
+		srcf=${dbgsrc#${dbgsrcdir}/}
+		if [ -f ${B}/${srcf} ]
+		then
+			install -D -m0644 ${B}/${srcf} ${D}${dbgsrc}
+		elif [ -f ${S}/${srcf} ]
+		then
+			install -D -m0644 ${S}/${srcf} ${D}${dbgsrc}
+#		else
+#			install -D -m0644 $(find ${B} -name ${srcf##*/}) ${D}${dbgsrc}
+		fi
 	done
+	find ${D}${dbgdir} -name '*.dbg.list' -delete
 }
 
 #****P* Postinstall/Windows UAC
@@ -1271,6 +1318,7 @@ __prep_libtool_modules() {
 #  DESCRIPTION
 #  List of automatic postinstall or packaging step(s) which should be skipped
 #  for this package.  Supported values are:
+#  * debuginfo: do not create a debuginfo subpackage
 #  * diff: do not generate a .src.patch file of changes made in $S.
 #  * postinst-doc: do not install standard documentation files.
 #  * postinst-gconf: do not create postinstall commands for GConf schemas.
@@ -1293,6 +1341,7 @@ __src_postinst() {
 	__prepvargames;
 	__prep_libtool_modules;
 	__prepstrip;
+	__prepdebugsrc;
 	__prepuac;
 	__prep_empty_dirs;
 }
@@ -1303,4 +1352,5 @@ readonly -f __prep_fonts_dir __prep_freedesktop_mime __prep_gconf_schemas \
             __prep_mateconf_schemas __prep_texlive __prep_xsessions \
             __prepdoc __prepemacs __prepetc __prepman __prepinfo \
             __prepvargames __prep_empty_dirs \
-            __prepstrip __prepuac __prep_symlinks __prep_libtool_modules __src_postinst
+            __prepstrip __prepdebugsrc __prepuac __prep_symlinks \
+            __prep_libtool_modules __src_postinst

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [RFC] cygport: split debuginfo packages
  2012-06-29 19:48 ` Yaakov (Cygwin/X)
@ 2012-06-30 16:49   ` Ken Brown
  2012-07-07 13:11   ` Jon TURNEY
  1 sibling, 0 replies; 22+ messages in thread
From: Ken Brown @ 2012-06-30 16:49 UTC (permalink / raw)
  To: cygwin-apps

On 6/29/2012 3:48 PM, Yaakov (Cygwin/X) wrote:
> On Thu, 2012-06-21 at 01:24 -0500, Yaakov (Cygwin/X) wrote:
>> Attached is a first draft of a patch to support split debuginfo packages
>> automatically in cygport.
>
> Second draft patch attached.

I tested this on my emacs build, and it worked great.  One very minor 
annoyance was that gdb gave a warning "Source file is more recent than 
executable" the first time a breakpoint was hit.  I think you could 
avoid such warnings by using 'install -p' in __prepdebugsrc, but I 
haven't tested this.

Ken

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [RFC] cygport: split debuginfo packages
  2012-06-29 19:48 ` Yaakov (Cygwin/X)
  2012-06-30 16:49   ` Ken Brown
@ 2012-07-07 13:11   ` Jon TURNEY
  2015-02-23 12:15     ` Jon TURNEY
  1 sibling, 1 reply; 22+ messages in thread
From: Jon TURNEY @ 2012-07-07 13:11 UTC (permalink / raw)
  To: cygwin-apps

On 29/06/2012 20:48, Yaakov (Cygwin/X) wrote:
> On Thu, 2012-06-21 at 01:24 -0500, Yaakov (Cygwin/X) wrote:
>> Attached is a first draft of a patch to support split debuginfo packages 
>> automatically in cygport.
> 
> Second draft patch attached.

This works fine.  Thanks.

I was going to suggest the use of objcopy --compress-debug-sections, but it
appears that does nothing for PE/COFF files at the moment [1] :-(

[1] http://sourceware.org/bugzilla/show_bug.cgi?id=14067

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [RFC] cygport: split debuginfo packages
  2012-06-21  6:24 [RFC] cygport: split debuginfo packages Yaakov (Cygwin/X)
                   ` (3 preceding siblings ...)
  2012-06-29 19:48 ` Yaakov (Cygwin/X)
@ 2012-07-17 18:37 ` Achim Gratz
  2012-07-17 18:39   ` Christopher Faylor
  4 siblings, 1 reply; 22+ messages in thread
From: Achim Gratz @ 2012-07-17 18:37 UTC (permalink / raw)
  To: cygwin-apps

Yaakov (Cygwin/X) writes:
> Attached is a first draft of a patch to support split debuginfo
> packages automatically in cygport.  I'm looking for comments and
> suggestions, particularly on the following:

The automatic generation of the packages works great, thank you.

Looking at the resulting proliferation of packages I'm beginning to
think however that the debuginfo packages should perhaps be treated like
the source packages (including "foreign" debuginfo) and the associated
handling in genini/upset/setup just like source packages, too.

So if there's a source package package-version-src.tar.bz2, then the
debuginfo package would be called package-version-debuginfo.tar.bz2 and
it would be selected from libpackage if that had package as a foreign
source.  I hope this description makes sense...


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

SD adaptation for Waldorf Blofeld V1.15B11:
http://Synth.Stromeko.net/Downloads.html#WaldorfSDada

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [RFC] cygport: split debuginfo packages
  2012-07-17 18:37 ` Achim Gratz
@ 2012-07-17 18:39   ` Christopher Faylor
  2012-07-17 19:48     ` Achim Gratz
  2012-07-17 20:25     ` Yaakov (Cygwin/X)
  0 siblings, 2 replies; 22+ messages in thread
From: Christopher Faylor @ 2012-07-17 18:39 UTC (permalink / raw)
  To: cygwin-apps

On Tue, Jul 17, 2012 at 08:36:48PM +0200, Achim Gratz wrote:
>Yaakov (Cygwin/X) writes:
>> Attached is a first draft of a patch to support split debuginfo
>> packages automatically in cygport.  I'm looking for comments and
>> suggestions, particularly on the following:
>
>The automatic generation of the packages works great, thank you.
>
>Looking at the resulting proliferation of packages I'm beginning to
>think however that the debuginfo packages should perhaps be treated like
>the source packages (including "foreign" debuginfo) and the associated
>handling in genini/upset/setup just like source packages, too.
>
>So if there's a source package package-version-src.tar.bz2, then the
>debuginfo package would be called package-version-debuginfo.tar.bz2 and
>it would be selected from libpackage if that had package as a foreign
>source.  I hope this description makes sense...

Maybe the .debuginfo files should be in a "Debug" category.

cgf

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [RFC] cygport: split debuginfo packages
  2012-07-17 18:39   ` Christopher Faylor
@ 2012-07-17 19:48     ` Achim Gratz
  2012-07-17 19:55       ` Christopher Faylor
  2012-07-17 20:25     ` Yaakov (Cygwin/X)
  1 sibling, 1 reply; 22+ messages in thread
From: Achim Gratz @ 2012-07-17 19:48 UTC (permalink / raw)
  To: cygwin-apps

Christopher Faylor writes:
> Maybe the .debuginfo files should be in a "Debug" category.

I don't think that would be the right thing to do.  It would only be of
help if the debuginfo packages were not shown in the other categories
together with the installation packages, but a flat Debug category seems
even less appealing.  It should be possible to get the debuginfo for
"this package" directly from the package selection, not rummaging around
in the Debug category trying to find something that looks like it might
be related to "that package".


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

Factory and User Sound Singles for Waldorf Blofeld:
http://Synth.Stromeko.net/Downloads.html#WaldorfSounds

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [RFC] cygport: split debuginfo packages
  2012-07-17 19:48     ` Achim Gratz
@ 2012-07-17 19:55       ` Christopher Faylor
  0 siblings, 0 replies; 22+ messages in thread
From: Christopher Faylor @ 2012-07-17 19:55 UTC (permalink / raw)
  To: cygwin-apps

On Tue, Jul 17, 2012 at 09:48:31PM +0200, Achim Gratz wrote:
>Christopher Faylor writes:
>> Maybe the .debuginfo files should be in a "Debug" category.
>
>I don't think that would be the right thing to do.  It would only be of
>help if the debuginfo packages were not shown in the other categories
>together with the installation packages, but a flat Debug category seems
>even less appealing.  It should be possible to get the debuginfo for
>"this package" directly from the package selection, not rummaging around
>in the Debug category trying to find something that looks like it might
>be related to "that package".

Ok, let me put it this way.  I'm not keenly interested in spending time
updating setup.exe and the setup.ini generation tools for special case
handling of debuginfo.

Maybe that helps clarify things.

cgf

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [RFC] cygport: split debuginfo packages
  2012-07-17 18:39   ` Christopher Faylor
  2012-07-17 19:48     ` Achim Gratz
@ 2012-07-17 20:25     ` Yaakov (Cygwin/X)
  1 sibling, 0 replies; 22+ messages in thread
From: Yaakov (Cygwin/X) @ 2012-07-17 20:25 UTC (permalink / raw)
  To: cygwin-apps

On 2012-07-17 13:39, Christopher Faylor wrote:
> On Tue, Jul 17, 2012 at 08:36:48PM +0200, Achim Gratz wrote:
>> So if there's a source package package-version-src.tar.bz2, then the
>> debuginfo package would be called package-version-debuginfo.tar.bz2 and
>> it would be selected from libpackage if that had package as a foreign
>> source.  I hope this description makes sense...
>
> Maybe the .debuginfo files should be in a "Debug" category.

They already are:

http://cygwin.com/ml/cygwin-apps/2012-06/msg00071.html
http://cygwin-ports.git.sourceforge.net/git/gitweb.cgi?p=cygwin-ports/cygport;a=blob;f=lib/pkg_pkg.cygpart;h=e745df4;hb=HEAD#l501


Yaakov

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [RFC] cygport: split debuginfo packages
  2012-07-07 13:11   ` Jon TURNEY
@ 2015-02-23 12:15     ` Jon TURNEY
  2015-02-27  6:27       ` Yaakov Selkowitz
  0 siblings, 1 reply; 22+ messages in thread
From: Jon TURNEY @ 2015-02-23 12:15 UTC (permalink / raw)
  To: cygwin-apps

[-- Attachment #1: Type: text/plain, Size: 703 bytes --]

On 07/07/2012 14:10, Jon TURNEY wrote:
> On 29/06/2012 20:48, Yaakov (Cygwin/X) wrote:
>> On Thu, 2012-06-21 at 01:24 -0500, Yaakov (Cygwin/X) wrote:
>>> Attached is a first draft of a patch to support split debuginfo packages
>>> automatically in cygport.
>>
>> Second draft patch attached.
>
> This works fine.  Thanks.
>
> I was going to suggest the use of objcopy --compress-debug-sections, but it
> appears that does nothing for PE/COFF files at the moment [1] :-(
>
> [1] http://sourceware.org/bugzilla/show_bug.cgi?id=14067

That bug has been fixed for a while, so how about the attached?

This appears to reduce the disk space used by .dbg files to about 1/3 of 
the size, so seems worthwhile.


[-- Attachment #2: 0001-prepstrip-use-compress-debug-sections.patch --]
[-- Type: text/plain, Size: 1016 bytes --]

From 69d6127921a041022990386cb2eed4e8487e23c9 Mon Sep 17 00:00:00 2001
From: Jon TURNEY <jon.turney@dronecode.org.uk>
Date: Mon, 23 Feb 2015 12:06:07 +0000
Subject: [PATCH] prepstrip: use --compress-debug-sections

---
 lib/src_postinst.cygpart | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/src_postinst.cygpart b/lib/src_postinst.cygpart
index e7b80d4..e214e44 100644
--- a/lib/src_postinst.cygpart
+++ b/lib/src_postinst.cygpart
@@ -1053,7 +1053,7 @@ __prepstrip() {
 			if ! ${objdump} -h "${exe}" | grep -q '\.gnu_deb'
 			then
 				dodir "${dbg%/*}";
-				${objcopy} --long-section-names enable --add-gnu-debuglink=/dev/null --only-keep-debug "${exe}" "${D}${dbg}";
+				${objcopy} --long-section-names enable --add-gnu-debuglink=/dev/null --only-keep-debug --compress-debug-sections "${exe}" "${D}${dbg}";
 				chmod 0644 "${D}${dbg}";
 				${objcopy} --strip-all "${exe}";
 				${objcopy} --long-section-names enable --add-gnu-debuglink="${D}${dbg}" "${exe}" 2>/dev/null;
-- 
2.1.4


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [RFC] cygport: split debuginfo packages
  2015-02-23 12:15     ` Jon TURNEY
@ 2015-02-27  6:27       ` Yaakov Selkowitz
  2015-03-01 17:54         ` Jon TURNEY
  0 siblings, 1 reply; 22+ messages in thread
From: Yaakov Selkowitz @ 2015-02-27  6:27 UTC (permalink / raw)
  To: cygwin-apps

On Mon, 2015-02-23 at 12:14 +0000, Jon TURNEY wrote:
> On 07/07/2012 14:10, Jon TURNEY wrote:
> > I was going to suggest the use of objcopy --compress-debug-sections, but it
> > appears that does nothing for PE/COFF files at the moment [1] :-(
> >
> > [1] http://sourceware.org/bugzilla/show_bug.cgi?id=14067
> 
> That bug has been fixed for a while, so how about the attached?
> 
> This appears to reduce the disk space used by .dbg files to about 1/3 of 
> the size, so seems worthwhile.

Have you tested that the resulting split debuginfo work properly with
gdb?

--
Yaakov


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [RFC] cygport: split debuginfo packages
  2015-02-27  6:27       ` Yaakov Selkowitz
@ 2015-03-01 17:54         ` Jon TURNEY
  2015-03-01 19:25           ` Yaakov Selkowitz
  2015-03-09 12:55           ` Jon TURNEY
  0 siblings, 2 replies; 22+ messages in thread
From: Jon TURNEY @ 2015-03-01 17:54 UTC (permalink / raw)
  To: cygwin-apps

On 27/02/2015 06:27, Yaakov Selkowitz wrote:
> On Mon, 2015-02-23 at 12:14 +0000, Jon TURNEY wrote:
>> On 07/07/2012 14:10, Jon TURNEY wrote:
>>> I was going to suggest the use of objcopy --compress-debug-sections, but it
>>> appears that does nothing for PE/COFF files at the moment [1] :-(
>>>
>>> [1] http://sourceware.org/bugzilla/show_bug.cgi?id=14067
>>
>> That bug has been fixed for a while, so how about the attached?
>>
>> This appears to reduce the disk space used by .dbg files to about 1/3 of
>> the size, so seems worthwhile.
>
> Have you tested that the resulting split debuginfo work properly with
> gdb?

It's hardly a comprehensive test, but I did try this:

$ objdump -j ".zdebug_info" -s /usr/lib/debug/usr/bin/XWin.exe.dbg | head

/usr/lib/debug/usr/bin/XWin.exe.dbg:     file format pei-x86-64

Contents of section .zdebug_info:
  100635000 5a4c4942 00000000 0080a07f 789cecbd  ZLIB........x...
  100635010 797c9bd5 95377eef 23d97e64 f9b16547  y|...7~.#.~d..eG
  100635020 cb1363c7 929d10b3 24717687 24c4fb92  ..c.....$qv.$...
  100635030 788bed24 ceaac892 6c8bc896 90e4c406  x..$....l.......
  100635040 3a4d175a 2850680b 94524ae9 46693b33  :M.Z(Ph..RJ.Fi;3
  100635050 d0d26919 ba990205 0a2d740a 0cd36d68  ..i......-t...mh

$ gdb /usr/bin/XWin.exe
GNU gdb (GDB) 7.8
[...]
Reading symbols from /usr/bin/XWin.exe...Reading symbols from 
/usr/lib/debug//usr/bin/XWin.exe.dbg...done.
done.
(gdb) b main
Breakpoint 1 at 0x10057c147: file 
/usr/src/debug/xorg-server-1.17.1-2/hw/xwin/InitOutput.c, line 166.
(gdb) r
Starting program: /usr/bin/XWin.exe
[New Thread 2900.0x23e0]
[New Thread 2900.0xe8]

Breakpoint 1, main (argc=1, argv=0x23cb40, envp=0x6000281a0)
     at /usr/src/debug/xorg-server-1.17.1-2/hw/xwin/InitOutput.c:166
166     {

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [RFC] cygport: split debuginfo packages
  2015-03-01 17:54         ` Jon TURNEY
@ 2015-03-01 19:25           ` Yaakov Selkowitz
  2015-03-09 12:55           ` Jon TURNEY
  1 sibling, 0 replies; 22+ messages in thread
From: Yaakov Selkowitz @ 2015-03-01 19:25 UTC (permalink / raw)
  To: cygwin-apps

On Sun, 2015-03-01 at 17:54 +0000, Jon TURNEY wrote:
> On 27/02/2015 06:27, Yaakov Selkowitz wrote:
> > On Mon, 2015-02-23 at 12:14 +0000, Jon TURNEY wrote:
> >> On 07/07/2012 14:10, Jon TURNEY wrote:
> >>> I was going to suggest the use of objcopy --compress-debug-sections, but it
> >>> appears that does nothing for PE/COFF files at the moment [1] :-(
> >>>
> >>> [1] http://sourceware.org/bugzilla/show_bug.cgi?id=14067
> >>
> >> That bug has been fixed for a while, so how about the attached?
> >>
> >> This appears to reduce the disk space used by .dbg files to about 1/3 of
> >> the size, so seems worthwhile.
> >
> > Have you tested that the resulting split debuginfo work properly with
> > gdb?
> 
> It's hardly a comprehensive test, but I did try this:
[snip]

Fair enough, I have pulled in this patch for further testing.

Thanks,

Yaakov



^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [RFC] cygport: split debuginfo packages
  2015-03-01 17:54         ` Jon TURNEY
  2015-03-01 19:25           ` Yaakov Selkowitz
@ 2015-03-09 12:55           ` Jon TURNEY
  1 sibling, 0 replies; 22+ messages in thread
From: Jon TURNEY @ 2015-03-09 12:55 UTC (permalink / raw)
  To: cygwin-apps

On 01/03/2015 17:54, Jon TURNEY wrote:
> On 27/02/2015 06:27, Yaakov Selkowitz wrote:
>> On Mon, 2015-02-23 at 12:14 +0000, Jon TURNEY wrote:
>>> On 07/07/2012 14:10, Jon TURNEY wrote:
>>>> I was going to suggest the use of objcopy --compress-debug-sections,
>>>> but it
>>>> appears that does nothing for PE/COFF files at the moment [1] :-(
>>>>
>>>> [1] http://sourceware.org/bugzilla/show_bug.cgi?id=14067
>>>
>>> That bug has been fixed for a while, so how about the attached?
>>>
>>> This appears to reduce the disk space used by .dbg files to about 1/3 of
>>> the size, so seems worthwhile.
>>
>> Have you tested that the resulting split debuginfo work properly with
>> gdb?
>
> It's hardly a comprehensive test, but I did try this:
>
> $ objdump -j ".zdebug_info" -s /usr/lib/debug/usr/bin/XWin.exe.dbg | head
>
> /usr/lib/debug/usr/bin/XWin.exe.dbg:     file format pei-x86-64

I should have tried this on x86.  There seems to be a good chance that 
this will result in broken debug information on x86.

See binutils bug #18087 [1] for details.

Perhaps this should be reverted unless or until fixed in binutils.

[1] https://sourceware.org/bugzilla/show_bug.cgi?id=18087

^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2015-03-09 12:55 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-21  6:24 [RFC] cygport: split debuginfo packages Yaakov (Cygwin/X)
2012-06-21  9:03 ` Corinna Vinschen
2012-06-21  9:35   ` Corinna Vinschen
2012-06-21 19:47   ` Yaakov (Cygwin/X)
2012-06-22  9:51     ` Corinna Vinschen
2012-06-21 12:56 ` Christopher Faylor
2012-06-21 14:22   ` Jon TURNEY
2012-06-21 16:10     ` Christopher Faylor
2012-06-22 15:23 ` Ken Brown
2012-06-29 19:48 ` Yaakov (Cygwin/X)
2012-06-30 16:49   ` Ken Brown
2012-07-07 13:11   ` Jon TURNEY
2015-02-23 12:15     ` Jon TURNEY
2015-02-27  6:27       ` Yaakov Selkowitz
2015-03-01 17:54         ` Jon TURNEY
2015-03-01 19:25           ` Yaakov Selkowitz
2015-03-09 12:55           ` Jon TURNEY
2012-07-17 18:37 ` Achim Gratz
2012-07-17 18:39   ` Christopher Faylor
2012-07-17 19:48     ` Achim Gratz
2012-07-17 19:55       ` Christopher Faylor
2012-07-17 20:25     ` Yaakov (Cygwin/X)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).