public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
To: gdb-patches@sourceware.org
Subject: [RFC 3/3] gdb: remove inferior continuations
Date: Thu, 18 Apr 2024 09:36:38 +0200	[thread overview]
Message-ID: <2330c2b4329642ee66976b4b8d5ee8f1e4defc42.1713423838.git.tankut.baris.aktemur@intel.com> (raw)
In-Reply-To: <cover.1713423838.git.tankut.baris.aktemur@intel.com>

Remove the continuation mechanism.  It is not used anymore.
---
 gdb/inf-loop.c |  5 -----
 gdb/inferior.c | 19 -------------------
 gdb/inferior.h | 11 -----------
 3 files changed, 35 deletions(-)

diff --git a/gdb/inf-loop.c b/gdb/inf-loop.c
index 41e766095f0..3c31d0d2349 100644
--- a/gdb/inf-loop.c
+++ b/gdb/inf-loop.c
@@ -51,11 +51,6 @@ inferior_event_handler (enum inferior_event_type event_type)
 	    target_async (false);
 	}
 
-      /* Do all continuations associated with the whole inferior (not
-	 a particular thread).  */
-      if (inferior_ptid != null_ptid)
-	current_inferior ()->do_all_continuations ();
-
       /* When running a command list (from a user command, say), these
 	 are only run when the command list is all done.  */
       if (current_ui->async)
diff --git a/gdb/inferior.c b/gdb/inferior.c
index 4e1d789d1ba..a42c79d6ce3 100644
--- a/gdb/inferior.c
+++ b/gdb/inferior.c
@@ -77,8 +77,6 @@ inferior::~inferior ()
      that target, leaving its reference count artificially high.  However,
      this is not critical as the dummy_target is a singleton.  */
   gdb_assert (m_target_stack.top ()->stratum () == dummy_stratum);
-
-  m_continuations.clear ();
 }
 
 inferior::inferior (int pid_)
@@ -184,23 +182,6 @@ inferior::set_arch (gdbarch *arch)
     registers_changed_ptid (proc_target, ptid_t (this->pid));
 }
 
-void
-inferior::add_continuation (std::function<void ()> &&cont)
-{
-  m_continuations.emplace_front (std::move (cont));
-}
-
-void
-inferior::do_all_continuations ()
-{
-  while (!m_continuations.empty ())
-    {
-      auto iter = m_continuations.begin ();
-      (*iter) ();
-      m_continuations.erase (iter);
-    }
-}
-
 /* Notify interpreters and observers that inferior INF was added.  */
 
 static void
diff --git a/gdb/inferior.h b/gdb/inferior.h
index 7be28423aeb..2b2905b7576 100644
--- a/gdb/inferior.h
+++ b/gdb/inferior.h
@@ -499,14 +499,6 @@ class inferior : public refcounted_object,
   /* Delete all threads in the thread list, silently.  */
   void clear_thread_list ();
 
-  /* Continuations-related methods.  A continuation is an std::function
-     to be called to finish the execution of a command when running
-     GDB asynchronously.  A continuation is executed after any thread
-     of this inferior stops.  Continuations are used by the attach
-     command and the remote target when a new inferior is detected.  */
-  void add_continuation (std::function<void ()> &&cont);
-  void do_all_continuations ();
-
   /* Set/get file name for default use for standard in/out in the inferior.
 
      On Unix systems, we try to make TERMINAL_NAME the inferior's controlling
@@ -672,9 +664,6 @@ class inferior : public refcounted_object,
   /* The name of terminal device to use for I/O.  */
   std::string m_terminal;
 
-  /* The list of continuations.  */
-  std::list<std::function<void ()>> m_continuations;
-
   /* The arguments string to use when running.  */
   std::string m_args;
 
-- 
2.34.1

Intel Deutschland GmbH
Registered Address: Am Campeon 10, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de <http://www.intel.de>
Managing Directors: Christin Eisenschmid, Sharon Heck, Tiffany Doon Silva  
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928


      parent reply	other threads:[~2024-04-18  7:37 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-18  7:36 [RFC 0/3] Wait for inferior after attaching Tankut Baris Aktemur
2024-04-18  7:36 ` [PATCH 1/3] gdb: print target in print_target_wait_results Tankut Baris Aktemur
2024-04-18  7:36 ` [RFC 2/3] gdb: wait for inferior after attaching instead of adding a continuation Tankut Baris Aktemur
2024-04-19 20:33   ` Tom Tromey
2024-04-22  6:48     ` Aktemur, Tankut Baris
2024-04-18  7:36 ` Tankut Baris Aktemur [this message]

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=2330c2b4329642ee66976b4b8d5ee8f1e4defc42.1713423838.git.tankut.baris.aktemur@intel.com \
    --to=tankut.baris.aktemur@intel.com \
    --cc=gdb-patches@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).