* buildsym.c, symtab.c: Add local hack for FILENAME_CMP testing.
* utils.c (cygwin_filename_cmp): New.
Backport:
2006-04-21 Frederic Riss <frederic.riss@st.com>
* dwarf2read.c (dwarf2_start_subfile): Change prototype to accept
compilation directory as last argument.
Always pass comp_dir as second argument to start_subfile and prepend
dirname to the filename when necessary.
Remove now superfluous search for pre-existing subfile.
(dwarf_decode_lines): Pass the compilation directory to
dwarf2_start_subfile.
gdb/testsuite/
* config/symbian.exp (gdb_target_symbian): Handle a running target.
(gdb_load): Add return value.
* gdb.base/completion.exp: Test arg rather than a. Handle
very small lists of symbols.
* gdb.base/list.exp: Differentiate run behavior based on
use_gdb_stub.
* gdb.base/maint.exp: Accept local symbols. Accept missing .data.
* gdb.base/remote.exp: Update packet limits.
* gdb.base/varargs.exp: Don't pass an empty list item.
* lib/gdb.exp (fullname_syntax): Recognize forward slashes in DOS
paths.
Backport:
2006-06-22 Daniel Jacobowitz <dan@codesourcery.com>
* gdb.base/gdb1555.exp: Use gdb_compile_shlib. Skip if not
native.
2006-06-22 Daniel Jacobowitz <dan@codesourcery.com>
* gdb.stabs/exclfwd.exp: Skip the test if configure did not
enable stabs testing.
2006-05-06 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
* gdb.mi/mi-basics.exp: Add missing serial number to
expected output in some mi_gdb_test statements.
* gdb.mi/mi2-basics.exp: Likewise.
+2006-09-28 Daniel Jacobowitz <dan@codesourcery.com>
+
+ gdb/
+ * buildsym.c, symtab.c: Add local hack for FILENAME_CMP testing.
+ * utils.c (cygwin_filename_cmp): New.
+
+ Backport:
+ 2006-04-21 Frederic Riss <frederic.riss@st.com>
+ * dwarf2read.c (dwarf2_start_subfile): Change prototype to accept
+ compilation directory as last argument.
+ Always pass comp_dir as second argument to start_subfile and prepend
+ dirname to the filename when necessary.
+ Remove now superfluous search for pre-existing subfile.
+ (dwarf_decode_lines): Pass the compilation directory to
+ dwarf2_start_subfile.
+
+ gdb/testsuite/
+ * config/symbian.exp (gdb_target_symbian): Handle a running target.
+ (gdb_load): Add return value.
+
+ * gdb.base/completion.exp: Test arg rather than a. Handle
+ very small lists of symbols.
+
+ * gdb.base/list.exp: Differentiate run behavior based on
+ use_gdb_stub.
+
+ * gdb.base/maint.exp: Accept local symbols. Accept missing .data.
+
+ * gdb.base/remote.exp: Update packet limits.
+
+ * gdb.base/varargs.exp: Don't pass an empty list item.
+
+ * lib/gdb.exp (fullname_syntax): Recognize forward slashes in DOS
+ paths.
+
+ Backport:
+ 2006-06-22 Daniel Jacobowitz <dan@codesourcery.com>
+ * gdb.base/gdb1555.exp: Use gdb_compile_shlib. Skip if not
+ native.
+
+ 2006-06-22 Daniel Jacobowitz <dan@codesourcery.com>
+ * gdb.stabs/exclfwd.exp: Skip the test if configure did not
+ enable stabs testing.
+
+ 2006-05-06 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
+ * gdb.mi/mi-basics.exp: Add missing serial number to
+ expected output in some mi_gdb_test statements.
+ * gdb.mi/mi2-basics.exp: Likewise.
+
2006-09-25 Daniel Jacobowitz <dan@codesourcery.com>
gdb/testsuite/
#include "cp-support.h"
#include "dictionary.h"
+#ifdef __CYGWIN__
+/* LOCAL: Hack for testing using a Windows compiler and a Cygwin GDB. */
+int cygwin_filename_cmp (const char *lhs, const char *rhs);
+#undef FILENAME_CMP
+#define FILENAME_CMP cygwin_filename_cmp
+#endif
+
/* Ask buildsym.h to define the vars it normally declares `extern'. */
#define EXTERN
/**/
static void dwarf_decode_lines (struct line_header *, char *, bfd *,
struct dwarf2_cu *, struct partial_symtab *);
-static void dwarf2_start_subfile (char *, char *);
+static void dwarf2_start_subfile (char *, char *, char *);
static struct symbol *new_symbol (struct die_info *, struct type *,
struct dwarf2_cu *);
directory and file name numbers in the statement program
are 1-based. */
struct file_entry *fe = &lh->file_names[file - 1];
- char *dir;
+ char *dir = NULL;
if (fe->dir_index)
dir = lh->include_dirs[fe->dir_index - 1];
- else
- dir = comp_dir;
- dwarf2_start_subfile (fe->name, dir);
+
+ dwarf2_start_subfile (fe->name, dir, comp_dir);
}
/* Decode the table. */
0-based, but the directory and file name numbers in
the statement program are 1-based. */
struct file_entry *fe;
- char *dir;
+ char *dir = NULL;
file = read_unsigned_leb128 (abfd, line_ptr, &bytes_read);
line_ptr += bytes_read;
fe = &lh->file_names[file - 1];
if (fe->dir_index)
dir = lh->include_dirs[fe->dir_index - 1];
- else
- dir = comp_dir;
+
if (!decode_for_pst_p)
- dwarf2_start_subfile (fe->name, dir);
+ dwarf2_start_subfile (fe->name, dir, comp_dir);
}
break;
case DW_LNS_set_column:
/* Start a subfile for DWARF. FILENAME is the name of the file and
DIRNAME the name of the source directory which contains FILENAME
- or NULL if not known.
+ or NULL if not known. COMP_DIR is the compilation directory for the
+ linetable's compilation unit or NULL if not known.
This routine tries to keep line numbers from identical absolute and
relative file names in a common subfile.
files.files[1].dir: /srcdir
The line number information for list0.c has to end up in a single
- subfile, so that `break /srcdir/list0.c:1' works as expected. */
+ subfile, so that `break /srcdir/list0.c:1' works as expected.
+ start_subfile will ensure that this happens provided that we pass the
+ concatenation of files.files[1].dir and files.files[1].name as the
+ subfile's name. */
static void
-dwarf2_start_subfile (char *filename, char *dirname)
+dwarf2_start_subfile (char *filename, char *dirname, char *comp_dir)
{
- /* If the filename isn't absolute, try to match an existing subfile
- with the full pathname. */
+ char *fullname;
+
+ /* While reading the DIEs, we call start_symtab(DW_AT_name, DW_AT_comp_dir).
+ `start_symtab' will always pass the contents of DW_AT_comp_dir as
+ second argument to start_subfile. To be consistent, we do the
+ same here. In order not to lose the line information directory,
+ we concatenate it to the filename when it makes sense.
+ Note that the Dwarf3 standard says (speaking of filenames in line
+ information): ``The directory index is ignored for file names
+ that represent full path names''. Thus ignoring dirname in the
+ `else' branch below isn't an issue. */
if (!IS_ABSOLUTE_PATH (filename) && dirname != NULL)
- {
- struct subfile *subfile;
- char *fullname = concat (dirname, "/", filename, (char *)NULL);
+ fullname = concat (dirname, SLASH_STRING, filename, (char *)NULL);
+ else
+ fullname = filename;
- for (subfile = subfiles; subfile; subfile = subfile->next)
- {
- if (FILENAME_CMP (subfile->name, fullname) == 0)
- {
- current_subfile = subfile;
- xfree (fullname);
- return;
- }
- }
- xfree (fullname);
- }
- start_subfile (filename, dirname);
+ start_subfile (fullname, comp_dir);
+
+ if (fullname != filename)
+ xfree (fullname);
}
static void
#include "cp-abi.h"
#include "observer.h"
+#ifdef __CYGWIN__
+/* LOCAL: Hack for testing using a Windows compiler and a Cygwin GDB. */
+int cygwin_filename_cmp (const char *lhs, const char *rhs);
+#undef FILENAME_CMP
+#define FILENAME_CMP cygwin_filename_cmp
+#endif
+
/* Prototypes for local functions */
static void completion_list_add_name (char *, char *, int, char *, char *);
-re "Remote debugging using.*$gdb_prompt" {
verbose "Set target to [target_info netport]"
}
+ -re "A program is being debugged already.*Kill it.*y or n. $" {
+ send_gdb "y\n"
+ verbose "\t\tKilling previous program being debugged"
+ exp_continue
+ }
timeout {
perror "Couldn't set target for remote board."
cleanup
set exec_downloaded 1
}
+
+ return 0
}
proc mi_target_gdb_load { arg } {
# "p \"break1" unambiguous (completes to filename "break1.c")
# "p \"break1." unambiguous (should complete to "break1.c" but does not,
# due to readline limitations)
-# "p 'a" ambiguous (all symbols starting with a)
-# "p b-a" ambiguous (all symbols starting with a)
+# "p 'arg" ambiguous (all symbols starting with arg)
+# "p b-aarg" ambiguous (all symbols starting with arg)
# "p b-" ambiguous (all symbols)
# "file Make" "file" (word break hard to screw up here)
# "file ../gdb.stabs/we" "ird" (needs to not break word at slash)
timeout { fail "(timeout) complete 'p \"break1.'" }
}
-send_gdb "p 'a\t"
+send_gdb "p 'arg\t"
sleep 1
gdb_expect {
- -re "^p 'a\\\x07$"\
+ -re "^p 'arg\\\x07$"\
{ send_gdb "\n"
gdb_expect {
-re "(Invalid character constant\\.|Unmatched single quote\\.).*$gdb_prompt $"\
- { pass "complete 'p \'a'"}
- -re ".*$gdb_prompt $" { fail "complete 'p \'a'"}
- timeout {fail "(timeout) complete 'p \'a'"}
+ { pass "complete 'p \'arg'"}
+ -re ".*$gdb_prompt $" { fail "complete 'p \'arg'"}
+ timeout {fail "(timeout) complete 'p \'arg'"}
}
}
- -re ".*$gdb_prompt $" { fail "complete 'p \'a'" }
- timeout { fail "(timeout) complete 'p \'a'" }
+ -re ".*$gdb_prompt $" { fail "complete 'p \'arg'" }
+ timeout { fail "(timeout) complete 'p \'arg'" }
}
-send_gdb "p 'a\t"
+send_gdb "p 'arg\t"
sleep 1
gdb_expect {
- -re "^p 'a\\\x07$" {
+ -re "^p 'arg\\\x07$" {
send_gdb "\t"
gdb_expect {
- -re ".*argv.*$gdb_prompt p .a$" {
+ -re ".*argv.*$gdb_prompt p 'arg$" {
send_gdb "\n"
gdb_expect {
-re "(Invalid character constant\\.|Unmatched single quote\\.).*$gdb_prompt $" {
- pass "complete (2) 'p \'a'"
+ pass "complete (2) 'p \'arg'"
}
- -re ".*$gdb_prompt $" { fail "complete (2) 'p \'a'" }
- timeout { fail "(timeout) complete (2) 'p \'a'" }
+ -re ".*$gdb_prompt $" { fail "complete (2) 'p \'arg'" }
+ timeout { fail "(timeout) complete (2) 'p \'arg'" }
}
}
-re "(There are $decimal possibilities\\. Do you really\r\nwish to see them all.|Display all $decimal possibilities.) \\(y or n\\)$" {
send_gdb "n"
gdb_expect {
- -re "\\(gdb\\) p 'a$" {
+ -re "\\(gdb\\) p 'arg$" {
send_gdb "\n"
gdb_expect {
-re "(Invalid character constant\\.|Unmatched single quote\\.).*$gdb_prompt $" {
- pass "complete (2) 'p \'a'"
+ pass "complete (2) 'p \'arg'"
}
-re ".*$gdb_prompt $" {
- fail "complete (2) 'p \'a'"
+ fail "complete (2) 'p \'arg'"
}
- timeout { fail "(timeout) complete (2) 'p \'a'" }
+ timeout { fail "(timeout) complete (2) 'p \'arg'" }
}
}
- -re ".*$gdb_prompt $" { fail "complete (2) 'p \'a'" }
- timeout { fail "(timeout) complete (2) 'p \'a'" }
+ -re ".*$gdb_prompt $" { fail "complete (2) 'p \'arg'" }
+ timeout { fail "(timeout) complete (2) 'p \'arg'" }
}
}
- -re ".*$gdb_prompt $" { fail "complete (2) 'p \'a'" }
- timeout { fail "(timeout) complete (2) 'p \'a'" }
+ -re ".*$gdb_prompt $" { fail "complete (2) 'p \'arg'" }
+ timeout { fail "(timeout) complete (2) 'p \'arg'" }
}
}
- -re ".*$gdb_prompt $" { fail "complete (2) 'p \'a'" }
- timeout { fail "(timeout) complete (2) 'p \'a'" }
+ -re ".*$gdb_prompt $" { fail "complete (2) 'p \'arg'" }
+ timeout { fail "(timeout) complete (2) 'p \'arg'" }
}
#
# So, I'm hoping that there is no system with a static library variable named
# `no_var_by_this_name'.
-send_gdb "p no_var_named_this-a\t"
+send_gdb "p no_var_named_this-arg\t"
sleep 1
gdb_expect {
- -re "^p no_var_named_this-a\\\x07$" {
+ -re "^p no_var_named_this-arg\\\x07$" {
send_gdb "\n"
gdb_expect {
-re "No symbol \"no_var_named_this\" in current context\\..*$gdb_prompt $" {
- pass "complete 'p no_var_named_this-a'"
+ pass "complete 'p no_var_named_this-arg'"
}
-re ".*$gdb_prompt $" {
- fail "complete 'p no_var_named_this-a'"
+ fail "complete 'p no_var_named_this-arg'"
}
timeout {
- fail "(timeout) complete 'p no_var_named_this-a'"
+ fail "(timeout) complete 'p no_var_named_this-arg'"
}
}
}
-re ".*$gdb_prompt $" {
- fail "complete 'p no_var_named_this-a'"
+ fail "complete 'p no_var_named_this-arg'"
}
timeout {
- fail "(timeout) complete 'p no_var_named_this-a'"
+ fail "(timeout) complete 'p no_var_named_this-arg'"
}
}
-send_gdb "p no_var_named_this-a\t"
+send_gdb "p no_var_named_this-arg\t"
sleep 1
gdb_expect {
- -re "^p no_var_named_this-a\\\x07$" {
+ -re "^p no_var_named_this-arg\\\x07$" {
send_gdb "\t"
gdb_expect {
- -re ".*argv.*$gdb_prompt p no_var_named_this-a$" {
+ -re ".*argv.*$gdb_prompt p no_var_named_this-arg$" {
send_gdb "\n"
gdb_expect {
-re "No symbol \"no_var_named_this\" in current context\\..*$gdb_prompt $" {
- pass "complete (2) 'p no_var_named_this-a'"
+ pass "complete (2) 'p no_var_named_this-arg'"
}
-re ".*$gdb_prompt $" {
- fail "complete (2) 'p no_var_named_this-a'"
+ fail "complete (2) 'p no_var_named_this-arg'"
}
timeout {
- fail "(timeout) complete (2) 'p no_var_named_this-a'"
+ fail "(timeout) complete (2) 'p no_var_named_this-arg'"
}
}
}
-re "(There are $decimal possibilities\\. Do you really\r\nwish to see them all.|Display all $decimal possibilities.) \\(y or n\\)$" {
send_gdb "n"
gdb_expect {
- -re "\\(gdb\\) p no_var_named_this-a$" {
+ -re "\\(gdb\\) p no_var_named_this-arg$" {
send_gdb "\n"
gdb_expect {
-re "No symbol \"no_var_named_this\" in current context\\..*$gdb_prompt $" {
- pass "complete (2) 'p no_var_named_this-a'"
+ pass "complete (2) 'p no_var_named_this-arg'"
}
-re ".*$gdb_prompt $" {
- fail "complete (2) 'p no_var_named_this-a'"
+ fail "complete (2) 'p no_var_named_this-arg'"
}
timeout {
- fail "(timeout) complete (2) 'p no_var_named_this-a'"
+ fail "(timeout) complete (2) 'p no_var_named_this-arg'"
}
}
}
-re ".*$gdb_prompt $" {
- fail "complete (2) 'p no_var_named_this-a'"
+ fail "complete (2) 'p no_var_named_this-arg'"
}
timeout {
- fail "(timeout) complete (2) 'p no_var_named_this-a'"
+ fail "(timeout) complete (2) 'p no_var_named_this-arg'"
}
}
}
-re ".*$gdb_prompt $" {
- fail "complete (2) 'p no_var_named_this-a'"
+ fail "complete (2) 'p no_var_named_this-arg'"
}
- timeout { fail "(timeout) complete (2) 'p no_var_named_this-a'" }
+ timeout { fail "(timeout) complete (2) 'p no_var_named_this-arg'" }
}
}
- -re ".*$gdb_prompt $" { fail "complete (2) 'p no_var_named_this-a'" }
- timeout { fail "(timeout) complete (2) 'p no_var_named_this-a'" }
+ -re ".*$gdb_prompt $" { fail "complete (2) 'p no_var_named_this-arg'" }
+ timeout { fail "(timeout) complete (2) 'p no_var_named_this-arg'" }
}
send_gdb "p no_var_named_this-\t"
}
}
}
+ -re ".*argv.*$gdb_prompt p no_var_named_this-$" {
+ send_gdb "\n"
+ gdb_expect {
+ -re "No symbol \"no_var_named_this\" in current context\\..*$gdb_prompt $" {
+ pass "complete (2) 'p no_var_named_this-'"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "complete (2) 'p no_var_named_this-'"
+ }
+ timeout {
+ fail "(timeout) complete (2) 'p no_var_named_this-'"
+ }
+ }
+ }
-re ".*$gdb_prompt $" {
fail "complete (2) 'p no_var_named_this-'"
}
set srcfile ${testfile}.c
set binfile ${objdir}/${subdir}/${testfile}
-remote_exec build "rm -f ${binfile}"
-
-# get the value of gcc_compiled
-if [get_compiler_info ${binfile}] {
- return -1
-}
-
-if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}.o" object {debug}] != "" } {
- return -1
-}
+set libsrc "${srcdir}/${subdir}/${libfile}.c"
+set libobj "${objdir}/${subdir}/${libfile}.so"
+set execsrc "${srcdir}/${subdir}/${srcfile}"
-# Build the shared libraries this test case needs.
-#
+remote_exec build "rm -f ${binfile}"
-if {$gcc_compiled == 0} {
- if [istarget "hppa*-hp-hpux*"] then {
- set additional_flags "additional_flags=+z"
- } elseif { [istarget "mips-sgi-irix*"] } {
- # Disable SGI compiler's implicit -Dsgi
- set additional_flags "additional_flags=-Usgi"
- } else {
- # don't know what the compiler is...
- set additional_flags ""
- }
-} else {
- if { ([istarget "powerpc*-*-aix*"]
- || [istarget "rs6000*-*-aix*"]) } {
- set additional_flags ""
- } else {
- set additional_flags "additional_flags=-fpic"
- }
+# Are we on a target board? No support for downloading shared libraries
+# to a target yet.
+if ![isnative] then {
+ return 0
}
-set additional_flags "$additional_flags -shared"
-if {[gdb_compile "${srcdir}/${subdir}/${libfile}.c" "${objdir}/${subdir}/${libfile}.so" executable [list debug $additional_flags "incdir=${objdir}"]] != ""} {
+# get the value of gcc_compiled
+if [get_compiler_info ${binfile}] {
return -1
}
-if { ($gcc_compiled
-&& ([istarget "powerpc*-*-aix*"]
-|| [istarget "rs6000*-*-aix*"] )) } {
- set additional_flags "additional_flags=-L${objdir}/${subdir}"
-} elseif { [istarget "mips-sgi-irix*"] } {
- set additional_flags "additional_flags=-rpath ${objdir}/${subdir}"
-} else {
- set additional_flags ""
-}
-
-if {[gdb_compile "${objdir}/${subdir}/${testfile}.o ${objdir}/${subdir}/${libfile}.so" "${binfile}" executable [list debug $additional_flags]] != ""} {
+if { [gdb_compile_shlib $libsrc $libobj {debug}] != ""
+ || [gdb_compile $execsrc ${binfile} executable \
+ [list debug shlib=${libobj}]] != "" } {
return -1
}
-
gdb_exit
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
# list the lines there instead of main, so we skip this test for remote targets.
# The second case is for optimized code, it is still correct.
- if [is_remote target] {
+ if [target_info exists use_gdb_stub] {
runto_main;
unsupported "list default lines around main";
} else {
{
send_gdb "shell grep factorial msymbols_output\n"
gdb_expect {
- -re "\\\[ *$decimal\\\] T\[ \t\]+$hex factorial.*$gdb_prompt $"\
+ -re "\\\[ *$decimal\\\] \[tT\]\[ \t\]+$hex factorial.*$gdb_prompt $"\
{ pass "maint print msymbols" }
-re ".*$gdb_prompt $" { fail "maint print msymbols" }
timeout { fail "(timeout) maint print msymbols" }
gdb_test_multiple "shell ls msymbols_output2" "maint print msymbols" {
-re "msymbols_output2\r\n$gdb_prompt $" {
gdb_test_multiple "shell grep factorial msymbols_output2" "maint print msymbols" {
- -re "\\\[ *$decimal\\\] T\[ \t\]+$hex factorial.*$gdb_prompt $" {
+ -re "\\\[ *$decimal\\\] \[tT\]\[ \t\]+$hex factorial.*$gdb_prompt $" {
pass "maint print msymbols"
}
-re ".*$gdb_prompt $" {
gdb_expect {
-re ".* .text .*$gdb_prompt $" { fail "maint info sections DATA" }
-re ".* .data .*$gdb_prompt $" { pass "maint info sections DATA" }
+ -re ".* .rodata .*$gdb_prompt $" { pass "maint info sections DATA" }
-re ".*$gdb_prompt $" { fail "maint info sections DATA" }
timeout { fail "(timeout) maint info sections DATA" }
}
#
gdb_test "show download-write-size" \
- "The write size used when downloading a program is 512." \
+ "The write size used when downloading a program is 16384." \
"download limit default"
gdb_test "set download-write-size" "Argument required.*"
gdb_test "set remote memory-write-packet-size 16" ""
gdb_test "show remote memory-write-packet-size" \
- "The memory-write-packet-size is 16. Packets are limited to 16 bytes." \
+ "The memory-write-packet-size is 16. Packets are limited to 20 bytes." \
"set write-packet - small"
gdb_test "set remote memory-write-packet-size 1" ""
gdb_test "show remote memory-write-packet-size" \
- "The memory-write-packet-size is 1. Packets are limited to 16 bytes." \
+ "The memory-write-packet-size is 1. Packets are limited to 20 bytes." \
"set write-packet - very-small"
#
gdb_test "set remote memory-read-packet-size 16" \
""
gdb_test "show remote memory-read-packet-size" \
- "The memory-read-packet-size is 16. Packets are limited to 16 bytes."
+ "The memory-read-packet-size is 16. Packets are limited to 20 bytes."
gdb_test "x/17ub random_data" \
"<random_data>:\[ \t\]+60\[ \t\]+74\[ \t\]+216\[ \t\]+38\[ \t\]+149\[ \t\]+49\[ \t\]+207\[ \t\]+44.*<random_data\\+8>:\[ \t\]+124\[ \t\]+38\[ \t\]+93\[ \t\]+125\[ \t\]+232\[ \t\]+67\[ \t\]+228\[ \t\]+56.*<random_data\\+16>:\[ \t\]+161"
return -1
}
+set additional_flags {debug}
+
if {$hp_cc_compiler} {
- set additional_flags "additional_flags=-Ae"
-} else {
- set additional_flags ""
+ lappend additional_flags "additional_flags=-Ae"
}
# build the first test case
-if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug ${additional_flags}}] != "" } {
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" \
+ executable ${additional_flags}] != "" } {
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
}
set envirodir [string_to_regexp ${srcdir}/${subdir}]
mi_gdb_test "202-environment-directory ${srcdir}/${subdir}" \
- "\\\^done,source-path=\"${envirodir}.\\\$cdir.\\\$cwd\"" \
+ "202\\\^done,source-path=\"${envirodir}.\\\$cdir.\\\$cwd\"" \
"environment-directory arg operation"
mi_gdb_test "203-environment-directory" \
- "\\\^done,source-path=\"${envirodir}.\\\$cdir.\\\$cwd\"" \
+ "203\\\^done,source-path=\"${envirodir}.\\\$cdir.\\\$cwd\"" \
"environment-directory empty-string operation"
mi_gdb_test "204-environment-directory -r" \
"environment-path no-args operation"
mi_gdb_test "208-environment-path $srcdir $objdir" \
- "\\\^done,path=\"$escapedsrcdir.$escapedobjdir.$orig_path\"" \
+ "208\\\^done,path=\"$escapedsrcdir.$escapedobjdir.$orig_path\"" \
"environment-path dir1 dir2 operation"
mi_gdb_test "209-environment-path -r $objdir" \
set envirodir [string_to_regexp ${srcdir}/${subdir}]
mi_gdb_test "202-environment-directory ${srcdir}/${subdir}" \
- "\\\^done,source-path=\"${envirodir}.\\\$cdir.\\\$cwd\"" \
+ "202\\\^done,source-path=\"${envirodir}.\\\$cdir.\\\$cwd\"" \
"environment-directory arg operation"
mi_gdb_test "203-environment-directory" \
- "\\\^done,source-path=\"${envirodir}.\\\$cdir.\\\$cwd\"" \
+ "203\\\^done,source-path=\"${envirodir}.\\\$cdir.\\\$cwd\"" \
"environment-directory empty-string operation"
mi_gdb_test "204-environment-directory -r" \
"environment-path no-args operation"
mi_gdb_test "208-environment-path $srcdir $objdir" \
- "\\\^done,path=\"$escapedsrcdir.$escapedobjdir.$orig_path\"" \
+ "208\\\^done,path=\"$escapedsrcdir.$escapedobjdir.$orig_path\"" \
"environment-path dir1 dir2 operation"
mi_gdb_test "209-environment-path -r $objdir" \
strace $tracelevel
}
+# If the test directory was not created by configure then skip
+# this test.
+if ![file isdirectory ${objdir}/${subdir}] then {
+ return 0
+}
+
#
# test running programs
#
# The variable fullname_syntax_DOS is a regexp which matches a DOS path
# ie. a:\foo\ && a:foo\
set fullname_syntax_DOS {[a-zA-Z]:.*\\}
+# The variable fullname_syntax_DOS_cygwin is a regexp which matches a DOS path
+# as occasionally generated by Cygwin, ie. a:/foo/.
+set fullname_syntax_DOS_cygwin {[a-zA-Z]:.*/}
# The variable fullname_syntax is a regexp which matches what GDB considers
# an absolute path. It is currently debatable if the Windows style paths
# d:foo and \abc should be considered valid as an absolute path.
# Also, the purpse of this regexp is not to recognize a well formed
# absolute path, but to say with certainty that a path is absolute.
-set fullname_syntax "($fullname_syntax_POSIX|$fullname_syntax_UNC|$fullname_syntax_DOS_CASE|$fullname_syntax_DOS)"
+set fullname_syntax "($fullname_syntax_POSIX|$fullname_syntax_UNC|$fullname_syntax_DOS_CASE|$fullname_syntax_DOS|$fullname_syntax_DOS_cygwin)"
# Needed for some tests under Cygwin.
global EXEEXT
{
return;
}
+
+int
+cygwin_filename_cmp (const char *lhs, const char *rhs)
+{
+ for (; *lhs || *rhs; lhs++, rhs++)
+ {
+ if (tolower (*lhs) == tolower (*rhs))
+ continue;
+ if (*lhs == '/' && *rhs == '\\')
+ continue;
+ if (*lhs == '\\' && *rhs == '/')
+ continue;
+ return (int) *lhs - (int) *rhs;
+ }
+ return 0;
+}