[Mingw-w64-public] Problems in retrieving stack backtrace in the case of c++ exceptions

2014-04-24 Thread lh_mouse
Dear all,
I copied some code from here 
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33903#c5 and removed those dl* 
stuffs and tested it. But this piece of code only works on my linux.

I got this result with mingw-w64-gcc x86 version:
E:\Desktop>g++ -v
Thread model: win32
gcc version 4.9.0 20140218 (experimental) (i686-win32-sjlj, Built by 
MinGW-W64 project)
E:\Desktop>g++ test.cpp -O0 -g -Wl,--wrap,__cxa_throw
E:\Desktop>gdb a
(gdb) r
Starting program: E:\Desktop\a.exe
[New Thread 3132.0x1ea4]
ping!
0002

Program received signal SIGSEGV, Segmentation fault.
0x6ced3226 in libgcc_s_sjlj-1!_Unwind_GetIP () from 
e:\mingw\mingw32\opt\bin\libgcc_s_sjlj-1.dll
(gdb) bt
#0  0x6ced3226 in libgcc_s_sjlj-1!_Unwind_GetIP () from 
e:\mingw\mingw32\opt\bin\libgcc_s_sjlj-1.dll
#1  0x00401581 in helper (ctx=0x28fdcc) at test.cpp:7
#2  0x6ced3614 in libgcc_s_sjlj-1!_Unwind_Backtrace () from 
e:\mingw\mingw32\opt\bin\libgcc_s_sjlj-1.dll
(gdb)

And this result with x64 version:
E:\Desktop>g++ -v
Thread model: win32
gcc version 4.9.0 20140218 (experimental) (x86_64-win32-seh, Built by 
MinGW-W64 project)
E:\Desktop>g++ test.cpp -O0 -g -Wl,--wrap,__cxa_throw
E:\Desktop>gdb a
(gdb) r
Starting program: E:\Desktop\a.exe
[New Thread 8080.0x1f88]
ping!
pong!
[Inferior 1 (process 8080) exited normally]
(gdb)

Any suggestions?

--
Best regards,
lh_mouse
2014-04-25


--
Start Your Social Network Today - Download eXo Platform
Build your Enterprise Intranet with eXo Platform Software
Java Based Open Source Intranet - Social, Extensible, Cloud Ready
Get Started Now And Turn Your Intranet Into A Collaboration Platform
http://p.sf.net/sfu/ExoPlatform
___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


Re: [Mingw-w64-public] [patch/cygwin]: Fix u_long problem on LP64 systems

2014-04-24 Thread Corinna Vinschen
On Apr 24 15:55, Kai Tietz wrote:
> Hello Corinna,
> 
> good catch.  Patch is ok. Please apply.

Done.


Thanks,
Corinna


pgpRE_5zsASTC.pgp
Description: PGP signature
--
Start Your Social Network Today - Download eXo Platform
Build your Enterprise Intranet with eXo Platform Software
Java Based Open Source Intranet - Social, Extensible, Cloud Ready
Get Started Now And Turn Your Intranet Into A Collaboration Platform
http://p.sf.net/sfu/ExoPlatform___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


Re: [Mingw-w64-public] [patch/cygwin]: Fix u_long problem on LP64 systems

2014-04-24 Thread Kai Tietz
Hello Corinna,

good catch.  Patch is ok. Please apply.

Thanks,
Kai

2014-04-24 15:13 GMT+02:00 Corinna Vinschen :
> Hi,
>
>
> I just stumbled over a weird problem in Cygwin's socket code, which I
> tracked down to a wrong definition of struct sockaddr_in6.  It had the
> correct size (28 bytes) in the application but it was supposedly 40
> bytes in the Cygwin DLL.
>
> I tracked it down to the fact that the re-definition of u_long for LP64
> systems is missing in ws2ipdef.h.  While looking I found that ws2tcpip.h
> and mstcpip.h are affected as well.
>
> So I'd like to propose the below patch which adds LP64 u_long overrides
> to these files.
>
>
> Thanks,
> Corinna
>
>
> * mstcpip.h: Add LP64 u_long override.
> * ws2ipdef.h: Ditto.
> * ws2tcpip.h: Ditto.
>
>
> Index: mstcpip.h
> ===
> --- mstcpip.h   (revision 6598)
> +++ mstcpip.h   (working copy)
> @@ -9,6 +9,12 @@
>  #include <_mingw_unicode.h>
>  #include 
>
> +#ifdef __LP64__
> +#pragma push_macro("u_long")
> +#undef u_long
> +#define u_long __ms_u_long
> +#endif
> +
>  struct tcp_keepalive {
>u_long onoff;
>u_long keepalivetime;
> @@ -131,5 +137,9 @@
>  #endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */
>  #endif /*(_WIN32_WINNT >= 0x0502)*/
>
> +#ifdef __LP64__
> +#pragma pop_macro("u_long")
> +#endif
> +
>  #endif /* _MSTCPIP_ */
>
> Index: ws2ipdef.h
> ===
> --- ws2ipdef.h  (revision 6598)
> +++ ws2ipdef.h  (working copy)
> @@ -5,8 +5,15 @@
>  #ifndef _WS2IPDEF_
>  #define _WS2IPDEF_
>
> +#include <_mingw_unicode.h>
>  #include 
>
> +#ifdef __LP64__
> +#pragma push_macro("u_long")
> +#undef u_long
> +#define u_long __ms_u_long
> +#endif
> +
>  #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
>
>  #include 
> @@ -132,4 +139,8 @@
>
>  #endif /* WINAPI_PARTION_DESKTOP.  */
>
> +#ifdef __LP64__
> +#pragma pop_macro("u_long")
> +#endif
> +
>  #endif /*_WS2IPDEF_ */
> Index: ws2tcpip.h
> ===
> --- ws2tcpip.h  (revision 6598)
> +++ ws2tcpip.h  (working copy)
> @@ -8,6 +8,12 @@
>
>  #include <_mingw_unicode.h>
>
> +#ifdef __LP64__
> +#pragma push_macro("u_long")
> +#undef u_long
> +#define u_long __ms_u_long
> +#endif
> +
>  #include 
>  #include 
>  #include 
> @@ -435,4 +441,8 @@
>  }
>  #endif
>
> +#ifdef __LP64__
> +#pragma pop_macro("u_long")
> +#endif
> +
>  #endif /* _WS2TCPIP_H_ */
>
> --
> Start Your Social Network Today - Download eXo Platform
> Build your Enterprise Intranet with eXo Platform Software
> Java Based Open Source Intranet - Social, Extensible, Cloud Ready
> Get Started Now And Turn Your Intranet Into A Collaboration Platform
> http://p.sf.net/sfu/ExoPlatform
> ___
> Mingw-w64-public mailing list
> Mingw-w64-public@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
>

--
Start Your Social Network Today - Download eXo Platform
Build your Enterprise Intranet with eXo Platform Software
Java Based Open Source Intranet - Social, Extensible, Cloud Ready
Get Started Now And Turn Your Intranet Into A Collaboration Platform
http://p.sf.net/sfu/ExoPlatform
___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


[Mingw-w64-public] [patch/cygwin]: Fix u_long problem on LP64 systems

2014-04-24 Thread Corinna Vinschen
Hi,


I just stumbled over a weird problem in Cygwin's socket code, which I
tracked down to a wrong definition of struct sockaddr_in6.  It had the
correct size (28 bytes) in the application but it was supposedly 40
bytes in the Cygwin DLL.

I tracked it down to the fact that the re-definition of u_long for LP64
systems is missing in ws2ipdef.h.  While looking I found that ws2tcpip.h
and mstcpip.h are affected as well.

So I'd like to propose the below patch which adds LP64 u_long overrides
to these files.


Thanks,
Corinna


* mstcpip.h: Add LP64 u_long override.
* ws2ipdef.h: Ditto.
* ws2tcpip.h: Ditto.


Index: mstcpip.h
===
--- mstcpip.h   (revision 6598)
+++ mstcpip.h   (working copy)
@@ -9,6 +9,12 @@
 #include <_mingw_unicode.h>
 #include 
 
+#ifdef __LP64__
+#pragma push_macro("u_long")
+#undef u_long
+#define u_long __ms_u_long
+#endif
+
 struct tcp_keepalive {
   u_long onoff;
   u_long keepalivetime;
@@ -131,5 +137,9 @@
 #endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */
 #endif /*(_WIN32_WINNT >= 0x0502)*/
 
+#ifdef __LP64__
+#pragma pop_macro("u_long")
+#endif
+
 #endif /* _MSTCPIP_ */
 
Index: ws2ipdef.h
===
--- ws2ipdef.h  (revision 6598)
+++ ws2ipdef.h  (working copy)
@@ -5,8 +5,15 @@
 #ifndef _WS2IPDEF_
 #define _WS2IPDEF_
 
+#include <_mingw_unicode.h>
 #include 
 
+#ifdef __LP64__
+#pragma push_macro("u_long")
+#undef u_long
+#define u_long __ms_u_long
+#endif
+
 #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
 
 #include 
@@ -132,4 +139,8 @@
 
 #endif /* WINAPI_PARTION_DESKTOP.  */
 
+#ifdef __LP64__
+#pragma pop_macro("u_long")
+#endif
+
 #endif /*_WS2IPDEF_ */
Index: ws2tcpip.h
===
--- ws2tcpip.h  (revision 6598)
+++ ws2tcpip.h  (working copy)
@@ -8,6 +8,12 @@
 
 #include <_mingw_unicode.h>
 
+#ifdef __LP64__
+#pragma push_macro("u_long")
+#undef u_long
+#define u_long __ms_u_long
+#endif
+
 #include 
 #include 
 #include 
@@ -435,4 +441,8 @@
 }
 #endif
 
+#ifdef __LP64__
+#pragma pop_macro("u_long")
+#endif
+
 #endif /* _WS2TCPIP_H_ */


pgprOzfCGh4Ji.pgp
Description: PGP signature
--
Start Your Social Network Today - Download eXo Platform
Build your Enterprise Intranet with eXo Platform Software
Java Based Open Source Intranet - Social, Extensible, Cloud Ready
Get Started Now And Turn Your Intranet Into A Collaboration Platform
http://p.sf.net/sfu/ExoPlatform___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


Re: [Mingw-w64-public] Experimental builds of GCC-4.9.0

2014-04-24 Thread Alexpux

24 апр. 2014 г., в 14:19, Koehne Kai  написал(а):

>> -Original Message-
>> From: niXman [mailto:i.nix...@autistici.org]
>> Sent: Tuesday, November 19, 2013 10:10 PM
>> To: mingw-w64-public
>> Subject: [Mingw-w64-public] Experimental builds of GCC-4.9.0
>> 
>> 
>> Hi guys!
>> Just now I uploaded new builds based on the GCC-4.9.0-trunk(rev.
>> 205009), mingw-w64-trunk(rev. 6379)
> 
> Hi!
> 
> Gcc 4.9.0 got finally released two days ago ... Do you plan to ship pre-built 
> binaries for it soon, too? Would be pretty cool to give the new features a 
> whirl :)
> 
> Thanks for your incredible work!
> 
niXman upload new mingw-builds with GCC-4.9.0 soon.


Regards,
Alexey.

> Kai
> 
> --
> Start Your Social Network Today - Download eXo Platform
> Build your Enterprise Intranet with eXo Platform Software
> Java Based Open Source Intranet - Social, Extensible, Cloud Ready
> Get Started Now And Turn Your Intranet Into A Collaboration Platform
> http://p.sf.net/sfu/ExoPlatform
> ___
> Mingw-w64-public mailing list
> Mingw-w64-public@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


--
Start Your Social Network Today - Download eXo Platform
Build your Enterprise Intranet with eXo Platform Software
Java Based Open Source Intranet - Social, Extensible, Cloud Ready
Get Started Now And Turn Your Intranet Into A Collaboration Platform
http://p.sf.net/sfu/ExoPlatform
___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


Re: [Mingw-w64-public] Experimental builds of GCC-4.9.0

2014-04-24 Thread Koehne Kai
> -Original Message-
> From: niXman [mailto:i.nix...@autistici.org]
> Sent: Tuesday, November 19, 2013 10:10 PM
> To: mingw-w64-public
> Subject: [Mingw-w64-public] Experimental builds of GCC-4.9.0
> 
> 
> Hi guys!
> Just now I uploaded new builds based on the GCC-4.9.0-trunk(rev.
> 205009), mingw-w64-trunk(rev. 6379)

Hi!

Gcc 4.9.0 got finally released two days ago ... Do you plan to ship pre-built 
binaries for it soon, too? Would be pretty cool to give the new features a 
whirl :)

Thanks for your incredible work!

Kai

--
Start Your Social Network Today - Download eXo Platform
Build your Enterprise Intranet with eXo Platform Software
Java Based Open Source Intranet - Social, Extensible, Cloud Ready
Get Started Now And Turn Your Intranet Into A Collaboration Platform
http://p.sf.net/sfu/ExoPlatform
___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


Re: [Mingw-w64-public] mingw intrinsics header clashes with clang intrinsics

2014-04-24 Thread Ruben Van Boxem
2014-04-24 11:45 GMT+02:00 Jacek Caban :

> On 04/24/14 11:26, G M wrote:
> > Hi Everyone
> >
> > I thought you might want to know that if I use clang 3.5 from trunk to
> > compile mingw's windows.h file like so:
> >
> > // w3.cpp - no main even
> > #include 
> > clang++ -fms-extensions w3.cpp
> >
> > I get errors the errors shown below. I emailed one of the guys on the
> > clang team to ask what they thought was going on, they said they added
> > some intrinsics to clang for windows and this might be what is
> > clashing now with mingw's.
> >
> > Note without the -fms-extensions the file will compile, so I assume
> > mingw might need it's intrinsics file updated to not define whichever
> > of it's own intrinsics where they will clash with whatever clang is
> > providing when -fms-extensions is on.
> >
> > I'm using a mingw based on g++ 4.8.2. I forget where I downloaded my
> > version from but I intend to update to a 4.9 version when ever you
> > release that, so just try clang from trunk on a windows.h from
> > your latest mingw headers and see if the same happens for you too.
> >
> > If you fix it or it's already fixed, if you post a link to
> > wherever that fixed version is, I'll try it.
>
> It seems that clang introduced those in a way that is incompatible with
> both MSVC and GCC. I think they intend to be compatible with MSVC in
> such cases, which would mean that those should be available as long as
> one uses appropriate pragma, but declaration is still up to headers.
> Anyway, we may #ifdef those on clang, but how can we do that? Is there
> any builtin macro indicating that -fms-extension is used? Will
> __has_builtin work for them?
>

This bug report seems relevant:
http://llvm.org/bugs/show_bug.cgi?id=13283
Although it seems to only affect clang-cl (the cl.exe compatible
driver/part of Clang).

I would hazard a guess __has_builtin works for them as they are defined in
the same way as other builtins here:
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/Builtins.def?revision=206362&view=markup

Ruben
--
Start Your Social Network Today - Download eXo Platform
Build your Enterprise Intranet with eXo Platform Software
Java Based Open Source Intranet - Social, Extensible, Cloud Ready
Get Started Now And Turn Your Intranet Into A Collaboration Platform
http://p.sf.net/sfu/ExoPlatform___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


Re: [Mingw-w64-public] mingw intrinsics header clashes with clang intrinsics

2014-04-24 Thread Jacek Caban
On 04/24/14 11:26, G M wrote:
> Hi Everyone
>
> I thought you might want to know that if I use clang 3.5 from trunk to
> compile mingw's windows.h file like so:
>
> // w3.cpp - no main even
> #include 
> clang++ -fms-extensions w3.cpp
>
> I get errors the errors shown below. I emailed one of the guys on the
> clang team to ask what they thought was going on, they said they added
> some intrinsics to clang for windows and this might be what is
> clashing now with mingw's.
>
> Note without the -fms-extensions the file will compile, so I assume
> mingw might need it's intrinsics file updated to not define whichever
> of it's own intrinsics where they will clash with whatever clang is
> providing when -fms-extensions is on.
>
> I'm using a mingw based on g++ 4.8.2. I forget where I downloaded my
> version from but I intend to update to a 4.9 version when ever you
> release that, so just try clang from trunk on a windows.h from
> your latest mingw headers and see if the same happens for you too.
>
> If you fix it or it's already fixed, if you post a link to
> wherever that fixed version is, I'll try it.

It seems that clang introduced those in a way that is incompatible with
both MSVC and GCC. I think they intend to be compatible with MSVC in
such cases, which would mean that those should be available as long as
one uses appropriate pragma, but declaration is still up to headers.
Anyway, we may #ifdef those on clang, but how can we do that? Is there
any builtin macro indicating that -fms-extension is used? Will
__has_builtin work for them?

Jacek

--
Start Your Social Network Today - Download eXo Platform
Build your Enterprise Intranet with eXo Platform Software
Java Based Open Source Intranet - Social, Extensible, Cloud Ready
Get Started Now And Turn Your Intranet Into A Collaboration Platform
http://p.sf.net/sfu/ExoPlatform
___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


[Mingw-w64-public] mingw intrinsics header clashes with clang intrinsics

2014-04-24 Thread G M
Hi Everyone

I thought you might want to know that if I use clang 3.5 from trunk to
compile mingw's windows.h file like so:

// w3.cpp - no main even
#include 
clang++ -fms-extensions w3.cpp

I get errors the errors shown below. I emailed one of the guys on the clang
team to ask what they thought was going on, they said they added some
intrinsics to clang for windows and this might be what is clashing now with
mingw's.

Note without the -fms-extensions the file will compile, so I assume mingw
might need it's intrinsics file updated to not define whichever of it's own
intrinsics where they will clash with whatever clang is providing when
-fms-extensions is on.

I'm using a mingw based on g++ 4.8.2. I forget where I downloaded my
version from but I intend to update to a 4.9 version when ever you release
that, so just try clang from trunk on a windows.h from your latest mingw
headers and see if the same happens for you too.

If you fix it or it's already fixed, if you post a link to wherever that
fixed version is, I'll try it.

Thanks

Here's the errors..

In file included from w3.cpp:1:
In file included from
c:\mingw\bin\..\lib\clang\3.5.0\../../../x86_64-w64-mingw32/include\windows.h:69:
In file included from
c:\mingw\bin\..\lib\clang\3.5.0\../../../x86_64-w64-mingw32/include\windef.h:8:
In file included from
c:\mingw\bin\..\lib\clang\3.5.0\../../../x86_64-w64-mingw32/include\minwindef.h:146:
In file included from
c:\mingw\bin\..\lib\clang\3.5.0\../../../x86_64-w64-mingw32/include\winnt.h:26:
c:\mingw\bin\..\lib\clang\3.5.0\../../../x86_64-w64-mingw32/include\psdk_inc/intrin-impl.h:960:10:
error: definition of
  builtin function '_InterlockedExchangeAdd'
__LONG32 _InterlockedExchangeAdd(__LONG32 volatile *Addend, __LONG32 Value)
{
 ^
c:\mingw\bin\..\lib\clang\3.5.0\../../../x86_64-w64-mingw32/include\psdk_inc/intrin-impl.h:969:10:
error: definition of
  builtin function '_InterlockedCompareExchange'
__LONG32 _InterlockedCompareExchange(__LONG32 volatile *Destination,
__LONG32 ExChange, __LONG32 Comperand) {
 ^
c:\mingw\bin\..\lib\clang\3.5.0\../../../x86_64-w64-mingw32/include\psdk_inc/intrin-impl.h:978:10:
error: definition of
  builtin function '_InterlockedIncrement'
__LONG32 _InterlockedIncrement(__LONG32 volatile *Addend) {
 ^
c:\mingw\bin\..\lib\clang\3.5.0\../../../x86_64-w64-mingw32/include\psdk_inc/intrin-impl.h:987:10:
error: definition of
  builtin function '_InterlockedDecrement'
__LONG32 _InterlockedDecrement(__LONG32 volatile *Addend) {
 ^
--
Start Your Social Network Today - Download eXo Platform
Build your Enterprise Intranet with eXo Platform Software
Java Based Open Source Intranet - Social, Extensible, Cloud Ready
Get Started Now And Turn Your Intranet Into A Collaboration Platform
http://p.sf.net/sfu/ExoPlatform___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public