* top.c (command_loop): For space usage display, show both

absolute size and the change from before command execution.
This commit is contained in:
Stan Shebs 1994-12-16 01:19:40 +00:00
parent 86db943ceb
commit 83ebf43970
2 changed files with 31 additions and 13 deletions

View File

@ -1,16 +1,21 @@
Thu Dec 15 16:55:35 1994 Stan Shebs <shebs@andros.cygnus.com>
* top.c (command_loop): For space usage display, show both
absolute size and the change from before command execution.
Thu Dec 15 16:40:10 1994 Stu Grossman (grossman@cygnus.com)
* defs.h, gdbtk.c (gdbtk_fputs), main.c (gdb_fputs), top.c: Add stream arg
to fputs_unfiltered_hook. Differentiate stdout from stderr when
passing text into tcl land.
* defs.h, top.c, utils.c (error): Add error_hook.
* gdbtk.c: Improve mechanism for capturing output values.
* (full_filename): Remove.
* (gdb_cmd call_wrapper gdbtk_init): Protect all calls from tcl
land with call_wrapper. This prevents longjmps (usually via
error()) from jumping out of tcl/tk and leaving things in an
indeterminate state.
* gdbtk.tcl: New view option to disable line numbers. Put catch
* defs.h, gdbtk.c (gdbtk_fputs), main.c (gdb_fputs), top.c: Add
stream arg to fputs_unfiltered_hook. Differentiate stdout from
stderr when passing text into tcl land.
* defs.h, top.c, utils.c (error): Add error_hook.
* gdbtk.c: Improve mechanism for capturing output values.
(full_filename): Remove.
(gdb_cmd call_wrapper gdbtk_init): Protect all calls from tcl land
with call_wrapper. This prevents longjmps (usually via error())
from jumping out of tcl/tk and leaving things in an indeterminate
state.
* gdbtk.tcl: New view option to disable line numbers. Put catch
around most uses of gdb_cmd. Add update button to reg config
window. Stop doing immediate updates when selecting registers.
Change register view values into checkbuttons.

View File

@ -932,6 +932,7 @@ command_loop ()
char *command;
int stdin_is_tty = ISATTY (stdin);
long time_at_cmd_start;
long space_at_cmd_start;
extern int display_time;
extern int display_space;
@ -951,6 +952,14 @@ command_loop ()
time_at_cmd_start = get_run_time ();
if (display_space)
{
extern char **environ;
char *lim = (char *) sbrk (0);
space_at_cmd_start = (long) (lim - (char *) &environ);
}
execute_command (command, instream == stdin);
/* Do any commands attached to breakpoint we stopped at. */
bpstat_do_actions (&stop_bpstat);
@ -968,9 +977,13 @@ command_loop ()
{
extern char **environ;
char *lim = (char *) sbrk (0);
long space_now = lim - (char *) &environ;
long space_diff = space_now - space_at_cmd_start;
printf_unfiltered ("Post-command data size: %ld\n",
(long) (lim - (char *) &environ));
printf_unfiltered ("Space used: %ld (%c%ld for this command)\n",
space_now,
(space_diff >= 0 ? '+' : '-'),
space_diff);
}
}
}