Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: Nitish Kumar Mishra <mishra.nitish.88@gmail.com>, gdb@sourceware.org
Subject: Re: Issue with Latest GDB on AIX with GCC-6.12
Date: Wed, 25 Jan 2017 13:52:00 -0000	[thread overview]
Message-ID: <12a05075-3783-9d3f-1d3c-81931ea91f47@redhat.com> (raw)
In-Reply-To: <fb582215-4471-dd98-41e4-d21968c754d8@redhat.com>

On 01/25/2017 11:12 AM, Pedro Alves wrote:
> On 01/25/2017 10:54 AM, Nitish Kumar Mishra wrote:
>> Hi,
>>
>> The latest community gdb is not working with gcc 6.12, however, it
>> works expectedly fine with GCC-4.8.5 on AIX platform.
> 
> What is gcc 6.12 ?
> 
>> #12 0x000000010007d994 in _ZL23gdb_rl_callback_handlerPc
>> (rl=0x1100e92b0 "") at event-top.c:213
> 
> I only saw C++ frames up to here, and the exception should
> be caught here.  I don't immediately see why that wouldn't
> be working, though maybe it's the "noexcept"?  If you remove
> that, does it fix it?  Maybe we need a level of indirection
> here too, like in gdb_rl_callback_read_char_wrapper_noexcept
> / gdb_rl_callback_read_char_wrapper.

I could reproduce this on gcc119 on the compile farm (AIX 7.2),
which has GCC 6.1.  I tried the workaround suggested above, but
that didn't work.

TBC, it's perfectly valid for a noexpect function to
try/catch inside as long as no exception escapes out, but,
compiler bugs are not unheard-of.

I also tried replacing the TRY/CATCH macros with try/catch(...)
thinking that it could be something with broken type info,
and the runtime somehow not figuring out that that catch
should really catch the exception.  Same thing, doesn't work
for me.

So I'm out of ideas.  It looks like a toolchain/runtime bug
to me.

TBC, I'm not going to be looking at this further.  It's
very uncomfortable for me to use that machine --- I get a
bit too high latency, and emacs doesn't work.  I even tried
to survive with vi, but then DEL/BS didn't work for me.  :-P

Here's what I had tried.

From 968f6a4e0744f06f011ab585930dbd4d9cf5b8d6 Mon Sep 17 00:00:00 2001
From: Pedro Alves <palves@redhat.com>
Date: Wed, 25 Jan 2017 13:15:04 +0000
Subject: [PATCH] AIX

---
 gdb/event-top.c | 33 ++++++++++++++++++++++-----------
 1 file changed, 22 insertions(+), 11 deletions(-)

diff --git a/gdb/event-top.c b/gdb/event-top.c
index ae4f704..789d419 100644
--- a/gdb/event-top.c
+++ b/gdb/event-top.c
@@ -196,27 +196,38 @@ gdb_rl_callback_read_char_wrapper (gdb_client_data client_data)
     throw_exception (gdb_expt);
 }
 
-/* GDB's readline callback handler.  Calls the current INPUT_HANDLER,
-   and propagates GDB exceptions/errors thrown from INPUT_HANDLER back
-   across readline.  See gdb_rl_callback_read_char_wrapper.  This must
-   be noexcept in order to avoid problems with mixing sjlj and
-   (sjlj-based) C++ exceptions.  */
+/* Calls the current INPUT_HANDLER, and returns any GDB
+   exceptions/errors thrown from INPUT_HANDLER as a normal return.
+   See gdb_rl_callback_handler.  */
 
-static void
-gdb_rl_callback_handler (char *rl) noexcept
+static struct gdb_exception
+input_handler_wrapper (char *rl)
 {
   struct gdb_exception gdb_rl_expt = exception_none;
   struct ui *ui = current_ui;
 
-  TRY
+  try
     {
       ui->input_handler (rl);
     }
-  CATCH (ex, RETURN_MASK_ALL)
+  catch (...)
     {
-      gdb_rl_expt = ex;
     }
-  END_CATCH
+
+  return gdb_rl_expt;
+}
+
+/* GDB's readline callback handler.  Calls the current INPUT_HANDLER,
+   and propagates GDB exceptions/errors thrown from INPUT_HANDLER back
+   across readline.  See gdb_rl_callback_read_char_wrapper.  This must
+   be noexcept in order to avoid problems with mixing sjlj and
+   (sjlj-based) C++ exceptions.  */
+
+static void
+gdb_rl_callback_handler (char *rl) noexcept
+{
+  struct gdb_exception gdb_rl_expt
+    = input_handler_wrapper (rl);
 
   /* If we caught a GDB exception, longjmp out of the readline
      callback.  There's no other way for the callback to signal to
-- 
2.5.5



  reply	other threads:[~2017-01-25 13:52 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-25 10:54 Nitish Kumar Mishra
2017-01-25 11:12 ` Pedro Alves
2017-01-25 13:52   ` Pedro Alves [this message]
2017-01-25 14:01     ` Pedro Alves
2017-01-25 14:38     ` Yao Qi
2017-01-25 14:44       ` Pedro Alves
2017-01-28 23:56 David Edelsohn
2017-01-29  1:11 ` David Edelsohn
2017-01-31 13:09   ` Pedro Alves
2017-02-07  8:05     ` Nitish Kumar Mishra
2017-02-07 10:30       ` Pedro Alves
2017-02-07 13:44         ` David Edelsohn
2017-02-07 13:57           ` Pedro Alves
2017-02-07 14:16             ` David Edelsohn
2017-02-08  6:16               ` Nitish Kumar Mishra
2017-02-08  7:04                 ` Nitish Kumar Mishra
2017-02-08 12:06                 ` Pedro Alves
2017-02-08 13:32                   ` David Edelsohn
2017-02-09  4:51                     ` Nitish Kumar Mishra
2017-02-09 12:05                       ` Nitish Kumar Mishra
2017-02-09 12:15                         ` Nitish Kumar Mishra
2017-02-09 15:50                           ` David Edelsohn
2017-02-10  7:22                             ` Nitish Kumar Mishra
2017-02-10 15:52                               ` David Edelsohn
2017-02-12 21:05                                 ` David Edelsohn
2017-02-12 23:52                                   ` Pedro Alves
2017-02-13 15:02                                     ` David Edelsohn
2017-02-13 15:19                                       ` Eli Zaretskii
2017-02-13 15:38                                         ` Nitish Kumar Mishra
2017-02-20 11:22                                           ` Nitish Kumar Mishra
2017-02-20 11:25                                             ` Nitish Kumar Mishra
2017-02-20 11:37                                               ` Nitish Kumar Mishra
2017-02-21  8:01                                                 ` Nitish Kumar Mishra
2017-02-21 14:47                                                   ` David Edelsohn

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=12a05075-3783-9d3f-1d3c-81931ea91f47@redhat.com \
    --to=palves@redhat.com \
    --cc=gdb@sourceware.org \
    --cc=mishra.nitish.88@gmail.com \
    /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