Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Simon Marchi <simon.marchi@ericsson.com>
To: Pedro Alves <palves@redhat.com>, <gdb-patches@sourceware.org>
Subject: Re: [PATCH 00/30] Stop throwing exceptions from signal handlers
Date: Mon, 21 Mar 2016 19:52:00 -0000	[thread overview]
Message-ID: <56F050EE.8040703@ericsson.com> (raw)
In-Reply-To: <1458328714-4938-1-git-send-email-palves@redhat.com>

On 16-03-18 03:18 PM, Pedro Alves wrote:
> Aka, get rid of immediate_quit.
> 
> Throwing exceptions from signal handlers is undefined C++.  So for C++
> conversion we need to replace the immediate_quit mechanism by
> something else.
> 
> This series:
> 
> - Replaces all immediate_quit uses with something else.
> 
> - Removes a few custom SIGINT handlers, centralizing more on the
>   "quit" flag and GDB's default SIGINT handler.
> 
> - Fixes several classical signal handler / mainline code races, using
>   the self-pipe trick.
> 
> - Introduces a "struct serial_event" abstraction to hide the self-pipe
>   trick -- on Windows we don't use pipes at all, and on Linux, we
>   could use eventfd (but I didn't do that, at least yet).
> 
> - Stumbles on a few bogus clear_quit_flag uses, and thus completely
>   eliminates it, for good measure.
> 
> - Decouples target_interrupt from all-stop/non-stop modes
> 
> - Fixes a few cases of indefinitely-delayed Ctrl-C handling.
> 
> - Fixes/incorrect handling of EINTR in ser-*.c backends
> 
> - Goes through the tree fixing all target_terminal_ours calls that
>   should be target_terminal_ours_for_output instead.  We only end up
>   with a few target_terminal_ours calls, at places were we need to
>   handle input.
> 
> - Plugs a few leaks along the way.
> 
> - Fixes a bug where you can't answer y/n to an internal error if the
>   target has the terminal.
> 
> - Introduces the concept of quit handlers.
> 
> - Does a few clean ups along the way.
> 
> Tested on x86-64 Fedora 23, native and gdbserver.
> 
> A slightly older version manually test on mingw64/Windows 7, to make
> sure Ctrl-C still works as expected there.
> 
> This applies on top of the "target mips" elimination patch:
>   https://sourceware.org/ml/gdb-patches/2016-03/msg00313.html
> 
> I've pushed the whole series to users/palves/immediate_quit.
> 
> Pedro Alves (30):
>   Don't rely on immediate_quit in command_line_input
>   Inline command_loop in read_command_line
>   TUI: check whether in secondary prompt instead of immediate_quit
>   Don't set immediate_quit in prompt_for_continue
>   Stop remote-fileio.c from throwing from SIGINT handler
>   Remove unused struct serial::name field
>   Introduce a serial interface for select'able events
>   Fix signal handler/event-loop races
>   Introduce interruptible_select
>   Make Python use a struct serial event
>   Don't call clear_quit_flag after check_quit_flag
>   Don't call clear_quit_flag in command_handler
>   Don't call clear_quit_flag in prepare_to_throw_exception
>   Don't call clear_quit_flag in captured_main
>   Eliminate clear_quit_flag
>   Decouple target_interrupt from all-stop/non-stop modes
>   Pass Ctrl-C to the target in target_terminal_inferior
>   Fix inconsistent handling of EINTR in ser-*.c backends
>   ada-lang.c: Introduce type_as_string and use it
>   Use target_terminal_ours_for_output in cp-support.c
>   Use target_terminal_ours_for_output in exceptions.c
>   Use target_terminal_ours_for_output in infcmd.c
>   Use target_terminal_ours_for_output in warning/internal_error
>   Add missing cleanups to defaulted_query and prompt_for_continue
>   Do target_terminal_ours in query & friends instead of in all callers
>   Use target_terminal_ours_for_output in MI
>   TUI: GC tui_target_has_run
>   target remote: Don't rely on immediate_quit (introduce quit handlers)
>   Eliminate immediate_quit
>   Eliminate target_check_pending_interrupt
> 
>  gdb/Makefile.in        |   6 +-
>  gdb/ada-lang.c         |  74 ++++++-----
>  gdb/cp-support.c       |   4 +-
>  gdb/defs.h             |  58 +++++++--
>  gdb/event-loop.c       |  41 ++++--
>  gdb/event-loop.h       |  26 +---
>  gdb/event-top.c        | 165 ++++++++++++++++++++++---
>  gdb/exceptions.c       |  17 ++-
>  gdb/extension-priv.h   |   5 +-
>  gdb/extension.c        |  34 +++--
>  gdb/gdb_select.h       |  15 +++
>  gdb/gnu-nat.c          |  12 +-
>  gdb/guile/guile.c      |   1 -
>  gdb/guile/scm-ports.c  |   4 +-
>  gdb/i386-tdep.c        |  49 ++------
>  gdb/infcmd.c           |  10 +-
>  gdb/linux-nat.c        |  10 --
>  gdb/linux-record.c     |  54 +++-----
>  gdb/main.c             |   1 -
>  gdb/mi/mi-interp.c     | 125 ++++++++++++++++---
>  gdb/mi/mi-main.c       |   7 +-
>  gdb/mingw-hdep.c       |  52 +-------
>  gdb/nto-procfs.c       |   4 -
>  gdb/posix-hdep.c       |  13 --
>  gdb/python/python.c    |  44 +++----
>  gdb/record-full.c      |  22 ++--
>  gdb/remote-fileio.c    |  34 +----
>  gdb/remote-sim.c       |   5 +-
>  gdb/remote.c           | 329 +++++++++++++++++++++----------------------------
>  gdb/ser-base.c         |  30 ++++-
>  gdb/ser-event.c        | 220 +++++++++++++++++++++++++++++++++
>  gdb/ser-event.h        |  51 ++++++++
>  gdb/ser-go32.c         |   4 +
>  gdb/ser-unix.c         | 108 ++--------------
>  gdb/serial.c           |  66 ++++++----
>  gdb/serial.h           |   8 +-
>  gdb/target-delegates.c |  25 ++--
>  gdb/target.c           |  17 ++-
>  gdb/target.h           |  19 +--
>  gdb/top.c              |  67 +++++-----
>  gdb/tui/tui-hooks.c    |  24 ----
>  gdb/tui/tui-io.c       |   2 +-
>  gdb/tui/tui.c          |   4 +-
>  gdb/ui-file.c          |   8 +-
>  gdb/utils.c            |  66 ++++++----
>  45 files changed, 1115 insertions(+), 825 deletions(-)
>  create mode 100644 gdb/ser-event.c
>  create mode 100644 gdb/ser-event.h
> 

I went over the series, and I understood some of the words used.  What I understood
looked very good.  For the rest, I trust you are doing the right thing. :)

Thanks a lot for doing this, since this is the major roadblock before we can't start
using C++!


  parent reply	other threads:[~2016-03-21 19:52 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-18 19:19 Pedro Alves
2016-03-18 19:18 ` [PATCH 18/30] Fix inconsistent handling of EINTR in ser-*.c backends Pedro Alves
2016-03-18 19:18 ` [PATCH 01/30] Don't rely on immediate_quit in command_line_input Pedro Alves
2016-03-18 19:19 ` [PATCH 22/30] Use target_terminal_ours_for_output in infcmd.c Pedro Alves
2016-03-18 19:19 ` [PATCH 29/30] Eliminate immediate_quit Pedro Alves
2016-03-18 19:19 ` [PATCH 02/30] Inline command_loop in read_command_line Pedro Alves
2016-03-18 19:19 ` [PATCH 27/30] TUI: GC tui_target_has_run Pedro Alves
2016-03-18 19:19 ` [PATCH 26/30] Use target_terminal_ours_for_output in MI Pedro Alves
2016-03-18 19:19 ` [PATCH 30/30] Eliminate target_check_pending_interrupt Pedro Alves
2016-03-18 19:19 ` [PATCH 28/30] target remote: Don't rely on immediate_quit (introduce quit handlers) Pedro Alves
2016-03-18 19:19 ` [PATCH 20/30] Use target_terminal_ours_for_output in cp-support.c Pedro Alves
2016-03-18 19:19 ` [PATCH 03/30] TUI: check whether in secondary prompt instead of immediate_quit Pedro Alves
2016-03-18 19:19 ` [PATCH 14/30] Don't call clear_quit_flag in captured_main Pedro Alves
2016-03-18 19:19 ` [PATCH 19/30] ada-lang.c: Introduce type_as_string and use it Pedro Alves
2016-03-18 19:24 ` [PATCH 17/30] Pass Ctrl-C to the target in target_terminal_inferior Pedro Alves
2016-03-18 19:24 ` [PATCH 25/30] Do target_terminal_ours in query & friends instead of in all callers Pedro Alves
2016-03-18 19:24 ` [PATCH 23/30] Use target_terminal_ours_for_output in warning/internal_error Pedro Alves
2016-03-18 19:25 ` [PATCH 08/30] Fix signal handler/event-loop races Pedro Alves
2016-03-18 19:25 ` [PATCH 13/30] Don't call clear_quit_flag in prepare_to_throw_exception Pedro Alves
2016-03-18 19:25 ` [PATCH 12/30] Don't call clear_quit_flag in command_handler Pedro Alves
2016-03-18 19:25 ` [PATCH 04/30] Don't set immediate_quit in prompt_for_continue Pedro Alves
2016-03-18 19:26 ` [PATCH 07/30] Introduce a serial interface for select'able events Pedro Alves
2016-03-18 19:26 ` [PATCH 10/30] Make Python use a struct serial event Pedro Alves
2016-03-18 19:26 ` [PATCH 24/30] Add missing cleanups to defaulted_query and prompt_for_continue Pedro Alves
2016-03-18 19:27 ` [PATCH 21/30] Use target_terminal_ours_for_output in exceptions.c Pedro Alves
2016-03-18 19:27 ` [PATCH 06/30] Remove unused struct serial::name field Pedro Alves
2016-03-18 19:27 ` [PATCH 15/30] Eliminate clear_quit_flag Pedro Alves
2016-03-18 19:28 ` [PATCH 05/30] Stop remote-fileio.c from throwing from SIGINT handler Pedro Alves
2016-03-18 19:28 ` [PATCH 11/30] Don't call clear_quit_flag after check_quit_flag Pedro Alves
2016-03-18 19:37 ` [PATCH 09/30] Introduce interruptible_select Pedro Alves
2016-03-21 17:59   ` Simon Marchi
2016-03-21 18:33     ` Pedro Alves
2016-03-21 19:48   ` Simon Marchi
2016-03-21 19:49     ` Pedro Alves
2016-03-18 19:37 ` [PATCH 16/30] Decouple target_interrupt from all-stop/non-stop modes Pedro Alves
2016-03-21 18:21   ` Simon Marchi
2016-03-21 18:24     ` Pedro Alves
2016-03-21 19:52 ` Simon Marchi [this message]
2016-03-31 14:43   ` [PATCH 00/30] Stop throwing exceptions from signal handlers Pedro Alves
2016-03-31 18:44     ` Pedro Alves
2016-04-12 16:15     ` Pedro Alves

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=56F050EE.8040703@ericsson.com \
    --to=simon.marchi@ericsson.com \
    --cc=gdb-patches@sourceware.org \
    --cc=palves@redhat.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