Don't check target_info exists noargs in commands.exp
I am confused by the noargs checking at each proc in commands.exp,
if [target_info exists noargs] {
verbose "Skipping progvar_simple_while_test because of noargs."
return
}
gdb_test_no_output "set args 5" "set args in progvar_simple_while_test"
if { ![runto factorial] } then { gdb_suppress_tests }
# Don't depend upon argument passing, since most simulators don't
# currently support it. Bash value variable to be what we want.
gdb_test "p value=5" ".*" "set value to 5 in progvar_simple_if_test #2"
They are conflicting to me. If the argument passing can't be done on
the target, we skip this test, why do we still have to set value below?
On the other hand, the test case is compiled with -DFAKEARGV, it doesn't
get anything from argv[1], why do we need to skip it if noargs is true?
I don't find any useful clues from the git log, as the code is quite
old, predating import to sourceware cvs. However, I find something
useful from the ChangeLog.
Thu Jul 20 13:28:36 1995 Jeffrey A. Law <law@rtl.cygnus.com>
.....
* gdb.base/commands.exp: Protect tests which need arguments with
$noargs conditionals.
Mon Apr 21 13:38:58 1997 Fred Fish <fnf@cygnus.com>
* gdb.base/run.c: Use FAKEARGV to build test executable that
does not require a command line arg, since most simulators
don't currently support passing such an arg into the simulated
program.
* gdb.base/commands.exp: Change tests to insert the proper
value as the arg to the first recursive factorial call. Change
compilation line to define FAKEARGV at compile time.
Jeff added noargs checking as argument is passed to the inferior. Then,
I presume Fred wanted to run this test on simulators which don't support
argument passing, and change the code not get input from argv. (I guess)
noargs wasn't set in simulator board files at that moment.
Since Fred changed test to set input by gdb, instead of getting input
from argv, the test should be able to run on target doesn't support
argument passing, such as simulator and gdbserver.
This patch is to remove these checks to noargs and "set args". I run
commands.exp with these board files, and no fail is found
- unix and native-gdbserver
- arm-none-eabi with qemu
- gdbserver on arm-linux-gnueabi with qemu
gdb/testsuite:
2014-10-17 Yao Qi <yao@codesourcery.com>
* gdb.base/commands.exp (gdbvar_complex_if_while_test): Don't check
'target_info exists noargs'.
(test_command_prompt_position): Likewise.
(progvar_simple_if_test): Don't check 'target_info exists noargs'.
Remove "set args".
(progvar_simple_while_test): Likewise.
(progvar_complex_if_while_test): Likewise.
(if_while_breakpoint_command_test): Likewise.
(infrun_breakpoint_command_test): Likewise.
(breakpoint_command_test): Likewise.
(watchpoint_command_test): Likewise.
(bp_deleted_in_command_test): Likewise.
(temporary_breakpoint_commands): Likewise.