From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 4sYRL74kVmINcgAAWB0awg (envelope-from ) for ; Tue, 12 Apr 2022 21:17:50 -0400 Received: by simark.ca (Postfix, from userid 112) id AFBA91F327; Tue, 12 Apr 2022 21:17:50 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_DYNAMIC, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 35AD81E787 for ; Tue, 12 Apr 2022 21:17:50 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 926D43857346 for ; Wed, 13 Apr 2022 01:17:49 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 926D43857346 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1649812669; bh=IJ0UpnJWnC9ViIvzTLcutcoqUZnBZL38JLVPKD9uxuA=; h=Date:Subject:To:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=fzgURSl4mAEyTF2ajTOp3FUCU7JZI1pHvXDPa/pbk21BRcy568s379dW5OVJnVts5 IvwCMX+vNsVkV1+dJicy+ETGWz2hCKLDx+R1f9hg4rvQzf9pFd2CWFrcwsYE10+Knh e5eVMlZo6SJByXWcHVD7/hsk7/UV2bGE3ukAYrxU= Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id 6B880385803E for ; Wed, 13 Apr 2022 01:17:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 6B880385803E Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 23D1HCU6009785 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 12 Apr 2022 21:17:16 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 23D1HCU6009785 Received: from [10.0.0.11] (192-222-157-6.qc.cable.ebox.net [192.222.157.6]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id DFCB21E787; Tue, 12 Apr 2022 21:17:11 -0400 (EDT) Message-ID: <7775f85e-e0f5-2942-bde9-cb3c2effee90@polymtl.ca> Date: Tue, 12 Apr 2022 21:17:11 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: GDB is preventing my catch blocks in my C++ program Content-Language: en-US To: Claude Robitaille , "gdb@sourceware.org" References: In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Wed, 13 Apr 2022 01:17:12 +0000 X-BeenThere: gdb@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Simon Marchi via Gdb Reply-To: Simon Marchi Errors-To: gdb-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb" On 2022-04-12 20:27, Claude Robitaille via Gdb wrote: > Hi all, > > I am having an issue with exception in C++. When I run my program outside gdb (gsbserver actually) all is good and my exceptions are properly catched. > > However, when running un gdbserver I get: > "terminate called after throwing an instance of XXXX" > > The actuall catch statmeent is catch (...) so it is a catch all. > > I obvisouly suspect that, somehow, gdbserver is preventing the normal try/catch/throw machinery to work as it should. The "terminate called..." string is most likely coming form the language library. > > Background > I am crosscompiling with mingw-w64 on Ubuntu. The compiler is 9.3 while both gdb and gdbserver are 9.1 I run gdb under eclipse > > I run under WIndows 10 > > I spend the whole afternoon on Google but all I found are cases where the programmer did not properly coded the catch (or something similar), which, indeed, is not my problem since all is good when running outside of gdb. > > Not sure how to tackle this one!! Just to try to get the obvious out of the way first... are you sure it's not GDBserver itself crashing? GDBserver is a C++ program, so it's possible that an exception is thrown and not caught in it. Can you paste the logs of a session that shows your problem? GDBserver and your program are running on Windows IIUC? Simon