summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Jacobowitz <dan@debian.org>2006-09-28 20:18:17 +0000
committerDaniel Jacobowitz <dan@debian.org>2006-09-28 20:18:17 +0000
commitcee1b00dc523f5febcf0c1fdc309a24b075051ca (patch)
tree44216cf27a949d483baaff2259d2130b9c775c5a
parent0b7a9a318674291b8c5cb60eef0fe15d593f2439 (diff)
downloadgdb-cee1b00dc523f5febcf0c1fdc309a24b075051ca.tar.gz
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.
-rw-r--r--ChangeLog.csl49
-rw-r--r--gdb/buildsym.c7
-rw-r--r--gdb/dwarf2read.c61
-rw-r--r--gdb/symtab.c7
-rw-r--r--gdb/testsuite/config/symbian.exp7
-rw-r--r--gdb/testsuite/gdb.base/completion.exp110
-rw-r--r--gdb/testsuite/gdb.base/gdb1555.exp56
-rw-r--r--gdb/testsuite/gdb.base/list.exp2
-rw-r--r--gdb/testsuite/gdb.base/maint.exp5
-rw-r--r--gdb/testsuite/gdb.base/remote.exp8
-rw-r--r--gdb/testsuite/gdb.base/varargs.exp9
-rw-r--r--gdb/testsuite/gdb.mi/mi-basics.exp6
-rw-r--r--gdb/testsuite/gdb.mi/mi2-basics.exp6
-rw-r--r--gdb/testsuite/gdb.stabs/exclfwd.exp6
-rw-r--r--gdb/testsuite/lib/gdb.exp5
-rw-r--r--gdb/utils.c16
16 files changed, 222 insertions, 138 deletions
diff --git a/ChangeLog.csl b/ChangeLog.csl
index 73a2bb33a82..63086bc433b 100644
--- a/ChangeLog.csl
+++ b/ChangeLog.csl
@@ -1,3 +1,52 @@
+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/
diff --git a/gdb/buildsym.c b/gdb/buildsym.c
index 7908773708d..7c66b893bde 100644
--- a/gdb/buildsym.c
+++ b/gdb/buildsym.c
@@ -46,6 +46,13 @@
#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
/**/
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index 4bdf5e480cd..16e2b6cfe89 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -846,7 +846,7 @@ static struct line_header *(dwarf_decode_line_header
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 *);
@@ -6523,13 +6523,12 @@ dwarf_decode_lines (struct line_header *lh, char *comp_dir, bfd *abfd,
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. */
@@ -6621,17 +6620,16 @@ dwarf_decode_lines (struct line_header *lh, char *comp_dir, bfd *abfd,
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:
@@ -6711,7 +6709,8 @@ dwarf_decode_lines (struct line_header *lh, char *comp_dir, bfd *abfd,
/* 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.
@@ -6727,31 +6726,35 @@ dwarf_decode_lines (struct line_header *lh, char *comp_dir, bfd *abfd,
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
diff --git a/gdb/symtab.c b/gdb/symtab.c
index ad4ed038cc1..7b1e515e2ff 100644
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -57,6 +57,13 @@
#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 *);
diff --git a/gdb/testsuite/config/symbian.exp b/gdb/testsuite/config/symbian.exp
index 17e4388b818..53df46496df 100644
--- a/gdb/testsuite/config/symbian.exp
+++ b/gdb/testsuite/config/symbian.exp
@@ -190,6 +190,11 @@ proc gdb_target_symbian {} {
-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
@@ -261,6 +266,8 @@ proc gdb_load { arg } {
set exec_downloaded 1
}
+
+ return 0
}
proc mi_target_gdb_load { arg } {
diff --git a/gdb/testsuite/gdb.base/completion.exp b/gdb/testsuite/gdb.base/completion.exp
index 2961cb5ac1a..f834ad746cc 100644
--- a/gdb/testsuite/gdb.base/completion.exp
+++ b/gdb/testsuite/gdb.base/completion.exp
@@ -41,8 +41,8 @@
# "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)
@@ -418,63 +418,63 @@ gdb_expect {
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'" }
}
@@ -499,84 +499,84 @@ gdb_expect {
#
# 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"
@@ -610,6 +610,20 @@ gdb_expect {
}
}
}
+ -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-'"
}
diff --git a/gdb/testsuite/gdb.base/gdb1555.exp b/gdb/testsuite/gdb.base/gdb1555.exp
index 8bea6329160..f7cfe7560fb 100644
--- a/gdb/testsuite/gdb.base/gdb1555.exp
+++ b/gdb/testsuite/gdb.base/gdb1555.exp
@@ -30,59 +30,29 @@ set libfile gdb1555
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
diff --git a/gdb/testsuite/gdb.base/list.exp b/gdb/testsuite/gdb.base/list.exp
index 5494c28acdd..5b67f2ba123 100644
--- a/gdb/testsuite/gdb.base/list.exp
+++ b/gdb/testsuite/gdb.base/list.exp
@@ -97,7 +97,7 @@ proc test_listsize {} {
# 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 {
diff --git a/gdb/testsuite/gdb.base/maint.exp b/gdb/testsuite/gdb.base/maint.exp
index 7bf9d0d833c..ffc7bada8e5 100644
--- a/gdb/testsuite/gdb.base/maint.exp
+++ b/gdb/testsuite/gdb.base/maint.exp
@@ -307,7 +307,7 @@ gdb_expect {
{
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" }
@@ -331,7 +331,7 @@ gdb_test_multiple "maint print msymbols msymbols_output2 ${subdir}/${testfile}"
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 $" {
@@ -472,6 +472,7 @@ send_gdb "maint info sections DATA\n"
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" }
}
diff --git a/gdb/testsuite/gdb.base/remote.exp b/gdb/testsuite/gdb.base/remote.exp
index b286e3a6539..f0641090aab 100644
--- a/gdb/testsuite/gdb.base/remote.exp
+++ b/gdb/testsuite/gdb.base/remote.exp
@@ -47,7 +47,7 @@ if {$result != "" } then {
#
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.*"
@@ -67,12 +67,12 @@ gdb_test "set remote memory-write-packet-size" \
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"
#
@@ -191,7 +191,7 @@ if {$sizeof_random_data > 16380 } then {
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"
diff --git a/gdb/testsuite/gdb.base/varargs.exp b/gdb/testsuite/gdb.base/varargs.exp
index 22fa84a3c53..37414ac9a73 100644
--- a/gdb/testsuite/gdb.base/varargs.exp
+++ b/gdb/testsuite/gdb.base/varargs.exp
@@ -48,14 +48,15 @@ if [get_compiler_info ${binfile}] {
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."
}
diff --git a/gdb/testsuite/gdb.mi/mi-basics.exp b/gdb/testsuite/gdb.mi/mi-basics.exp
index f6e82b095a0..7bf15d75451 100644
--- a/gdb/testsuite/gdb.mi/mi-basics.exp
+++ b/gdb/testsuite/gdb.mi/mi-basics.exp
@@ -160,11 +160,11 @@ proc test_dir_specification {} {
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" \
@@ -223,7 +223,7 @@ proc test_path_specification {} {
"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" \
diff --git a/gdb/testsuite/gdb.mi/mi2-basics.exp b/gdb/testsuite/gdb.mi/mi2-basics.exp
index bde6e94d0e1..d265888677f 100644
--- a/gdb/testsuite/gdb.mi/mi2-basics.exp
+++ b/gdb/testsuite/gdb.mi/mi2-basics.exp
@@ -161,11 +161,11 @@ proc test_dir_specification {} {
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" \
@@ -226,7 +226,7 @@ proc test_path_specification {} {
"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" \
diff --git a/gdb/testsuite/gdb.stabs/exclfwd.exp b/gdb/testsuite/gdb.stabs/exclfwd.exp
index 05ab97c0fb0..9d500146393 100644
--- a/gdb/testsuite/gdb.stabs/exclfwd.exp
+++ b/gdb/testsuite/gdb.stabs/exclfwd.exp
@@ -21,6 +21,12 @@ if $tracelevel {
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
#
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index 4bb4b057789..c12e540f226 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -64,12 +64,15 @@ set fullname_syntax_DOS_CASE {\\[^\\].*\\}
# 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
diff --git a/gdb/utils.c b/gdb/utils.c
index c1ed5b73e20..75db4a64146 100644
--- a/gdb/utils.c
+++ b/gdb/utils.c
@@ -3127,3 +3127,19 @@ dummy_obstack_deallocate (void *object, void *data)
{
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;
+}