public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* cygport: how to install package sources for debugging without recompiling?
@ 2019-05-30  9:03 Soegtrop, Michael
  2019-05-30 12:52 ` Jon Turney
  0 siblings, 1 reply; 7+ messages in thread
From: Soegtrop, Michael @ 2019-05-30  9:03 UTC (permalink / raw)
  To: cygwin

Dear Cygwin Team,

Cygwin setup allows downloading sources of libraries, but the resulting sources are not immediately useful for debugging. One gets a compressed tar archive, some patches and the cygport file. I know that I can expand sources and apply patches with

cyport <package.cygport> prep

which gives me what I need for debugging, just not in the right place. E.g. some MinGW runtime file is searched by gdb (without giving any directory commands) at

/usr/src/debug/mingw64-x86_64-runtime-6.0.0-1/crt/ucrtexe.c

But after above procedure it is in:

/usr/src/mingw64-x86_64-runtime-6.0.0-1.src/mingw64-x86_64-runtime-6.0.0-1.noarch/src/mingw-w64/mingw-w64-crt/crt/ucrtexe.c

Now of cause I can make a script and copy everything I need where it belongs. But as far as I know

cyport <package.cygport> all

would put the sources in the /usr/src/debug folder. But I don't want to recompile everything, I just want to put the sources where gdb can find them. Is there some way to tell cyport to do this? If not this would be a great additional feature for cygport (which is a very convenient tool).

Thanks & best regards,

Michael
Intel Deutschland GmbH
Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de
Managing Directors: Christin Eisenschmid, Gary Kershaw
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

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

* Re: cygport: how to install package sources for debugging without recompiling?
  2019-05-30  9:03 cygport: how to install package sources for debugging without recompiling? Soegtrop, Michael
@ 2019-05-30 12:52 ` Jon Turney
  2019-05-30 14:07   ` Brian Inglis
  2019-05-30 16:37   ` Soegtrop, Michael
  0 siblings, 2 replies; 7+ messages in thread
From: Jon Turney @ 2019-05-30 12:52 UTC (permalink / raw)
  To: The Cygwin Mailing List; +Cc: Soegtrop, Michael

On 30/05/2019 10:03, Soegtrop, Michael wrote:
> Dear Cygwin Team,
> 
> Cygwin setup allows downloading sources of libraries, but the resulting sources are not immediately useful for debugging. One gets a compressed tar archive, some patches and the cygport file. I know that I can expand sources and apply patches with
> 
> cyport <package.cygport> prep
> 
> which gives me what I need for debugging, just not in the right place. E.g. some MinGW runtime file is searched by gdb (without giving any directory commands) at
> 
> /usr/src/debug/mingw64-x86_64-runtime-6.0.0-1/crt/ucrtexe.c
> 
> But after above procedure it is in:
> 
> /usr/src/mingw64-x86_64-runtime-6.0.0-1.src/mingw64-x86_64-runtime-6.0.0-1.noarch/src/mingw-w64/mingw-w64-crt/crt/ucrtexe.c
> 
> Now of cause I can make a script and copy everything I need where it belongs. But as far as I know
> 
> cyport <package.cygport> all
> 
> would put the sources in the /usr/src/debug folder. But I don't want to recompile everything, I just want to put the sources where gdb can find them. Is there some way to tell cyport to do this? If not this would be a great additional feature for cygport (which is a very convenient tool).

cypgort is a tool for making packages.

It's already been used to make a package containing what you want: 
mingw64-x86_64-runtime-debuginfo.

Is there some reason why you can't just install that?

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

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

* Re: cygport: how to install package sources for debugging without recompiling?
  2019-05-30 12:52 ` Jon Turney
@ 2019-05-30 14:07   ` Brian Inglis
  2019-05-30 16:37   ` Soegtrop, Michael
  1 sibling, 0 replies; 7+ messages in thread
From: Brian Inglis @ 2019-05-30 14:07 UTC (permalink / raw)
  To: cygwin

On 2019-05-30 06:52, Jon Turney wrote:
> On 30/05/2019 10:03, Soegtrop, Michael wrote:
>> Cygwin setup allows downloading sources of libraries, but the resulting
>> sources are not immediately useful for debugging. One gets a compressed tar
>> archive, some patches and the cygport file. I know that I can expand sources
>> and apply patches with
>> cyport <package.cygport> prep
>> which gives me what I need for debugging, just not in the right place. E.g.
>> some MinGW runtime file is searched by gdb (without giving any directory
>> commands) at
>> /usr/src/debug/mingw64-x86_64-runtime-6.0.0-1/crt/ucrtexe.c
>> But after above procedure it is in:
>> /usr/src/mingw64-x86_64-runtime-6.0.0-1.src/mingw64-x86_64-runtime-6.0.0-1.noarch/src/mingw-w64/mingw-w64-crt/crt/ucrtexe.c
>> Now of cause I can make a script and copy everything I need where it belongs.
>> But as far as I know
>> cyport <package.cygport> all
>> would put the sources in the /usr/src/debug folder. But I don't want to
>> recompile everything, I just want to put the sources where gdb can find them.
>> Is there some way to tell cyport to do this? If not this would be a great
>> additional feature for cygport (which is a very convenient tool).
> cypgort is a tool for making packages.
> It's already been used to make a package containing what you want:
> mingw64-x86_64-runtime-debuginfo.
> Is there some reason why you can't just install that?

FYI install that means from your ${P}.cygport directory:

$ tar -xf ${P}-${V}-{R}.${ARCH}/dist/${P}/${P}-${V}-{R}.tar.xz -C /
$ tar -xf
${P}-${V}-{R}.${ARCH}/dist/${P}/${P}-debuginfo/${P}-debuginfo-${V}-{R}.tar.xz -C /

as the quick and dirty way to get most packages you just built into your local
Cygwin setup, without the formality of postinstall rebasing etc. which is likely
advisable in all Cygwin 32 setups.

-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

This email may be disturbing to some readers as it contains
too much technical detail. Reader discretion is advised.

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

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

* RE: cygport: how to install package sources for debugging without recompiling?
  2019-05-30 12:52 ` Jon Turney
  2019-05-30 14:07   ` Brian Inglis
@ 2019-05-30 16:37   ` Soegtrop, Michael
  2019-05-30 17:04     ` Brian Inglis
  1 sibling, 1 reply; 7+ messages in thread
From: Soegtrop, Michael @ 2019-05-30 16:37 UTC (permalink / raw)
  To: Jon Turney, The Cygwin Mailing List

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 1267 bytes --]

Dear Jon,

> Is there some reason why you can't just install that?

thanks for the hint - I was not aware that the -debuginfo package contains sources - I thought these just contain dwarf files or similar for stripped binaries and sources are in the -src packages.

Unfortunately for MinGW debuginfo packages exist only for rather few libraries.

Also I wonder if there exists something like debug info for stripped binaries in Cygwin - similar to .pdb files for MSVC. These seem to be not part of the debuginfo packages. Does this mean when I want to debug DLLs I anyway need to recompile them because the installed DLLs are stripped and there is no other way to get DLLs with debug information?

Best regards,

Michael
Intel Deutschland GmbH
Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de
Managing Directors: Christin Eisenschmid, Gary Kershaw
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928
\0ТÒÐÐ¥\a&ö&ÆVÒ\a&W\x06÷'G3¢\x02\x02\x02\x02\x02\x02\x06‡GG\x03¢òö7–wv–âæ6öÒ÷\a&ö&ÆV×2æ‡FÖÀФd\x15\x13¢\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x06‡GG\x03¢òö7–wv–âæ6öÒöf\x17\x12ðФFö7VÖVçF\x17F–öã¢\x02\x02\x02\x02\x02\x02\x02\x02\x06‡GG\x03¢òö7–wv–âæ6öÒöFö72æ‡FÖÀÐ¥Vç7V'67&–&R\x06–æfó¢\x02\x02\x02\x02\x02\x06‡GG\x03¢òö7–wv–âæ6öÒöÖÂò7Vç7V'67&–&R×6–×\x06ÆPРÐ

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

* Re: cygport: how to install package sources for debugging without recompiling?
  2019-05-30 16:37   ` Soegtrop, Michael
@ 2019-05-30 17:04     ` Brian Inglis
  2019-05-30 18:01       ` Soegtrop, Michael
  0 siblings, 1 reply; 7+ messages in thread
From: Brian Inglis @ 2019-05-30 17:04 UTC (permalink / raw)
  To: cygwin

On 2019-05-30 10:37, Soegtrop, Michael wrote:
>> Is there some reason why you can't just install that?
> 
> thanks for the hint - I was not aware that the -debuginfo package contains 
> sources - I thought these just contain dwarf files or similar for stripped 
> binaries and sources are in the -src packages.
> 
> Unfortunately for MinGW debuginfo packages exist only for rather few libraries.
> 
> Also I wonder if there exists something like debug info for stripped binaries
> in Cygwin - similar to .pdb files for MSVC. These seem to be not part of the
> debuginfo packages. Does this mean when I want to debug DLLs I anyway need to
> recompile them because the installed DLLs are stripped and there is no other
> way to get DLLs with debug information?

For Cygwin dlls, look at your installed lib... packages and install the related
lib...-debuginfo packages where available:
	$ apt-cyg listall lib*-debuginfo | wc
	    350    1050   12704

Many Cygwin packages have related -debuginfo packages like other distros have
-debug packages:
	$ apt-cyg listall [a-km-zA-Z]*-debuginfo | wc
	   2110    6330   76602

I am surprised at the number of supported mingw64- packages and the scarcity of
related -debuginfo packages:
	$ apt-cyg listall mingw64- | wc
	    786    2358   31654

$ apt-cyg listall mingw*debuginfo
mingw64-i686-binutils-debuginfo 2.29.1.787c9873-1 x86_64
mingw64-i686-gcc-debuginfo 7.4.0-1 x86_64
mingw64-i686-google-breakpad-debuginfo 20171117_git70914b2d-1 noarch
mingw64-i686-hidapi-debuginfo 0.8.0-rc1-1 noarch
mingw64-i686-libsolv-debuginfo 0.6.27-1 noarch
mingw64-i686-pkg-config-debuginfo 1.6.0-1 x86_64
mingw64-i686-qt4-qmake-debuginfo 4.8.7-1 x86_64
mingw64-i686-runtime-debuginfo 6.0.0-1 noarch
mingw64-i686-tcl-debuginfo 8.6.8-1 noarch
mingw64-i686-tk-debuginfo 8.6.8-1 noarch
mingw64-i686-widl-debuginfo 3.0.0-1 x86_64
mingw64-i686-winpthreads-debuginfo 6.0.0-1 noarch
mingw64-i686-zstd-debuginfo 1.4.0-1 noarch
mingw64-x86_64-binutils-debuginfo 2.29.1.787c9873-1 x86_64
mingw64-x86_64-gcc-debuginfo 7.4.0-1 x86_64
mingw64-x86_64-google-breakpad-debuginfo 20171117_git70914b2d-1 noarch
mingw64-x86_64-hidapi-debuginfo 0.8.0-rc1-1 noarch
mingw64-x86_64-libsolv-debuginfo 0.6.27-1 noarch
mingw64-x86_64-pkg-config-debuginfo 1.6.0-1 x86_64
mingw64-x86_64-qt4-qmake-debuginfo 4.8.7-1 x86_64
mingw64-x86_64-runtime-debuginfo 6.0.0-1 noarch
mingw64-x86_64-tcl-debuginfo 8.6.8-1 noarch
mingw64-x86_64-tk-debuginfo 8.6.8-1 noarch
mingw64-x86_64-widl-debuginfo 3.0.0-1 x86_64
mingw64-x86_64-winpthreads-debuginfo 6.0.0-1 noarch
mingw64-x86_64-zstd-debuginfo 1.4.0-1 noarch

-- 
-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

This email may be disturbing to some readers as it contains
too much technical detail. Reader discretion is advised.

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

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

* RE: cygport: how to install package sources for debugging without recompiling?
  2019-05-30 17:04     ` Brian Inglis
@ 2019-05-30 18:01       ` Soegtrop, Michael
  2019-05-31 11:09         ` Brian Inglis
  0 siblings, 1 reply; 7+ messages in thread
From: Soegtrop, Michael @ 2019-05-30 18:01 UTC (permalink / raw)
  To: Brian.Inglis, cygwin

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 1282 bytes --]

Dear Brian,

> For Cygwin dlls, look at your installed lib... packages and install the related lib...-
> debuginfo packages where available:
> 	$ apt-cyg listall lib*-debuginfo | wc
> 	    350    1050   12704

As far as I can tell these files only contain sources, but nothing which would add debug info to stripped dlls:

$ tar -xavf mingw64-x86_64-runtime-debuginfo-6.0.0-1.tar.xz

$ find . -type f | sed -e 's/.*\.//' | sort -u
c
h
s
xz

> I am surprised at the number of supported mingw64- packages and the scarcity
> of related -debuginfo packages:

the MinGW support in Cygwin has very substantially improved in the last years, but indeed many -debuginfo packages for MinGW libs are missing.

Best regards,

Michael

Intel Deutschland GmbH
Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de
Managing Directors: Christin Eisenschmid, Gary Kershaw
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928
\0ТÒÐÐ¥\a&ö&ÆVÒ\a&W\x06÷'G3¢\x02\x02\x02\x02\x02\x02\x06‡GG\x03¢òö7–wv–âæ6öÒ÷\a&ö&ÆV×2æ‡FÖÀФd\x15\x13¢\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x06‡GG\x03¢òö7–wv–âæ6öÒöf\x17\x12ðФFö7VÖVçF\x17F–öã¢\x02\x02\x02\x02\x02\x02\x02\x02\x06‡GG\x03¢òö7–wv–âæ6öÒöFö72æ‡FÖÀÐ¥Vç7V'67&–&R\x06–æfó¢\x02\x02\x02\x02\x02\x06‡GG\x03¢òö7–wv–âæ6öÒöÖÂò7Vç7V'67&–&R×6–×\x06ÆPРÐ

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

* Re: cygport: how to install package sources for debugging without recompiling?
  2019-05-30 18:01       ` Soegtrop, Michael
@ 2019-05-31 11:09         ` Brian Inglis
  0 siblings, 0 replies; 7+ messages in thread
From: Brian Inglis @ 2019-05-31 11:09 UTC (permalink / raw)
  To: cygwin

On 2019-05-30 12:00, Soegtrop, Michael wrote:
>> For Cygwin dlls, look at your installed lib... packages and install the related lib...-
>> debuginfo packages where available:
>> 	$ apt-cyg listall lib*-debuginfo | wc
>> 	    350    1050   12704
> As far as I can tell these files only contain sources, but nothing which
> would add debug info to stripped dlls:
> $ tar -xavf mingw64-x86_64-runtime-debuginfo-6.0.0-1.tar.xz
> $ find . -type f | sed -e 's/.*\.//' | sort -u
> c
> h
> s
> xz
>> I am surprised at the number of supported mingw64- packages and the
>> scarcity of related -debuginfo packages:
> the MinGW support in Cygwin has very substantially improved in the last
> years, but indeed many -debuginfo packages for MinGW libs are missing.

The stripped exe debug info is saved as part of each cygport build and supplied
as part of the binary -debuginfo package, if available, under
/usr/lib/debug/usr/.../*.exe.dbg.

With recent cygport releases I believe everything is taken care of unless you
override (or mess up, or don't use) the cygport build and upload defaults.

If I want to try a package, I grab the sources from upstream, copy and modify a
cygport file to do the build, as it makes it so easy to use a variety of tool
chains I am unfamiliar with, and gdb if required for diagnosis.

$ apt-cyg listfiles cygwin-debuginfo | fgrep .dbg
usr/lib/debug/usr/bin/cygwin1.dbg
usr/lib/debug/usr/bin/chattr.exe.dbg
usr/lib/debug/usr/bin/cygpath.exe.dbg
...
usr/lib/debug/usr/bin/cygwin-console-helper.exe.dbg
usr/lib/debug/usr/bin/ldh.exe.dbg
usr/lib/debug/usr/bin/strace.exe.dbg
usr/lib/debug/usr/sbin/cygserver.exe.dbg
$ apt-cyg listfiles coreutils-debuginfo | fgrep .dbg
usr/lib/debug/usr/bin/arch.exe.dbg
usr/lib/debug/usr/bin/b2sum.exe.dbg
usr/lib/debug/usr/bin/base32.exe.dbg
...
usr/lib/debug/usr/bin/whoami.exe.dbg
usr/lib/debug/usr/bin/yes.exe.dbg
usr/lib/debug/usr/bin/[.exe.dbg
usr/lib/debug/usr/libexec/coreutils/libstdbuf.so.dbg
$

-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

This email may be disturbing to some readers as it contains
too much technical detail. Reader discretion is advised.

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

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

end of thread, other threads:[~2019-05-31 11:09 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-30  9:03 cygport: how to install package sources for debugging without recompiling? Soegtrop, Michael
2019-05-30 12:52 ` Jon Turney
2019-05-30 14:07   ` Brian Inglis
2019-05-30 16:37   ` Soegtrop, Michael
2019-05-30 17:04     ` Brian Inglis
2019-05-30 18:01       ` Soegtrop, Michael
2019-05-31 11:09         ` Brian Inglis

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).