From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5265 invoked by alias); 3 May 2008 16:42:16 -0000 Received: (qmail 5256 invoked by uid 22791); 3 May 2008 16:42:15 -0000 X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sat, 03 May 2008 16:41:58 +0000 Received: (qmail 31654 invoked from network); 3 May 2008 16:15:14 -0000 Received: from unknown (HELO localhost) (vladimir@127.0.0.2) by mail.codesourcery.com with ESMTPA; 3 May 2008 16:15:14 -0000 From: Vladimir Prus To: Daniel Jacobowitz Subject: Re: [RFA] Remove command_line_handler_continuation. Date: Sat, 03 May 2008 18:06:00 -0000 User-Agent: KMail/1.9.6 (enterprise 0.20070907.709405) Cc: Eli Zaretskii , gdb-patches@sources.redhat.com References: <200804242033.40568.vladimir@codesourcery.com> <20080502150314.GL29202@caradoc.them.org> <200805031958.39818.vladimir@codesourcery.com> In-Reply-To: <200805031958.39818.vladimir@codesourcery.com> MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_P+IHIUpU+c9KdLG" Message-Id: <200805032015.11540.vladimir@codesourcery.com> Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-05/txt/msg00133.txt.bz2 --Boundary-00=_P+IHIUpU+c9KdLG Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Content-length: 839 On Saturday 03 May 2008 19:58:36 Vladimir Prus wrote: > On Friday 02 May 2008 19:03:14 Daniel Jacobowitz wrote: > > On Thu, Apr 24, 2008 at 07:33:40PM +0300, Vladimir Prus wrote: > > > > > > 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? > > > > OK once you and Eli agree about documenting the timings. > > Here's a revision with doc clarification. Eli, does it look sufficient? And here's the patch, for real. - Volodya --Boundary-00=_P+IHIUpU+c9KdLG Content-Type: text/x-diff; charset="iso-8859-1"; name="0001-Remove-command_line_handler_continuation.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="0001-Remove-command_line_handler_continuation.patch" Content-length: 3674 =46rom a0ac4ea192e90df539fa167c1310f3f1a8184c02 Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Thu, 13 Mar 2008 12:18:12 +0300 Subject: [RFA] Remove command_line_handler_continuation. To: gdb-patches@sources.redhat.com X-KMail-Transport: CodeSourcery X-KMail-Identity: 901867920 [gdb] * top.c (command_line_handler_continuation): Remove. (execute_command): Do not install the above. [gdb/doc] * gdb.texinfo (Maintenance Commands): Clarify that "maint time" will not report the time of commands that run the target. --- gdb/doc/gdb.texinfo | 4 +++ gdb/top.c | 55 -----------------------------------------------= ---- 2 files changed, 4 insertions(+), 55 deletions(-) diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index 636a84b..45a7412 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -23437,6 +23437,10 @@ switch (@pxref{Mode Options}). Control whether to display the execution time for each command. If set to a nonzero value, @value{GDBN} will display how much time it took to execute each command, following the command's own output. +The time is not printed for the commands that run the target, since +there's no mechanism currently to compute how much time was spend +by @value{GDBN} and how much time was spend by the program been debugged. +it's not possibly currently=20 This can also be requested by invoking @value{GDBN} with the @option{--statistics} command-line switch (@pxref{Mode Options}). =20 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 =20 -/* 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 =3D arg->data.longint; - long space_at_cmd_start =3D arg->next->data.longint; - - if (error) - return; - - if (display_time) - { - long cmd_time =3D 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 =3D (char *) sbrk (0); - long space_now =3D lim - lim_at_start; - long space_diff =3D space_now - space_at_cmd_start; - - printf_unfiltered (_("Space used: %ld (%c%ld for this command)\n"), - space_now, - (space_diff >=3D 0 ? '+' : '-'), - space_diff); -#endif - } -} - /* Execute the line P as a command. Pass FROM_TTY as second argument to the defining function. */ =20 @@ -534,24 +497,6 @@ execute_command (char *p, int from_tty) warned =3D 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 =3D - (struct continuation_arg *) xmalloc (sizeof (struct continuation_arg)); - arg2 =3D - (struct continuation_arg *) xmalloc (sizeof (struct continuation_arg)); - arg1->next =3D arg2; - arg2->next =3D NULL;=20=20=20=20=20 - arg1->data.longint =3D time_at_cmd_start; -#ifdef HAVE_SBRK - arg2->data.longint =3D space_at_cmd_start; -#endif - add_continuation (command_line_handler_continuation, arg1); - } } =20 /* Read commands from `instream' and execute them --=20 1.5.3.5 --Boundary-00=_P+IHIUpU+c9KdLG--