From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 126032 invoked by alias); 3 Nov 2015 22:39:52 -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 126021 invoked by uid 89); 3 Nov 2015 22:39:52 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Tue, 03 Nov 2015 22:39:51 +0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id 185CFC100444; Tue, 3 Nov 2015 22:39:50 +0000 (UTC) Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id tA3MdmIi005700; Tue, 3 Nov 2015 17:39:49 -0500 Message-ID: <563937B4.7080800@redhat.com> Date: Tue, 03 Nov 2015 22:39:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: fracting@gmail.com CC: gdb-patches@sourceware.org Subject: Re: [PATCH 00/11] C++/MinGW patches 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> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2015-11/txt/msg00129.txt.bz2 On 11/03/2015 09:02 PM, Qian Hong wrote: > On Wed, Nov 4, 2015 at 12:54 AM, Pedro Alves wrote: >> I've pushed this patch: >> >> https://sourceware.org/ml/gdb-patches/2015-11/msg00114.html >> >> on the testing branch as well. I wonder if it makes a difference for you. > > Update: > > I can confirm this patch fix the issue for MSYS2 mingw-w64 gdb. > > I was testing the wrong binary due to frequently switch between > Windows VM and Linux host. > Sorry for the stupid mistake and noise. No worries, and thanks for reconfirming. Note however, that the patch will be reverted at some point. It's a workaround until we get rid of exceptions thrown from signal handlers, but, Windows doesn't really have unix-like async signal handlers (signal handlers run on a separate thread), so it should be unaffected by that issue. >From the backtrace you showed: (gdb) bt #0 0x00870778 in abort () #1 0x0085ebda in uw_init_context_1 () #2 0x0085f2de in _Unwind_RaiseException () #3 0x008728e5 in __cxa_throw () #4 0x006cfead in throw_exception (exception=...) at ../../gdb/gdb/common/common-exceptions.c:295 #5 0x006d000d in throw_it (reason=RETURN_ERROR, error=GENERIC_ERROR, fmt=0x8d86bc "No symbol table is loaded. Use the \"file\" command.", ap=0x320f754 "~aP") at ../../gdb/gdb/common/common-exceptions.c:354 #6 0x006d0034 in throw_verror (error=GENERIC_ERROR, fmt=0x8d86bc "No symbol table is loaded. Use the \"file\" command.", ap=0x320f754 "~aP") at ../../gdb/gdb/common/common-exceptions.c:360 #7 0x0068c1f6 in verror ( string=, args=) at ../../gdb/gdb/utils.c:525 #8 0x006cfc77 in error ( fmt=0x8d86bc "No symbol table is loaded. Use the \"file\" command.") at ../../gdb/gdb/common/errors.c:43 #9 0x0050c964 in set_default_source_symtab_and_line () at ../../gdb/gdb/source.c:207 #10 0x00474fa0 in list_command ( ... We see that gdb was throwing a gdb exception from mainline code, not a signal handler, and in frame #4, gdb called the runtime to throw the (underlying) C++ exception. Line common-exceptions.c:295 is just "throw ex;" 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. 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. Thanks, Pedro Alves