Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Mike Frysinger via Gdb-patches <gdb-patches@sourceware.org>
To: gdb-patches@sourceware.org
Subject: [PATCH 1/3] sim: callback: drop unused printf helpers
Date: Sun, 27 Jun 2021 23:24:37 -0400	[thread overview]
Message-ID: <20210628032439.14514-1-vapier@gentoo.org> (raw)

These cover functions aren't used anywhere, so drop them.  There was
one caller, but it's old DOS code that most likely hasn't been tested
in years, so just delete that too.
---
 sim/common/callback.c  | 61 ++----------------------------------------
 sim/common/sim-utils.h |  7 -----
 2 files changed, 2 insertions(+), 66 deletions(-)

diff --git a/sim/common/callback.c b/sim/common/callback.c
index c0ace6e4c8e5..f773de1c19f0 100644
--- a/sim/common/callback.c
+++ b/sim/common/callback.c
@@ -49,12 +49,6 @@
 #define PIPE_BUF 512
 #endif
 
-/* ??? sim_cb_printf should be cb_printf, but until the callback support is
-   broken out of the simulator directory, these are here to not require
-   sim-utils.h.  */
-void sim_cb_printf (host_callback *, const char *, ...);
-void sim_cb_eprintf (host_callback *, const char *, ...);
-
 extern CB_TARGET_DEFS_MAP cb_init_syscall_map[];
 extern CB_TARGET_DEFS_MAP cb_init_errno_map[];
 extern CB_TARGET_DEFS_MAP cb_init_signal_map[];
@@ -148,43 +142,21 @@ os_close (host_callback *p, int fd)
 /* taken from gdb/util.c:notice_quit() - should be in a library */
 
 
-#if defined(__GO32__) || defined (_MSC_VER)
+#if defined(_MSC_VER)
 static int
 os_poll_quit (host_callback *p)
 {
-#if defined(__GO32__)
-  int kbhit ();
-  int getkey ();
-  if (kbhit ())
-    {
-      int k = getkey ();
-      if (k == 1)
-	{
-	  return 1;
-	}
-      else if (k == 2)
-	{
-	  return 1;
-	}
-      else
-	{
-	  sim_cb_eprintf (p, "CTRL-A to quit, CTRL-B to quit harder\n");
-	}
-    }
-#endif
-#if defined (_MSC_VER)
   /* NB - this will not compile! */
   int k = win32pollquit ();
   if (k == 1)
     return 1;
   else if (k == 2)
     return 1;
-#endif
   return 0;
 }
 #else
 #define os_poll_quit 0
-#endif /* defined(__GO32__) || defined(_MSC_VER) */
+#endif /* defined(_MSC_VER) */
 
 static int
 os_get_errno (host_callback *p)
@@ -1078,35 +1050,6 @@ cb_host_to_target_stat (host_callback *cb, const struct stat *hs, void *ts)
   return p - (char *) ts;
 }
 \f
-/* Cover functions to the vfprintf callbacks.
-
-   ??? If one thinks of the callbacks as a subsystem onto itself [or part of
-   a larger "remote target subsystem"] with a well defined interface, then
-   one would think that the subsystem would provide these.  However, until
-   one is allowed to create such a subsystem (with its own source tree
-   independent of any particular user), such a critter can't exist.  Thus
-   these functions are here for the time being.  */
-
-void
-sim_cb_printf (host_callback *p, const char *fmt, ...)
-{
-  va_list ap;
-
-  va_start (ap, fmt);
-  p->vprintf_filtered (p, fmt, ap);
-  va_end (ap);
-}
-
-void
-sim_cb_eprintf (host_callback *p, const char *fmt, ...)
-{
-  va_list ap;
-
-  va_start (ap, fmt);
-  p->evprintf_filtered (p, fmt, ap);
-  va_end (ap);
-}
-
 int
 cb_is_stdin (host_callback *cb, int fd)
 {
diff --git a/sim/common/sim-utils.h b/sim/common/sim-utils.h
index bfc8ac72d08e..1af4ea206b82 100644
--- a/sim/common/sim-utils.h
+++ b/sim/common/sim-utils.h
@@ -73,13 +73,6 @@ void sim_do_commandf (SIM_DESC sd, const char *fmt, ...)
     ATTRIBUTE_PRINTF (2, 3);
 
 
-/* These are defined in callback.c as cover functions to the vprintf
-   callbacks.  */
-
-void sim_cb_printf (host_callback *, const char *, ...);
-void sim_cb_eprintf (host_callback *, const char *, ...);
-
-
 /* sim-basics.h defines a number of enumerations, convert each of them
    to a string representation */
 const char *map_to_str (unsigned map);
-- 
2.31.1


             reply	other threads:[~2021-06-28  3:25 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-28  3:24 Mike Frysinger via Gdb-patches [this message]
2021-06-28  3:24 ` [PATCH 2/3] sim: callback: add printf attributes Mike Frysinger via Gdb-patches
2021-06-29  7:01   ` Aktemur, Tankut Baris via Gdb-patches
2021-06-29 14:32     ` Mike Frysinger via Gdb-patches
2021-06-29 16:03       ` Aktemur, Tankut Baris via Gdb-patches
2021-06-29 20:35         ` Mike Frysinger via Gdb-patches
2021-07-02  0:34         ` Mike Frysinger via Gdb-patches
2021-07-02  7:16           ` Aktemur, Tankut Baris via Gdb-patches
2021-06-30  2:33     ` [PATCH] sim: ppc: fix printf warnings Mike Frysinger via Gdb-patches
2021-06-28  3:24 ` [PATCH 3/3] sim: io: add printf attributes to vprintf funcs too Mike Frysinger via Gdb-patches

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=20210628032439.14514-1-vapier@gentoo.org \
    --to=gdb-patches@sourceware.org \
    --cc=vapier@gentoo.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