From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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: From: Simon Marchi 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-Spam-Status: No, score=-3033.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org 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: , X-List-Received-Date: Wed, 13 Apr 2022 01:17:21 -0000 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