Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Vladimir Prus <vladimir@codesourcery.com>
To: gdb-patches@sources.redhat.com
Subject: [RFA] Remove command_line_handler_continuation.
Date: Thu, 24 Apr 2008 23:04:00 -0000	[thread overview]
Message-ID: <200804242033.40568.vladimir@codesourcery.com> (raw)


With my previous patch to move all bpstat_do_actions calls into
event handler, all that command_line_handler_continuation does
is to print timings, if those are enabled. However, those timings
don't make much sense. Timings are good for debugging GDB performance,
and in case of command_line_handler_continuation, the times will report
the time when the application run.

So, this patch removes that continuation. OK?

- Volodya

	* top.c (command_line_handler_continuation): Remove.
	(execute_command): Do not install the above.
---
 gdb/top.c |   55 -------------------------------------------------------
 1 files changed, 0 insertions(+), 55 deletions(-)

diff --git a/gdb/top.c b/gdb/top.c
index feefcf0..e0293df 100644
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -364,43 +364,6 @@ do_chdir_cleanup (void *old_dir)
 }
 #endif
 
-/* Do any commands attached to breakpoint we stopped at. Only if we
-   are always running synchronously. Or if we have just executed a
-   command that doesn't start the target.  */
-static void
-command_line_handler_continuation (struct continuation_arg *arg, int error)
-{
-  extern int display_time;
-  extern int display_space;
-
-  long time_at_cmd_start  = arg->data.longint;
-  long space_at_cmd_start = arg->next->data.longint;
-
-  if (error)
-    return;
-
-  if (display_time)
-    {
-      long cmd_time = get_run_time () - time_at_cmd_start;
-
-      printf_unfiltered (_("Command execution time: %ld.%06ld\n"),
-			 cmd_time / 1000000, cmd_time % 1000000);
-    }
-  if (display_space)
-    {
-#ifdef HAVE_SBRK
-      char *lim = (char *) sbrk (0);
-      long space_now = lim - lim_at_start;
-      long space_diff = space_now - space_at_cmd_start;
-
-      printf_unfiltered (_("Space used: %ld (%c%ld for this command)\n"),
-			 space_now,
-			 (space_diff >= 0 ? '+' : '-'),
-			 space_diff);
-#endif
-    }
-}
-
 /* Execute the line P as a command.
    Pass FROM_TTY as second argument to the defining function.  */
 
@@ -534,24 +497,6 @@ execute_command (char *p, int from_tty)
 	  warned = 1;
 	}
     }
-
-  /* Set things up for this function to be compete later, once the
-     execution has completed, if we are doing an execution command,
-     otherwise, just go ahead and finish. */
-  if (target_can_async_p () && target_executing)
-    {
-      arg1 =
-	(struct continuation_arg *) xmalloc (sizeof (struct continuation_arg));
-      arg2 =
-	(struct continuation_arg *) xmalloc (sizeof (struct continuation_arg));
-      arg1->next = arg2;
-      arg2->next = NULL;     
-      arg1->data.longint = time_at_cmd_start;
-#ifdef HAVE_SBRK
-      arg2->data.longint = space_at_cmd_start;
-#endif
-      add_continuation (command_line_handler_continuation, arg1);
-    }
 }
 
 /* Read commands from `instream' and execute them
-- 
1.5.3.5


             reply	other threads:[~2008-04-24 16:34 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-24 23:04 Vladimir Prus [this message]
2008-04-25  1:23 ` Eli Zaretskii
2008-04-26 13:24   ` Vladimir Prus
2008-04-26 13:41     ` Eli Zaretskii
2008-04-26 14:00       ` Vladimir Prus
2008-04-26 16:42         ` Eli Zaretskii
2008-05-02 15:18 ` Daniel Jacobowitz
2008-05-03 16:42   ` Vladimir Prus
2008-05-03 18:06     ` Vladimir Prus
2008-05-03 20:19       ` Eli Zaretskii
2008-05-03 20:28       ` Daniel Jacobowitz

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=200804242033.40568.vladimir@codesourcery.com \
    --to=vladimir@codesourcery.com \
    --cc=gdb-patches@sources.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