+2014-01-27 Mark Wielaard <mjw@redhat.com>
+
+ * stack.c (maxframes): Initialize to 256.
+ (main): Document new default in options. Document magic number
+ used in frames.allocated initialization.
+
2014-01-20 Mark Wielaard <mjw@redhat.com>
* stack.c (show_debugname): New static boolean.
static bool show_modules = false;
static bool show_debugname = false;
-static int maxframes = 2048;
+static int maxframes = 256;
struct frame
{
{ NULL, '1', NULL, 0,
N_("Show the backtrace of only one thread"), 0 },
{ NULL, 'n', "MAXFRAMES", 0,
- N_("Show at most MAXFRAMES per thread (default 2048, use 0 for unlimited)"), 0 },
+ N_("Show at most MAXFRAMES per thread (default 256, use 0 for unlimited)"), 0 },
{ "list-modules", 'l', NULL, 0,
N_("Show module memory map with build-id, elf and debug files detected"), 0 },
{ NULL, 0, NULL, 0, NULL, 0 }
}
struct frames frames;
+ /* When maxframes is zero, then 2048 is just the initial allocation
+ that will be increased using realloc in framecallback (). */
frames.allocated = maxframes == 0 ? 2048 : maxframes;
frames.frames = 0;
frames.frame = malloc (sizeof (struct frame) * frames.allocated);