From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11olkn2013.outbound.protection.outlook.com [40.92.20.13]) by sourceware.org (Postfix) with ESMTPS id E5AF03858D28 for ; Wed, 13 Apr 2022 01:39:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E5AF03858D28 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=n2mTWtiWqhMl7FNalwtHFz1NoSKJBpFWnq8Ao1qHccvfDrq9SzfYNe/LeWhQDDRjc3YCJwxeZSpmQrdqBUuNAicRKNxqRSvLImxdlTGW9RLR0vtl1Rucc8N1O3ZLb6w4tzN1Iw+c8V6HdcbGzl7+OlfZ0sHaG/Cz00xlq+bdUN35oJ6Pe/5ivBMqVojJ9x3eFmMxIRp30y3VaET6CDpEf6NVVGDcgH9CnEHyl5fiapA/YRLpJmXhK7Y2Tw0jbilGOKSJKLTUJq3Kc3xFVoJRC5Iv/nlzWK2qL1+LyTQt4AoyvE2/lQNff1jq0UquldNX3UkiKo15kJRWvO3sH9jVJg== 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=R0rdEe/3C4R4T9aWx+UfvFuTfrEbn+1QLRFaY2bzpdM=; b=Zh8x0+KbEvqi4NAxxWdjFH8T0/cmQzdaZsj78eewYY3Bbm0NfwlzSz4tmtZQJxsc9xn8KivxWyTWX12VgpOvgSD3gGjrqZndKkZL2Z5/5WhkRDjAMDvRFf22WdLyWYFQLMK1jdE/mX4w5h1V1LZsJugkWRvl6s2kmKZG0UCjNVn92L47VG7MEL6qm2on2Y2LyGg8gFBvYeDElIccvueeRO0yg2FNojHjihLOdErYpuyix+pRdDcB/8baUqVBfm/avNLjCubJxOiocpBvbWBdAdsS4ZeDfUNEP7ANSMDI2WUiD9rS4kab307gEQymMiYmu+oV2XxmLPvVP8nnyMp1Ig== 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 BN3PR07MB2628.namprd07.prod.outlook.com (2a01:111:e400:7bbf::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5144.29; Wed, 13 Apr 2022 01:39:14 +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.018; Wed, 13 Apr 2022 01:39:14 +0000 From: Claude Robitaille 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: AQHYTswYdvj6CFKxQku2gtNSnuNgw6ztCs6AgAABkXuAAARfTw== Date: Wed, 13 Apr 2022 01:39:14 +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: d93e4e5d-f8b4-de35-baca-47a6cd31bb83 x-tmn: [kYZhz4f+C9xaFuZBYmcLM4LbJ42KLl9ixkXBcJhRh7MIqLb10ghZfDSoL3n76/+I] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: e9f867dc-94ed-4f49-bb37-08da1cee6ab7 x-ms-traffictypediagnostic: BN3PR07MB2628:EE_ x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 1rHcneVrpAxG6UUVqKh55t3sXQQVERsyMzdkpkQC1sbSKvqNvsAdnhDPkNp43uibrgqg7uh/XamX+7rW9Ew5mGjuTdPnSKffRPdPvjnN7hkAIIjQHGKESkePNroGtZ+NwvTy0Kk++USs7GzVh+Dnet1o28fKWu5oZqMthwJsBwbvkVMFxR+6AJh8wBiwN1CJNS9YJeWvoHAhLS2YJ17/e/G3lUjvZC4MD/4uiLOrWZAnu9eWp2JINSLpLCoQf61GA5TW5xfrDtzKUg0GDso2jfo+ldPKvWErNKBKF2b1dyUJPfKFAqhys2Y8azjJxCpG5pt27MB7xck3gxPL0sT2swTCt8crU8Uch6NewC6LZCpKOXYrFalkKrA92sdzFVYR/pccc5KtZlnwJ+Eq3S6dvm6LAypgrhoram/CpxH7TRrg/E9DuHa464vhUIqEU379jHvaZvh4t1pKpVdq4cyNWqO2xVrA/2pbSUnslQVI2CUk1ApKYjWGsU0AM7C9oMlekKotwyMBfO+/LlryB3MPKnfOKRp1tgTDMEJYigwI68B/xaeHmbefpnKoL04A2yubJcgwOekmp3Ncn3HqfemcmQ== x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?EbO6hcDkTKRYebUWIFf9PJKP2Cd2QkAH552TeGA4M8MbXjrZXuOaAAbH+JAc?= =?us-ascii?Q?uVyHRDk6NO71D0QPFI2mWkdW4KDZjAltYym/KyDN5lYzfJmUg1+Bf5RUZCHl?= =?us-ascii?Q?gl05d/buog/vLFMy/MfLWMWW5rdgcwchgDeRej8i4Q8dv1LPChGdnBEPtvwR?= =?us-ascii?Q?dFJfzNewd7tiMvkwgA7PcAXOtcSCDkstKfo1ky1bBMpXB7F7ncE4yjqhS/IQ?= =?us-ascii?Q?L6aO42/3fnNzQ81s/uJVlW2Z9zJvagaTGjAeDvVFMZwLqSYplcr1ml0AUvCL?= =?us-ascii?Q?UeJ8Krk0nKUGB9hDTLzCfru2fADYTANXcLdDWgWG32j3+qaB0nj63gFq/heO?= =?us-ascii?Q?eOXbZa/WWiPtGpEPSJPIZAHK4LkC/pcS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NJAfD4x7arsJvmEI8VX5XJVZlJuDY2CBpfh4yRLpFwCvCQ4eyvPoHWdgg+G?= =?us-ascii?Q?Igf/0s6FeIeF40isfvK9KSE4dqUq2iY+IoU4o4zszzToS3Nffd24CA7GWqYF?= =?us-ascii?Q?sSbyTfuHcHnQEkJiyjLtzW8HhO7/OywI349e5uCc5eryrgqL4N+Tobs2MfNH?= =?us-ascii?Q?8pY7N6630OFWNas4cu/Kb2YodGIarhGANeC8BmlAdBzVj6VdNxirsytbFbNX?= =?us-ascii?Q?Sagz8IKke9qelWg=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: e9f867dc-94ed-4f49-bb37-08da1cee6ab7 X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Apr 2022 01:39:14.3941 (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: BN3PR07MB2628 X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, HTML_MESSAGE, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, 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 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: , X-List-Received-Date: Wed, 13 Apr 2022 01:39:17 -0000 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