binutils-gdb/gdb/testsuite/gdb.guile
Yao Qi 673dc4a054 Skip testing argv[0] on target argv[0] isn't available
I see the following two fails on arm-none-eabi target, because argv[0]
isn't available.

print argv[0]^M
$1 = 0x1f78 "/dev/null"^M
(gdb) FAIL: gdb.base/argv0-symlink.exp: kept file symbolic link name

print argv[0]^M
$1 = 0x1f78 "/dev/null"^M
(gdb) FAIL: gdb.base/argv0-symlink.exp: kept directory symbolic link name

My first thought is to check [target_info exists noargs], and skip the
test if it returns true.  However, noargs is set in gdbserver board
files, so argv0-symlink.exp will be skipped on gdbserver board file.
The change is too aggressive.

When the program is running with gdbserver, argv[1] to argv[N] aren't
available, but argv[0] is.  Fortunately, argv0-symlink.exp only
requires argv[0].  argv0-symlink.exp can be run with gdbserver board
file, as what we do now.

What we need to check is whether argv[0] is available, so I add a new
proc gdb_has_argv0 to do so by starting a program, and check
argc/argv[0] to see whether argv[0] is available.

Dan fixed the similar problem by checking noargs, which is too strong.
https://sourceware.org/ml/gdb-patches/2010-02/msg00398.html as a
result, the test is skipped on gdbserver.  This patch fixed it too.

gdb/testsuite:

2014-10-18  Yao Qi  <yao@codesourcery.com>

	* gdb.base/argv0-symlink.exp: Check argv[0] value if
	gdb_has_argv0 return true.
	* gdb.guile/scm-value.exp (test_value_in_inferior): Don't
	check [target_info exists noargs], check [gdb_has_argv0]
	instead.
	* gdb.python/py-value.exp (test_value_in_inferior): Likewise.
	* lib/gdb.exp (gdb_has_argv0, gdb_has_argv0_1): New
	procedures.
2014-10-18 20:58:06 +08:00
..
Makefile.in
guile.exp * gdb.guile/guile.exp (guile not supported): Verify multi-line 2014-03-22 02:57:08 -04:00
scm-arch.c
scm-arch.exp
scm-block.c
scm-block.exp
scm-breakpoint.c
scm-breakpoint.exp Fix mingw32 failures due to incorrect directory separator in pattern 2014-10-17 11:28:17 -03:00
scm-cmd.c Add command support for Guile. 2014-06-03 00:29:49 -07:00
scm-cmd.exp Fix PR gdb/17035: "show user" doesn't list user-defined commands that 2014-09-07 20:12:19 -03:00
scm-disasm.c
scm-disasm.exp Remove duplicated code on checking address 0x0 is accessiable 2014-08-09 08:46:32 +08:00
scm-equal.c
scm-equal.exp
scm-error-1.scm
scm-error-2.scm
scm-error.exp gdb.guile/scm-error.exp: Handle guile 2.2 backtrace output. 2014-09-08 22:19:32 -07:00
scm-frame-args.c * gdb.guile/scm-frame-args.c (foo): Tweak to work with gcc 4.6.3. 2014-06-06 15:41:09 -07:00
scm-frame-args.exp
scm-frame-args.scm
scm-frame-inline.c
scm-frame-inline.exp
scm-frame.c
scm-frame.exp
scm-gsmob.exp gdb smob cleanups 2014-05-26 17:34:27 -07:00
scm-iterator.c
scm-iterator.exp
scm-math.c
scm-math.exp
scm-objfile-script-gdb.in
scm-objfile-script.c
scm-objfile-script.exp
scm-objfile.c
scm-objfile.exp
scm-parameter.exp PR guile/17203 2014-07-28 19:20:30 -07:00
scm-ports.exp
scm-pretty-print.c
scm-pretty-print.exp Remove duplicated code on checking address 0x0 is accessiable 2014-08-09 08:46:32 +08:00
scm-pretty-print.scm Add progspace support for Guile. 2014-06-02 23:46:27 -07:00
scm-progspace.c Add progspace support for Guile. 2014-06-02 23:46:27 -07:00
scm-progspace.exp Add progspace support for Guile. 2014-06-02 23:46:27 -07:00
scm-section-script.c
scm-section-script.exp
scm-section-script.scm
scm-symbol.c
scm-symbol.exp
scm-symtab-2.c
scm-symtab.c
scm-symtab.exp
scm-type.c
scm-type.exp
scm-value-cc.cc
scm-value-cc.exp
scm-value.c Copy over fix for fetching dynamic type of a reference from python side. 2014-04-12 09:09:41 -07:00
scm-value.exp Skip testing argv[0] on target argv[0] isn't available 2014-10-18 20:58:06 +08:00
source2.scm
types-module.cc
types-module.exp PR guile/17146 preparatory work. 2014-07-26 17:03:04 -07:00