From 1547904b69dbdbc146f11c1edb15729c8f0c9edf Mon Sep 17 00:00:00 2001 From: Adam Green Date: Thu, 21 Feb 2013 14:57:13 -0800 Subject: [PATCH] Add freespace GDB command to .gdbinit This just reports how much space there is currently unused between the top of the heap and the top of the stack. --- .gdbinit | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.gdbinit b/.gdbinit index 12bb52dff3..913e782eb1 100644 --- a/.gdbinit +++ b/.gdbinit @@ -57,6 +57,19 @@ end +define freespace + printf "free space: %d bytes\n", (unsigned int)$sp - '_sbrk::heap' +end + +document freespace +Displays the free space. + +This is the amount of space between the heap and stack that is currently +unused. +end + + + define maxstacksize set var $fill_curr=(unsigned int*)'_sbrk::heap' while ($fill_curr < $sp && *$fill_curr == 0xdeadbeef)