This is the mail archive of the
mailing list for the GCC project.
Re: [ping] couple of fixes for DWARF2 EH on Win32
- From: Eric Botcazou <ebotcazou at adacore dot com>
- To: Kai Tietz <ktietz70 at googlemail dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Fri, 5 Nov 2010 20:10:01 +0100
- Subject: Re: [ping] couple of fixes for DWARF2 EH on Win32
- References: <email@example.com> <AANLkTikh+Dsns9+4Cn5b1Dod=vFj6BxYZvn1ncKhetWa@mail.gmail.com>
> yeah both patches are ok. The changes in t-mingw* should be superflous
> for newer mingw runtimes. For compatiblility sake they are ok.
> As the dw2 unwinder code is just of use for 32-bit, I have no
> objections (there are some pointer/long casts withing that code, which
> are fitting well to x64 win32's LLP64).
FWIW we do use 64-bit DWARF-2 EH on Windows in our compilers and this works
almost out of the box (you have to enable it of course). For the sake of
completeness, I'm posting the attached patchlet that is needed to make it
work with GCC 4.5 and later, but might be of interest to those playing with
the DWARF-2 unwinder on 64-bit Windows and so worth integrating in the tree.
It is necessary in order to avoid buffer overruns caused by the different set
of call-used registers with the MS ABI.
2010-11-05 Eric Botcazou <firstname.lastname@example.org>
Pascal Obry <email@example.com>
* config/i386/cygming.h (DWARF_FRAME_REGISTERS): Redefine. Use 33
in 64-bit mode and 17 otherwise.
--- config/i386/cygming.h (revision 166350)
+++ config/i386/cygming.h (working copy)
@@ -84,6 +84,10 @@ along with GCC; see the file COPYING3.
(TARGET_64BIT ? dbx64_register_map[(n)] \
+/* The MS_ABI changes the set of call-used registers. */
+#define DWARF_FRAME_REGISTERS (TARGET_64BIT ? 33 : 17)
/* Use section relative relocations for debugging offsets. Unlike
other targets that fake this by putting the section VMA at 0, PE