aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.reverse/time-reverse.c
diff options
context:
space:
mode:
authorTom de Vries <tdevries@suse.de>2025-01-24 16:37:36 +0100
committerTom de Vries <tdevries@suse.de>2025-01-24 16:37:36 +0100
commitda67644ef533058e68a290d232f3eb6c1580d844 (patch)
tree6eb5d89cb399c50e7af4a5dff5a66c37b2fd846c /gdb/testsuite/gdb.reverse/time-reverse.c
parentd66348e851e79424f2478f6be0fbe85e38f3287a (diff)
downloadbinutils-da67644ef533058e68a290d232f3eb6c1580d844.zip
binutils-da67644ef533058e68a290d232f3eb6c1580d844.tar.gz
binutils-da67644ef533058e68a290d232f3eb6c1580d844.tar.bz2
[gdb/testsuite] Record less in gdb.reverse/time-reverse.exp
While stepping through gdb.reverse/time-reverse.exp I realized that we're recording the instructions for resolving the PLT entries for functions time and syscall, while that's not really the focus of the test-case. Limit the scope of the test, by calling the functions once before starting to record. Also call "info record" after recording to make it clear how many instructions were recorded. On x86_64-linux, before this patch (but with info record added), we have: ... $ grep "Log contains" gdb.log Log contains 750 instructions. Log contains 1218 instructions. ... and with this patch we have: ... $ grep "Log contains" gdb.log Log contains 24 instructions. Log contains 19 instructions. ... Tested on x86_64-linux. Approved-By: Guinevere Larsen <guinevere@redhat.com>
Diffstat (limited to 'gdb/testsuite/gdb.reverse/time-reverse.c')
-rw-r--r--gdb/testsuite/gdb.reverse/time-reverse.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.reverse/time-reverse.c b/gdb/testsuite/gdb.reverse/time-reverse.c
index 8a552f8..c4ce128 100644
--- a/gdb/testsuite/gdb.reverse/time-reverse.c
+++ b/gdb/testsuite/gdb.reverse/time-reverse.c
@@ -41,8 +41,20 @@ time_t time_global = -1;
int
main (void)
{
+ /* Call once before recording to resolve the PLT, if any. This reduces the
+ amount of instructions that is recorded. */
+ my_time (&time_global);
+
+ /* Reset back to initial value. */
+ time_global = -1;
+
+ /* Start recording here. */
marker1 ();
+
my_time (&time_global);
+
+ /* Stop recording here. */
marker2 ();
+
return 0;
}