* [RFC] testing specifically for process record
@ 2009-10-20 0:21 Michael Snyder
2009-10-22 19:45 ` Michael Snyder
0 siblings, 1 reply; 6+ messages in thread
From: Michael Snyder @ 2009-10-20 0:21 UTC (permalink / raw)
To: gdb-patches, Hui Zhu
[-- Attachment #1: Type: text/plain, Size: 754 bytes --]
There are a number of commands specific to process record,
as opposed to reverse debugging, which we don't have tests
for yet. For instance,
set/show insn-number-max
set/show stop-at-limit
info record
record delete
record stop
Plus, there is the behavior of the execution log that should
be tested under various combinations of those settings.
Here is an attempt that I've started on. I'd appreciate any
suggestions, especially with respect to other tests that you
think should be added. The more things we test, the more
corner cases we can find and fix. (there are a couple of
failures already in there due to corner cases and spellings).
And Hui -- I'd be delighted if you would take over the
ownership of this test! ;-)
Michael
[-- Attachment #2: precord.c --]
[-- Type: text/x-csrc, Size: 894 bytes --]
/* This testcase is part of GDB, the GNU debugger.
Copyright 2009 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/>. */
main()
{
unsigned long long foo = 0;
do {
foo++;
} while (foo);/* Loop for a very long time. */
return foo; /* Should be zero. */
}
[-- Attachment #3: precord.exp --]
[-- Type: text/plain, Size: 4106 bytes --]
# Copyright 2009 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/>. */
# This file is part of the GDB testsuite.
# Test precord commands.
set testfile "precord"
set srcfile ${testfile}.c
if { [prepare_for_testing $testfile.exp $testfile $srcfile] } {
return -1
}
#
# Test "show record insn-number-max"
#
gdb_test "show record insn-number-max" \
"Record/replay buffer limit is .*" "Show record insn-number-max"
gdb_test "set record insn-number-max 0" \
"" "Set insn-number-max to unlimited"
gdb_test "show record insn-number-max" \
"Record/replay buffer limit is unlimited\." \
"Show insn-number-max unlimited"
gdb_test "set record insn-number-max 100000" \
"" "Set insn-number-max to 100000"
gdb_test "show record insn-number-max" \
"Record/replay buffer limit is 100000\." "Show insn-number-max 100000"
#
# Test "show record stop-at-limit"
#
gdb_test "show record stop-at-limit" \
"Whether record/replay stops when record/replay buffer becomes full is.*" \
"Show record stop-at-limit"
set main_location [gdb_get_line_number "break in main"]
runto main
gdb_test "record" "" "Turn on process record"
# FIXME: command ought to acknowledge, so we can test if it succeeded.
#
# Test "Do you want to auto delete previous execution log entries"
#
gdb_test "continue" "" "Continue until buffer full" \
"Do you want to auto delete .* or n. " \
"n"
gdb_test "info record" "Log contains 100000 instructions.*" \
"verify buffer is full"
gdb_test "set record insn-number-max 200000" \
"" "increase insn-number-max to 200000"
gdb_test "continue" "" "Continue until buffer full again" \
"Do you want to auto delete .* or n. " \
"n"
gdb_test "info record" "Log contains 200000 instructions.*" \
"verify buffer full again"
gdb_test "set record insn-number-max 100000" \
"" \
"decrease insn-number-max to 100000"
gdb_test "set record stop-at-limit off" "" "set stop-at-limit off"
gdb_test "info record" "Log contains 100000 instructions.*" \
"info record before stepi"
gdb_test "stepi"
gdb_test "info record" "Log contains 100000 instructions.*" \
"info record after stepi"
gdb_test "set record insn-number-max 200000" \
"" "Increase insn-number-max again"
gdb_test "reverse-continue" "No more reverse-execution history.*" \
"reverse-continue to start of log"
gdb_test "info record" "Current instruction number is 0\..*" \
"verify back at beginning of log"
gdb_test "continue" "No more reverse-execution history.*" \
"continue to end of log"
gdb_test "info record" \
"Lowest recorded .*\[\r\n\]+Highest recorded .* 200000\..*" \
"info record at end of log"
gdb_test "stepi" "" "stepi past end of log in record mode"
gdb_test "info record" \
"Lowest recorded .*\[\r\n\]+Highest recorded .* 200001\..*" \
"info record past end of log"
gdb_test "reverse-stepi 50000" "" "Back up 50000 instructions"
gdb_test "info record" \
"Current instruction number is 150001\..*" \
"info record in middle of execution log"
gdb_test "record delete" "" "record delete test" \
"Delete the log from this point forward .*..y or n. " "yes"
gdb_test "info record" "Log contains 50000 instructions\..*" \
"info record after delete"
gdb_test "record stop" \
"Process record is stopped and all execution logs are deleted." \
"record stop"
gdb_test "info record" "Process record is not running.*" \
"info record after stop"
gdb_test "frame" "" ""
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [RFC] testing specifically for process record
2009-10-20 0:21 [RFC] testing specifically for process record Michael Snyder
@ 2009-10-22 19:45 ` Michael Snyder
2009-10-22 20:17 ` Pedro Alves
2009-10-26 8:36 ` Hui Zhu
0 siblings, 2 replies; 6+ messages in thread
From: Michael Snyder @ 2009-10-22 19:45 UTC (permalink / raw)
To: Michael Snyder; +Cc: gdb-patches, Hui Zhu
[-- Attachment #1: Type: text/plain, Size: 829 bytes --]
Michael Snyder wrote:
> There are a number of commands specific to process record,
> as opposed to reverse debugging, which we don't have tests
> for yet. For instance,
>
> set/show insn-number-max
> set/show stop-at-limit
> info record
> record delete
> record stop
>
> Plus, there is the behavior of the execution log that should
> be tested under various combinations of those settings.
>
> Here is an attempt that I've started on. I'd appreciate any
> suggestions, especially with respect to other tests that you
> think should be added. The more things we test, the more
> corner cases we can find and fix. (there are a couple of
> failures already in there due to corner cases and spellings).
>
> And Hui -- I'd be delighted if you would take over the
> ownership of this test! ;-)
Updated versions.
[-- Attachment #2: precord.c --]
[-- Type: text/x-csrc, Size: 894 bytes --]
/* This testcase is part of GDB, the GNU debugger.
Copyright 2009 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/>. */
main()
{
unsigned long long foo = 0;
do {
foo++;
} while (foo);/* Loop for a very long time. */
return foo; /* Should be zero. */
}
[-- Attachment #3: precord.exp --]
[-- Type: text/plain, Size: 4145 bytes --]
# Copyright 2009 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/>. */
# This file is part of the GDB testsuite.
# Test precord commands.
set testfile "precord"
set srcfile ${testfile}.c
if { [prepare_for_testing $testfile.exp $testfile $srcfile] } {
return -1
}
#
# Test "show record insn-number-max"
#
gdb_test "show record insn-number-max" \
"Record/replay buffer limit is .*" "Show record insn-number-max"
gdb_test "set record insn-number-max 0" \
"" "Set insn-number-max to unlimited"
gdb_test "show record insn-number-max" \
"Record/replay buffer limit is unlimited\." \
"Show insn-number-max unlimited"
gdb_test "set record insn-number-max 100000" \
"" "Set insn-number-max to 100000"
gdb_test "show record insn-number-max" \
"Record/replay buffer limit is 100000\." "Show insn-number-max 100000"
#
# Test "show record stop-at-limit"
#
gdb_test "show record stop-at-limit" \
"Whether record/replay stops when record/replay buffer becomes full is.*" \
"Show record stop-at-limit"
set main_location [gdb_get_line_number "break in main"]
runto main
gdb_test "record" "" "Turn on process record"
# FIXME: command ought to acknowledge, so we can test if it succeeded.
#
# Test "Do you want to auto delete previous execution log entries"
#
gdb_test "continue" "" "Continue until buffer full" \
"Do you want to auto delete .* or n. " \
"n"
gdb_test "info record" "Log contains 100000 instructions.*" \
"verify buffer is full"
gdb_test "set record insn-number-max 200000" \
"" "increase insn-number-max to 200000"
gdb_test "continue" "" "Continue until buffer full again" \
"Do you want to auto delete .* or n. " \
"n"
gdb_test "info record" "Log contains 200000 instructions.*" \
"verify buffer full again"
gdb_test "set record insn-number-max 100000" \
"" \
"decrease insn-number-max to 100000"
gdb_test "set record stop-at-limit off" "" "set stop-at-limit off"
gdb_test "info record" "Log contains 100000 instructions.*" \
"info record before stepi"
gdb_test "stepi"
gdb_test "info record" "Log contains 100000 instructions.*" \
"info record after stepi"
gdb_test "set record insn-number-max 200000" \
"" "Increase insn-number-max again"
gdb_test "reverse-continue" "No more reverse-execution history.*" \
"reverse-continue to start of log"
gdb_test "info record" "Current instruction number is 0\..*" \
"verify back at beginning of log"
gdb_test "continue" "No more reverse-execution history.*" \
"continue to end of log"
gdb_test "info record" \
"Lowest recorded .*\[\r\n\]+Highest recorded .* 200000\..*" \
"info record at end of log"
gdb_test "stepi" "" "stepi past end of log in record mode"
gdb_test "info record" \
"Lowest recorded .*\[\r\n\]+Highest recorded .* 200002\..*" \
"info record past end of log"
gdb_test "reverse-stepi 50000" "" "Back up 50000 instructions"
gdb_test "info record" \
"Current instruction number is 150002\..*" \
"info record in middle of execution log"
gdb_test "record delete" "" "record delete test" \
"Delete the log from this point forward .*..y or n. " "yes"
gdb_test "info record" \
"Highest recorded .* is 150002.*Log contains 50001 instructions.*" \
"info record after delete"
gdb_test "record stop" \
"Process record is stopped and all execution logs are deleted." \
"record stop"
gdb_test "info record" \
"target record is not active.*" \
"info record after stop"
gdb_test "frame" "" ""
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [RFC] testing specifically for process record
2009-10-22 19:45 ` Michael Snyder
@ 2009-10-22 20:17 ` Pedro Alves
2009-10-22 20:24 ` Michael Snyder
2009-10-26 8:36 ` Hui Zhu
1 sibling, 1 reply; 6+ messages in thread
From: Pedro Alves @ 2009-10-22 20:17 UTC (permalink / raw)
To: gdb-patches; +Cc: Michael Snyder, Hui Zhu
On Thursday 22 October 2009 20:38:37, Michael Snyder wrote:
> gdb_test "record" "" "Turn on process record"
> # FIXME: command ought to acknowledge, so we can test if it succeeded.
This can now be switched to gdb_test_multiple, assuming success
iff the command was silent, and then followed by "info record"
reporting that recording is in effect. Of course, all
that done in a neat reusable function in lib/gdb.exp. Any
takers? :-)
--
Pedro Alves
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [RFC] testing specifically for process record
2009-10-22 20:17 ` Pedro Alves
@ 2009-10-22 20:24 ` Michael Snyder
2009-10-22 22:29 ` Pedro Alves
0 siblings, 1 reply; 6+ messages in thread
From: Michael Snyder @ 2009-10-22 20:24 UTC (permalink / raw)
To: Pedro Alves; +Cc: gdb-patches, Hui Zhu
Pedro Alves wrote:
> On Thursday 22 October 2009 20:38:37, Michael Snyder wrote:
>> gdb_test "record" "" "Turn on process record"
>> # FIXME: command ought to acknowledge, so we can test if it succeeded.
>
> This can now be switched to gdb_test_multiple, assuming success
> iff the command was silent, and then followed by "info record"
> reporting that recording is in effect. Of course, all
> that done in a neat reusable function in lib/gdb.exp. Any
> takers? :-)
>
Hmm, that's good... unfortunately "record" will succeed even
for a remote target, so it doesn't help me with the larger
problem of detecting remote vs. native. We want to avoid using
the process-record commands if we're remote (eg. Simics).
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [RFC] testing specifically for process record
2009-10-22 20:24 ` Michael Snyder
@ 2009-10-22 22:29 ` Pedro Alves
0 siblings, 0 replies; 6+ messages in thread
From: Pedro Alves @ 2009-10-22 22:29 UTC (permalink / raw)
To: Michael Snyder; +Cc: gdb-patches, Hui Zhu
On Thursday 22 October 2009 21:18:08, Michael Snyder wrote:
> Pedro Alves wrote:
> > On Thursday 22 October 2009 20:38:37, Michael Snyder wrote:
> >> gdb_test "record" "" "Turn on process record"
> >> # FIXME: command ought to acknowledge, so we can test if it succeeded.
> >
> > This can now be switched to gdb_test_multiple, assuming success
> > iff the command was silent, and then followed by "info record"
> > reporting that recording is in effect. Of course, all
> > that done in a neat reusable function in lib/gdb.exp. Any
> > takers? :-)
> >
>
> Hmm, that's good... unfortunately "record" will succeed even
> for a remote target, so it doesn't help me with the larger
> problem of detecting remote vs. native. We want to avoid using
> the process-record commands if we're remote (eg. Simics).
My remark was directed at the FIXME quoted above only.
--
Pedro Alves
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [RFC] testing specifically for process record
2009-10-22 19:45 ` Michael Snyder
2009-10-22 20:17 ` Pedro Alves
@ 2009-10-26 8:36 ` Hui Zhu
1 sibling, 0 replies; 6+ messages in thread
From: Hui Zhu @ 2009-10-26 8:36 UTC (permalink / raw)
To: Michael Snyder; +Cc: gdb-patches
Thanks for your test, Michael.
I try it in i386 ubuntu.
=== gdb tests ===
Schedule of variations:
precord
Running target precord
Using /usr/share/dejagnu/baseboards/precord.exp as board description
file for target.
Using /usr/share/dejagnu/baseboards/unix.exp as board description file
for target.
Using /usr/share/dejagnu/config/unix.exp as generic interface file for target.
Using ../src/gdb/testsuite/config/unix.exp as tool-and-target-specific
interface file.
Running ../src/gdb/testsuite/gdb.reverse/precord.exp ...
=== gdb Summary ===
# of expected passes 30
/usr/local/bin/gdb version 7.0.50.20091026-cvs -nw -nx
I am OK with it.
Thanks,
hui
On Fri, Oct 23, 2009 at 03:38, Michael Snyder <msnyder@vmware.com> wrote:
> Michael Snyder wrote:
>>
>> There are a number of commands specific to process record,
>> as opposed to reverse debugging, which we don't have tests
>> for yet. For instance,
>>
>> set/show insn-number-max
>> set/show stop-at-limit
>> info record
>> record delete
>> record stop
>>
>> Plus, there is the behavior of the execution log that should
>> be tested under various combinations of those settings.
>>
>> Here is an attempt that I've started on. I'd appreciate any
>> suggestions, especially with respect to other tests that you
>> think should be added. The more things we test, the more
>> corner cases we can find and fix. (there are a couple of
>> failures already in there due to corner cases and spellings).
>>
>> And Hui -- I'd be delighted if you would take over the
>> ownership of this test! ;-)
>
> Updated versions.
>
>
>
> # Copyright 2009 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/>. */
>
> # This file is part of the GDB testsuite.
>
> # Test precord commands.
>
> set testfile "precord"
> set srcfile ${testfile}.c
>
> if { [prepare_for_testing $testfile.exp $testfile $srcfile] } {
> return -1
> }
>
> #
> # Test "show record insn-number-max"
> #
>
> gdb_test "show record insn-number-max" \
> "Record/replay buffer limit is .*" "Show record insn-number-max"
>
> gdb_test "set record insn-number-max 0" \
> "" "Set insn-number-max to unlimited"
>
> gdb_test "show record insn-number-max" \
> "Record/replay buffer limit is unlimited\." \
> "Show insn-number-max unlimited"
>
> gdb_test "set record insn-number-max 100000" \
> "" "Set insn-number-max to 100000"
>
> gdb_test "show record insn-number-max" \
> "Record/replay buffer limit is 100000\." "Show insn-number-max 100000"
>
> #
> # Test "show record stop-at-limit"
> #
>
> gdb_test "show record stop-at-limit" \
> "Whether record/replay stops when record/replay buffer becomes full is.*"
> \
> "Show record stop-at-limit"
>
>
> set main_location [gdb_get_line_number "break in main"]
>
> runto main
>
> gdb_test "record" "" "Turn on process record"
> # FIXME: command ought to acknowledge, so we can test if it succeeded.
>
> #
> # Test "Do you want to auto delete previous execution log entries"
> #
>
> gdb_test "continue" "" "Continue until buffer full" \
> "Do you want to auto delete .* or n. " \
> "n"
>
> gdb_test "info record" "Log contains 100000 instructions.*" \
> "verify buffer is full"
>
> gdb_test "set record insn-number-max 200000" \
> "" "increase insn-number-max to 200000"
>
> gdb_test "continue" "" "Continue until buffer full again" \
> "Do you want to auto delete .* or n. " \
> "n"
>
> gdb_test "info record" "Log contains 200000 instructions.*" \
> "verify buffer full again"
>
> gdb_test "set record insn-number-max 100000" \
> "" \
> "decrease insn-number-max to 100000"
>
> gdb_test "set record stop-at-limit off" "" "set stop-at-limit off"
>
> gdb_test "info record" "Log contains 100000 instructions.*" \
> "info record before stepi"
>
> gdb_test "stepi"
>
> gdb_test "info record" "Log contains 100000 instructions.*" \
> "info record after stepi"
>
> gdb_test "set record insn-number-max 200000" \
> "" "Increase insn-number-max again"
>
> gdb_test "reverse-continue" "No more reverse-execution history.*" \
> "reverse-continue to start of log"
>
> gdb_test "info record" "Current instruction number is 0\..*" \
> "verify back at beginning of log"
>
> gdb_test "continue" "No more reverse-execution history.*" \
> "continue to end of log"
>
> gdb_test "info record" \
> "Lowest recorded .*\[\r\n\]+Highest recorded .* 200000\..*" \
> "info record at end of log"
>
> gdb_test "stepi" "" "stepi past end of log in record mode"
>
> gdb_test "info record" \
> "Lowest recorded .*\[\r\n\]+Highest recorded .* 200002\..*" \
> "info record past end of log"
>
> gdb_test "reverse-stepi 50000" "" "Back up 50000 instructions"
>
> gdb_test "info record" \
> "Current instruction number is 150002\..*" \
> "info record in middle of execution log"
>
> gdb_test "record delete" "" "record delete test" \
> "Delete the log from this point forward .*..y or n. " "yes"
>
> gdb_test "info record" \
> "Highest recorded .* is 150002.*Log contains 50001 instructions.*" \
> "info record after delete"
>
> gdb_test "record stop" \
> "Process record is stopped and all execution logs are deleted." \
> "record stop"
>
> gdb_test "info record" \
> "target record is not active.*" \
> "info record after stop"
>
> gdb_test "frame" "" ""
>
>
>
>
>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2009-10-26 8:36 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-10-20 0:21 [RFC] testing specifically for process record Michael Snyder
2009-10-22 19:45 ` Michael Snyder
2009-10-22 20:17 ` Pedro Alves
2009-10-22 20:24 ` Michael Snyder
2009-10-22 22:29 ` Pedro Alves
2009-10-26 8:36 ` Hui Zhu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox