From: Simon Marchi <simon.marchi@polymtl.ca>
To: Claude Robitaille <claude-robitaille@hotmail.com>,
"gdb@sourceware.org" <gdb@sourceware.org>
Subject: Re: GDB is preventing my catch blocks in my C++ program
Date: Tue, 12 Apr 2022 21:17:11 -0400 [thread overview]
Message-ID: <7775f85e-e0f5-2942-bde9-cb3c2effee90@polymtl.ca> (raw)
In-Reply-To: <DS7PR07MB7686EE485ABA3DBC88C324ECF7EC9@DS7PR07MB7686.namprd07.prod.outlook.com>
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
next prev parent reply other threads:[~2022-04-13 1:17 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-13 0:27 Claude Robitaille
2022-04-13 1:17 ` Simon Marchi [this message]
[not found] ` <DS7PR07MB768661F868A4131D995B3449F7EC9@DS7PR07MB7686.namprd07.prod.outlook.com>
2022-04-13 1:33 ` Simon Marchi
2022-04-13 1:39 ` Claude Robitaille
2022-04-14 15:06 ` Claude Robitaille
2022-04-15 15:55 ` Claude Robitaille
2022-04-18 0:45 ` Simon Marchi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7775f85e-e0f5-2942-bde9-cb3c2effee90@polymtl.ca \
--to=simon.marchi@polymtl.ca \
--cc=claude-robitaille@hotmail.com \
--cc=gdb@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).