aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.base/timestamp.exp
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2022-12-27 16:34:44 -0700
committerTom Tromey <tom@tromey.com>2022-12-28 08:55:40 -0700
commita60535c39ba52d88c47740db6ab116db32e2331a (patch)
tree4eb843517714633ee45e0b39bba8ee596efa06be /gdb/testsuite/gdb.base/timestamp.exp
parent47ecb26f71563b119667c1289a113358f53410b0 (diff)
downloadgdb-a60535c39ba52d88c47740db6ab116db32e2331a.zip
gdb-a60535c39ba52d88c47740db6ab116db32e2331a.tar.gz
gdb-a60535c39ba52d88c47740db6ab116db32e2331a.tar.bz2
Fix "set debug timestamp"
PR cli/29945 points out that "set debug timestamp 1" stopped working -- this is a regression due to commit b8043d27 ("Remove a ui-related memory leak"). This patch fixes the bug and adds a regression test. I think this should probably be backported to the gdb 13 branch. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=29945
Diffstat (limited to 'gdb/testsuite/gdb.base/timestamp.exp')
-rw-r--r--gdb/testsuite/gdb.base/timestamp.exp24
1 files changed, 24 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.base/timestamp.exp b/gdb/testsuite/gdb.base/timestamp.exp
new file mode 100644
index 0000000..3d124b4
--- /dev/null
+++ b/gdb/testsuite/gdb.base/timestamp.exp
@@ -0,0 +1,24 @@
+# Copyright 2022 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# Test that timestamps are printed when logging.
+
+clean_restart
+
+# This is a simple way to get logging output.
+gdb_test_no_output "set debug expression 1"
+gdb_test_no_output "set debug timestamp 1"
+
+gdb_test "print 23" "\[0-9\]+\\.\[0-9\]+ Operation: OP_LONG.* = 23"