From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id yso8GK2VWWI6awAAWB0awg (envelope-from ) for ; Fri, 15 Apr 2022 11:56:29 -0400 Received: by simark.ca (Postfix, from userid 112) id 4499F1F327; Fri, 15 Apr 2022 11:56:29 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.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 82BB51ED17 for ; Fri, 15 Apr 2022 11:56:28 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D25513856263 for ; Fri, 15 Apr 2022 15:56:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D25513856263 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1650038187; bh=CeWdLuaPfoomk8uCNnE0soj1ntbdbUKnr7rNpdgUH8E=; h=To:Subject:Date:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=rwQPuZP4mLkv4fogDdLVc81k+2/AzwYtOdWwJD8V1l+zaCvG988IsOvJlSIDHAWpW UU/SxFKD3YRGUZ9Qnl8mHR9nLmubU5PrCKmlj5Y6bbuUFcBmwgh31T+A0PBko1H9Qk 3NbRNe/DPx0LW/RoGrYOUTWtomgbinWHY5ZavUGM= Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10olkn2014.outbound.protection.outlook.com [40.92.42.14]) by sourceware.org (Postfix) with ESMTPS id E91503857C4E for ; Fri, 15 Apr 2022 15:55:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E91503857C4E ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Anba5oS7bLN2RFmMowwC1eEWcc2Ih/HMWdv6O983FQOPuGz2ZYQbX6Wi5AWCH7KSUEn0T8uUL/QHtc3IvQpUEPgAWbsnWZHXFFSdCLLyJu/GPlE2XPh1hpScpJZJxLQ8mJTBuIm2HMA9uT45zQth9quCHa/oza/SDX0EFK2Bnxz4fgfn6CbuAAKFhWE5OHUE3IxSJlQ7XJvbtUC2d42A5jpOjd3Qy6VxBDwKYfHg9bJSqqISa2e3Y+1f2aId5Xzc8IWsUbcKzE8pCu9EPW0V35PMbwZyZAOohQEf8h8gme6hWlyTqEPZjJPZ7OsqLloVd02oIWHviZ/qe1jGGI4s5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=HVy3VYhOGRzsSyI5LkUPYTQVjLkhLpfWtb4+HVzHsuc=; b=Pnggi54Y+vHxnEpNJjHhPGKQHBROR4FuYkDSdwKxsv5/Mg6TU9jDt5xGprRh3qHqxxoscThvtkd5f19QtxOgf58R8QF8iW8ATKw0ZAAOzpv2CtdqyH+/MQ+7W9l8seE0gwnGKy1yf4evr3rYkxelMKjX2tOKVSnejCyQaa0mWlz+PlDhcUzZTJ4quTEm+GAO2Xx1ltRCMSMsjVE/Kg33ZLnWz2gmGYnb9q7WNSkzBAeNeyRyrYybEgnqRmX9G30d0GSoKxIAtenD1SWxoE2o9hFSDAG1was4SDsdFQbRYcRmrX5LEO6YqzUHm++CqXD9W4zTM+SIUOr+ODB66Q+J9g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none Received: from DS7PR07MB7686.namprd07.prod.outlook.com (2603:10b6:5:2d0::19) by CO2PR07MB2661.namprd07.prod.outlook.com (2603:10b6:102:b::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5164.20; Fri, 15 Apr 2022 15:55:57 +0000 Received: from DS7PR07MB7686.namprd07.prod.outlook.com ([fe80::ca1:43d8:3a4:2b2b]) by DS7PR07MB7686.namprd07.prod.outlook.com ([fe80::ca1:43d8:3a4:2b2b%6]) with mapi id 15.20.5164.023; Fri, 15 Apr 2022 15:55:57 +0000 To: Simon Marchi , "gdb@sourceware.org" Subject: Re: GDB is preventing my catch blocks in my C++ program Thread-Topic: GDB is preventing my catch blocks in my C++ program Thread-Index: AQHYTswYdvj6CFKxQku2gtNSnuNgw6ztCs6AgAABkXuAAARfT4ACZzSSgAGsFbg= Date: Fri, 15 Apr 2022 15:55:57 +0000 Message-ID: References: <7775f85e-e0f5-2942-bde9-cb3c2effee90@polymtl.ca> In-Reply-To: Accept-Language: en-CA, en-US Content-Language: en-CA X-MS-Has-Attach: X-MS-TNEF-Correlator: suggested_attachment_session_id: 064ddb24-cc91-b1b4-8679-ad67a6fbf126 x-tmn: [mvy944+3rBJg77E8s34X+l2ITtoeGWnN1iMOHbfb+RBjAzez9qktAXSSLawn4PDR] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: e1f22584-d78a-4c4c-7846-08da1ef86e4e x-ms-traffictypediagnostic: CO2PR07MB2661:EE_ x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: DwlDeBpd1nNhiu/uA2pDeCQ7U7234i+Z+CrYcAjiK8Qoxq3KgZd2CRSBdTGC52GTT2LGO520eDXV9KPvMN+ZZ4M2aFeeZT5h2tLYuIABLYk9gM5TTm80lHu/d1lmml4dbcjT2brH+sYCMMXezHuKVw+k32ewf298n7HHnKXiMexnkLJ3MbXyhDY9FYUBs/41u0mrAjEuBLZhB3ZTJe/EhYfwuyxnFNUpxOMK5WQsCOHzQSteoa4zG0M+0cVHzVumJVmOKVqHDVxksR6ci9v61wpKrrK/nDDYt95CmGYuMkocO9WHsxadxeraZehvcFjoSn1vKXojXXoSKLBrGb/hq0axaqLxaNMyhj4bz1SwyBH5HxjlKABb9YIaqo9/CwLRoE3Mzzg5nXagnKw9HLWRDDDbqO4x+W9ZAnZ5uY4JdUNUMimIFG3e0qrbYfOJandjRYPQ4eZzxKhI4GHJPUZ1dX6YT/KXBFa31Rwc5I4wePyYFk4MDDjUK0tU04eihry369NH+v2rpyI2zi+LN2SsrZhhdkDmKDfty6qwIE5g+yJz3up3hnzA+DebOuNcjwJhX8T1r3XEsgNIf36dy+cf9y4lVMhrvOWqUs4c0aLp18xIZS3qZdgHVRT53c/0nUjt x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?ehRsozXudp8nzFoBYC2lZ2wBy36MLilNHanccedC6PLNMg662g/INwnFR4aI?= =?us-ascii?Q?Twq20oir+lUG3R6FDbAQICma+YwF1F+UsqrLt8D7LPf+5+GeOltDHmHhvIy0?= =?us-ascii?Q?HThF2Rv42zu2M8CwVQZncWv9p+Q0XN6xPu7MarVtvRqleIcj163+cZ/DAWtj?= =?us-ascii?Q?wd5HuajXuVHglLqKORRjqmOzViZ0qK/lE8rmE3NKIF6mZ4eTUHfvNqu0UapD?= =?us-ascii?Q?AgNbjLen6qEaeCF4V2/QlcbHfnkOJl15UIY6NsITEoJKtIuCyychLtuYafu0?= =?us-ascii?Q?D17B+V6SMn9Tf1+oef0NpsJEtfEISVNq7G1Cc9La2nlEg+0GkytdJwt3p1Ke?= =?us-ascii?Q?QFlnY5C7UXPSG8UqPZv/XqxMvxC9OFIQcpZ/PPx7wX9aFcENM3YnoA4hLgJP?= =?us-ascii?Q?u4sVJFKGw3SybB9R9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LLig?= =?us-ascii?Q?iBtt9pUPDCZ7pBkX1C85X2WXlvvZWac/z5pyaC24YBsGHWSzLy29Zkk5zQiS?= =?us-ascii?Q?nxvwh8JYiTJTefAuG7S2qyGsE0pIFPlzdd7FXaoNa3IKOg0TBF0Ii+guTgo8?= =?us-ascii?Q?q3aBp6pMM1Alv1MiHghTANWBtDD2mqu6R4z+ckGwubIqr5bXuQgg4TknSQ7t?= =?us-ascii?Q?0RwdiIbsbegRv7o=3D?= MIME-Version: 1.0 X-OriginatorOrg: sct-15-20-4755-11-msonline-outlook-5fbaf.templateTenant X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DS7PR07MB7686.namprd07.prod.outlook.com X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: e1f22584-d78a-4c4c-7846-08da1ef86e4e X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Apr 2022 15:55:57.7080 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO2PR07MB2661 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 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: Claude Robitaille via Gdb Reply-To: Claude Robitaille Errors-To: gdb-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb" Simon, Someone is pointing to a bug, that you fix, that explains the behaviour I a= m seeing. Do you concur? Here is the commit https://sourceware.org/git/?p=3Dbinutils-gdb.git;a=3Dcommit;f=3Dgdb/nat/win= dows-nat.c;h=3D183be222907a6f419bd71f70ee650989026f0188 Claude ________________________________ From: Claude Robitaille Sent: April 14, 2022 11:06 AM To: Simon Marchi ; gdb@sourceware.org ; Claude Robitaille Subject: Re: GDB is preventing my catch blocks in my C++ program I created a sample program to reproduce the issues. #include #include int main() { std::cout<<"Before the try block" << std::endl; try { throw std::runtime_error("Test exception"); } catch (...) { std::cout << "Catched the exception" << std::endl; } std::cout<<"After the try block" << std::endl; return 0; } I compiled it using this x86_64-w64-mingw32-g++ -static hello.cpp -static-libstdc++ -static-libgcc -= o hello When running outside gdb, I get this output Before the try block Catched the exception After the try block But under gdbserver, I get Listening on port 2345 Remote debugging from host 192.168.70.8, port 44782 Before the try block terminate called after throwing an instance of 'std::runtime_error' Child exited with status 3 ________________________________ From: Gdb on behalf of Claude= Robitaille via Gdb Sent: April 12, 2022 9:39 PM To: Simon Marchi ; gdb@sourceware.org Subject: Re: GDB is preventing my catch blocks in my C++ program To include the list... ________________________________ From: Claude Robitaille Sent: April 12, 2022 9:28 PM To: Simon Marchi Subject: Re: GDB is preventing my catch blocks in my C++ program Thanks Simon for the quick reply. I can single step the program up to the point where an exception is thrown.= And I did set a breakpoint inside the catch statement but no success (earl= ier breakpoint in the code are working as expected). Here is what appears on the console (yes, it is Windows) Listening on port 2345 Remote debugging from host 192.168.70.8, port 34542 Error while doing a GetTokenInformation - Unknown errorLOGGER NOT INITIALIZ= ED: ***********************************************************= ********************************** terminate called after throwing an instance of 'sf::context::tGlobal::envVa= riableMissing' Child exited with status 3 The string that starts with Error blah blah is my own std::cout earlier in = the program. Same with the line with the ****** and the LOGGER xxxx is from the g3log library in my program. The exception instance is definitely what my program is throwing. I guess Child exited is from gdb. ________________________________ From: Simon Marchi Sent: April 12, 2022 9:17 PM To: Claude Robitaille ; gdb@sourceware.org <= gdb@sourceware.org> Subject: Re: GDB is preventing my catch blocks in my C++ program 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 catche= d. > > 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..." stri= ng is most likely coming form the language library. > > Background > I am crosscompiling with mingw-w64 on Ubuntu. The compiler is 9.3 while b= oth 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