From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 63938 invoked by alias); 9 Nov 2015 09:53:06 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 63927 invoked by uid 89); 9 Nov 2015 09:53:05 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-wi0-f174.google.com Received: from mail-wi0-f174.google.com (HELO mail-wi0-f174.google.com) (209.85.212.174) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Mon, 09 Nov 2015 09:53:04 +0000 Received: by wicli17 with SMTP id li17so11818449wic.1 for ; Mon, 09 Nov 2015 01:53:01 -0800 (PST) X-Received: by 10.195.11.129 with SMTP id ei1mr27752494wjd.129.1447062781207; Mon, 09 Nov 2015 01:53:01 -0800 (PST) MIME-Version: 1.0 Received: by 10.28.227.130 with HTTP; Mon, 9 Nov 2015 01:52:21 -0800 (PST) Reply-To: fracting@gmail.com In-Reply-To: <563937B4.7080800@redhat.com> References: <1446492970-21432-1-git-send-email-palves@redhat.com> <5637C1FA.2060708@redhat.com> <5637CB96.4010106@redhat.com> <5638988C.5070601@redhat.com> <5638E6C5.5040006@redhat.com> <563937B4.7080800@redhat.com> From: Qian Hong Date: Mon, 09 Nov 2015 09:53:00 -0000 Message-ID: Subject: Re: [PATCH 00/11] C++/MinGW patches To: Pedro Alves Cc: gdb-patches@sourceware.org Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2015-11/txt/msg00223.txt.bz2 Hi Pedro, Thanks for the info, I did some tests with your code. On Wed, Nov 4, 2015 at 6:39 AM, Pedro Alves wrote: > So it seems to me that something is wrong with C++ exceptions > support in the mingw toolchain you used. I suggest trying a simple > test like: > > int > main () > { > try > { > throw 1; > } > catch(...) > { > } > > return 0; > } > > ... to check whether C++ exceptions work at all. The above test case works for me. I tried several thing: 1. build the above code with MINGW-w64 g++ from MSYS2, run on MSYS2. It works on both Windows and Wine. 2. build the above code with MinGW-w64 cross compiler from my Ubuntu, runs on Wine, works as expected. 3. build the above code with Linux native g++ (i386), runs on Linux, works as expected. 4. Added customer printf statement to the source code, retest on all configuration above, and I can confirm all executed code path are the same. > One issue to look out for is what flavor of C++ exceptions your mingw > toolchain uses. There are flavors using dwarf2, others using sjlj. Also, we > link gdb with -static-libstdc++ -static-libgcc, which may make a difference. I tried all 4 combination of with/without -static-libstdc++/-static-libgcc, the test case works for me on Windows with MinGW-w64 g++ from MSYS2. MSYS2 g++ has --disable-sjlj-exceptions --with-dwarf2, not sure if it does matter. Here is the MinGW-w64 g++ provided by MSYS2: Using built-in specs. COLLECT_GCC=E:\msys32\mingw32\bin\g++.exe COLLECT_LTO_WRAPPER=E:/msys32/mingw32/bin/../lib/gcc/i686-w64-mingw32/5.2.0/lto-wrapper.exe Target: i686-w64-mingw32 Configured with: ../gcc-5.2.0/configure --prefix=/mingw32 --with-local-prefix=/mingw32/local --build=i686-w64-mingw32 --host=i686-w64-mingw32 --target=i686-w64-mingw32 --with-native-system-header-dir=/mingw32/i686-w64-mingw32/include --libexecdir=/mingw32/lib --with-gxx-include-dir=/mingw32/include/c++/5.2.0 --enable-bootstrap --with-arch=i686 --with-tune=generic --enable-languages=c,lto,c++,objc,obj-c++,fortran,ada --enable-shared --enable-static --enable-libatomic --enable-threads=posix --enable-graphite --enable-fully-dynamic-string --enable-libstdcxx-time=yes --disable-libstdcxx-pch --disable-libstdcxx-debug --enable-version-specific-runtime-libs --disable-isl-version-check --enable-lto --enable-libgomp --disable-multilib --enable-checking=release --disable-rpath --disable-win32-registry --disable-nls --disable-werror --disable-symvers --with-libiconv --with-system-zlib --with-gmp=/mingw32 --with-mpfr=/mingw32 --with-mpc=/mingw32 --with-isl=/mingw32 --with-pkgversion='Rev4, Built by MSYS2 project' --with-bugurl=http://sourceforge.net/projects/msys2 --with-gnu-as --with-gnu-ld --disable-sjlj-exceptions --with-dwarf2 Thread model: posix gcc version 5.2.0 (Rev4, Built by MSYS2 project) I've forwarded the question to MSYS2 maintainers in #msys2 (OFTC), will update once I have more information. Thanks! -- Regards, Qian Hong - http://www.winehq.org