[patch] support -gdwarf-2 when creating cygwin1.dbg

Brian Dessent brian@dessent.net
Wed Apr 18 14:53:00 GMT 2007

Corinna Vinschen wrote:

> I debugged Cygwin native GDB a couple of days ago with code created by
> gcc 4.2.  It turned out that the DWARF2_UNWIND_INFO define set to 0
> resulted in the DW_CFA_offset column missing.  The result is that GDB is
> unable to get the return address on the stack when using the dwarf2
> frame sniffer.  Setting DWARF2_UNWIND_INFO to 1 in gcc/config/i386/cygming.h
> results in gcc emitting the missing DW_CFA_offset column and GDB is happy
> again.  Older gcc's <= 4.0.1 always created the DW_CFA_offset column, so
> GDB is always happy with the created debug info.

Ah, I see.  That makes sense.

> I'm not at all fluent with this stuff.  Is that really important
> for Cygwin?

It's not at all important to cygwin1.dll itself but it could be very
relevant to Cygwin users that want to make use of C++ code that makes
use of exceptions.

Danny Smith said he was preparing to release a gcc 4.2.x for MinGW in
the somewhat-near future, and since he knows the most about all of this
we can wait and see what he decides to do about it.

If it's possible to get Dwarf exceptions working in those few corner
cases, then that would be great; it's much faster than SJLJ and
obviously for the purposes of debug info it's way better.

If it turns out that we'll be sticking with SJLJ EH then I think it
would be reasonable to try to work up a patch that causes DW_CFA_offset
to be set even if not using Dwarf for EH.


More information about the Cygwin-patches mailing list