aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2013-02-03 16:00:36 +0000
committerJan Kratochvil <jan.kratochvil@redhat.com>2013-02-03 16:00:36 +0000
commitaf529f8f61348016fc75bcb2e09c8f5d8bd1cc3a (patch)
tree35fad556c4526038451b6e46eb1c7264e94dfc54 /gdb/testsuite
parent2f202fde0a4586f88b98439b436e7b0bb1336b26 (diff)
downloadgdb-af529f8f61348016fc75bcb2e09c8f5d8bd1cc3a.zip
gdb-af529f8f61348016fc75bcb2e09c8f5d8bd1cc3a.tar.gz
gdb-af529f8f61348016fc75bcb2e09c8f5d8bd1cc3a.tar.bz2
gdb/
Code cleanup. * breakpoint.c (clear_command): Remove variable is_abs, unify the call of filename_cmp with compare_filenames_for_search. * dwarf2read.c (dw2_map_symtabs_matching_filename): Remove variable is_abs, unify the call of FILENAME_CMP with compare_filenames_for_search. New gdb_asserts for real_path and name. Unify the call of compare_filenames_for_search with FILENAME_CMP. * psymtab.c (partial_map_symtabs_matching_filename): Likewise. * symfile.h (struct quick_symbol_functions): Extend the comment for map_symtabs_matching_filename. * symtab.c (compare_filenames_for_search): Remove the function comment relative path requirement. Handle absolute filenames, with a comment. (iterate_over_some_symtabs): Remove variable is_abs, unify the call of FILENAME_CMP with compare_filenames_for_search. New gdb_asserts for real_path and name. Unify the call of compare_filenames_for_search with FILENAME_CMP. (iterate_over_symtabs): New gdb_assert on REAL_PATH. gdb/testsuite/ * gdb.mi/mi-fullname-deleted.exp: Use double last slash for $srcfileabs. (compare_filenames_for_search does not match) (compare_filenames_for_search does match): New tests.
Diffstat (limited to 'gdb/testsuite')
-rw-r--r--gdb/testsuite/ChangeLog6
-rw-r--r--gdb/testsuite/gdb.mi/mi-fullname-deleted.exp15
2 files changed, 21 insertions, 0 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 165dd53..9649971 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,5 +1,11 @@
2013-02-03 Jan Kratochvil <jan.kratochvil@redhat.com>
+ * gdb.mi/mi-fullname-deleted.exp: Use double last slash for $srcfileabs.
+ (compare_filenames_for_search does not match)
+ (compare_filenames_for_search does match): New tests.
+
+2013-02-03 Jan Kratochvil <jan.kratochvil@redhat.com>
+
* gdb.gdb/xfullpath.exp: Replace xfullpath calls by gdb_realpath calls.
2013-02-02 Jan Kratochvil <jan.kratochvil@redhat.com>
diff --git a/gdb/testsuite/gdb.mi/mi-fullname-deleted.exp b/gdb/testsuite/gdb.mi/mi-fullname-deleted.exp
index 1b9fd5c..19d8dda 100644
--- a/gdb/testsuite/gdb.mi/mi-fullname-deleted.exp
+++ b/gdb/testsuite/gdb.mi/mi-fullname-deleted.exp
@@ -24,6 +24,12 @@ if [mi_gdb_start] {
standard_testfile
set srcfileabs [standard_output_file $srcfile]
+# "//$srcfile" It is used for the test of compare_filenames_for_search.
+if { [regsub {/[^/]+$} $srcfileabs {/\0} srcfileabs] != 1 } {
+ xfail "Cannot double the last slash separator"
+ return -1
+}
+
if { [regsub {^(/[^/]+)/} $srcfileabs {\1subst/} srcfileabssubst] != 1
|| [regsub {^(/[^/]+)/.*$} $srcfileabs {\1} initdir] != 1 } {
xfail "Missing root subdirectory"
@@ -49,3 +55,12 @@ mi_gdb_test "-interpreter-exec console \"set substitute-path ${initdir} ${initdi
mi_gdb_test "-file-list-exec-source-file" ".*\",fullname=\".*\".*" "fullname present"
mi_gdb_test "-file-list-exec-source-file" ".*\",fullname=\"[string_to_regexp $srcfileabssubst]\".*" "substituted fullname"
+
+# Test compare_filenames_for_search does not falsely use absolute filename as
+# a relative one.
+mi_gdb_test "-break-insert -t /$srcfile:main" \
+ "\\^error,msg=\"No source file named /[string_to_regexp $srcfile]\\.\"" \
+ "compare_filenames_for_search does not match"
+mi_gdb_test "-break-insert -t $srcfile:main" \
+ {\^done,bkpt=.*} \
+ "compare_filenames_for_search does match"