@item show debug target
Displays the current state of displaying @value{GDBN} target debugging
info.
+@item set debug timestamp
+@cindex timestampping debugging info
+Turns on or off display of timestamps with @value{GDBN} debugging info.
+When enabled, seconds and microseconds are displayed before each debugging
+message.
+@item show debug timestamp
+Displays the current state of displaying timestamps with @value{GDBN}
+debugging info.
@item set debugvarobj
@cindex variable object debugging info
Turns on or off display of @value{GDBN} variable object debugging
#include "readline/readline.h"
+#include <sys/time.h>
+#include <time.h>
+
#if !HAVE_DECL_MALLOC
extern PTR malloc (); /* OK: PTR */
#endif
static void set_screen_size (void);
static void set_width (void);
+/* A flag indicating whether to timestamp debugging messages. */
+
+static int debug_timestamp = 0;
+
/* Chain of cleanup actions established with make_cleanup,
to be executed if an error happens. */
linebuffer = xstrvprintf (format, args);
old_cleanups = make_cleanup (xfree, linebuffer);
+ if (debug_timestamp && stream == gdb_stdlog)
+ {
+ struct timeval tm;
+ char *timestamp;
+
+ gettimeofday (&tm, NULL);
+ timestamp = xstrprintf ("%ld:%ld ", (long) tm.tv_sec, (long) tm.tv_usec);
+ make_cleanup (xfree, timestamp);
+ fputs_unfiltered (timestamp, stream);
+ }
fputs_unfiltered (linebuffer, stream);
do_cleanups (old_cleanups);
}
{
pagination_enabled = 0;
}
+
+static void
+show_debug_timestamp (struct ui_file *file, int from_tty,
+ struct cmd_list_element *c, const char *value)
+{
+ fprintf_filtered (file, _("Timestamping debugging messages is %s.\n"), value);
+}
\f
void
NULL,
show_asm_demangle,
&setprintlist, &showprintlist);
+
+ add_setshow_boolean_cmd ("timestamp", class_maintenance,
+ &debug_timestamp, _("\
+Set timestamping of debugging messages."), _("\
+Show timestamping of debugging messages."), _("\
+When set, debugging messages will be marked with seconds and microseconds."),
+ NULL,
+ show_debug_timestamp,
+ &setdebuglist, &showdebuglist);
}
/* Machine specific function to handle SIGWINCH signal. */