diff options
author | Stan Shebs <shebs@codesourcery.com> | 1994-12-16 01:19:40 +0000 |
---|---|---|
committer | Stan Shebs <shebs@codesourcery.com> | 1994-12-16 01:19:40 +0000 |
commit | 83ebf43970b824784eab9423529ebcdd15bc3019 (patch) | |
tree | 9b3d2902827eaf93ac83c742dc9aee0f7a7f1ce9 | |
parent | 86db943cebfc5a45476d6926bbeccbda4e69a568 (diff) | |
download | gdb-83ebf43970b824784eab9423529ebcdd15bc3019.zip gdb-83ebf43970b824784eab9423529ebcdd15bc3019.tar.gz gdb-83ebf43970b824784eab9423529ebcdd15bc3019.tar.bz2 |
* top.c (command_loop): For space usage display, show both
absolute size and the change from before command execution.
-rw-r--r-- | gdb/ChangeLog | 27 | ||||
-rw-r--r-- | gdb/top.c | 17 |
2 files changed, 31 insertions, 13 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 70c689b..31cc4c5 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -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. @@ -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); } } } |