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 /gdb/top.c | |
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.
Diffstat (limited to 'gdb/top.c')
-rw-r--r-- | gdb/top.c | 17 |
1 files changed, 15 insertions, 2 deletions
@@ -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); } } } |