]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb/
authorDaniel Jacobowitz <drow@false.org>
Thu, 28 Sep 2006 20:18:17 +0000 (20:18 +0000)
committerDaniel Jacobowitz <drow@false.org>
Thu, 28 Sep 2006 20:18:17 +0000 (20:18 +0000)
        * 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.

16 files changed:
ChangeLog.csl
gdb/buildsym.c
gdb/dwarf2read.c
gdb/symtab.c
gdb/testsuite/config/symbian.exp
gdb/testsuite/gdb.base/completion.exp
gdb/testsuite/gdb.base/gdb1555.exp
gdb/testsuite/gdb.base/list.exp
gdb/testsuite/gdb.base/maint.exp
gdb/testsuite/gdb.base/remote.exp
gdb/testsuite/gdb.base/varargs.exp
gdb/testsuite/gdb.mi/mi-basics.exp
gdb/testsuite/gdb.mi/mi2-basics.exp
gdb/testsuite/gdb.stabs/exclfwd.exp
gdb/testsuite/lib/gdb.exp
gdb/utils.c

index 73a2bb33a8206a99f42cd181d0d8f98919d66bac..63086bc433bcf5198f1671ae859e644df4cc0ab0 100644 (file)
@@ -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/
index 7908773708d4fae40cbc4e5b30467a0c45ad4f3e..7c66b893bde0456752e5615a34340cc9d824d50d 100644 (file)
 #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
 /**/
index 4bdf5e480cd1bf4a686ce1e622f45a11f6096f08..16e2b6cfe89eecc40e6441209cc316f4fc616de7 100644 (file)
@@ -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
index ad4ed038cc1aa7579608552f48ed6d099c06282a..7b1e515e2ffbe1d8545247d710b0f22fedbdaec9 100644 (file)
 #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 *);
index 17e4388b8186511c839c0d6f60571b0855b92b4d..53df46496df57ef6ea4a290085b1a122abf2d7b7 100644 (file)
@@ -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 } {
index 2961cb5ac1acce9099768fa42a562f163c07d748..f834ad746cc5c35165afcc24fe5f379134a0ed34 100644 (file)
@@ -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-'"
             }
index 8bea6329160e2b28c78acc1b6a7dbacc962935bc..f7cfe7560fbebf8f6d34b8c7a47580ce9114a4fa 100644 (file)
@@ -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
index 5494c28acdd37ca2e7d14ab92e6d0600c979fb8b..5b67f2ba1239a739e3fe0f6b92c3660cfcd663c4 100644 (file)
@@ -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 {
index 7bf9d0d833c5a018d5064c3d8c60191b6df7bc2b..ffc7bada8e588ef8ec8a7f37d88fd9e60e0f8257 100644 (file)
@@ -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" }
 }
index b286e3a6539e5cfe508c7c6ac7e827f8b7f18510..f0641090aab404401ea5988b3932552b1461e152 100644 (file)
@@ -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"
 
index 22fa84a3c53e7cee708261f075eb1393913d768a..37414ac9a7393ad3e9e6d44de5c7a550d7977a76 100644 (file)
@@ -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."
 }
 
index f6e82b095a094b78dec4eec5c06ed9265b4dc0c1..7bf15d75451ed7a91662bd74c8b93b31a7abd293 100644 (file)
@@ -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" \
index bde6e94d0e178b64b2d7147f6989bcae714b2375..d265888677fc70f73de45d5b81d02fe63b6c55b8 100644 (file)
@@ -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" \
index 05ab97c0fb0f30ca01473919e126ce281e66f665..9d500146393f43031200047aa8cd866b9ed09c0c 100644 (file)
@@ -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
 #
index 4bb4b0577891f853ce1b33ff4addd213c5c8acdb..c12e540f2266c14542decd09cab1b60bd3e052a1 100644 (file)
@@ -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
index c1ed5b73e2038ab1a6ce5e7c403f522fd7d6e1d6..75db4a641467e800fe3eab282cdfb865976540cd 100644 (file)
@@ -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;
+}