[Ada] use lbasename when testing if file is part of Ada runtime.
authorJoel Brobecker <brobecker@gnat.com>
Wed, 24 Oct 2012 18:17:22 +0000 (18:17 +0000)
committerJoel Brobecker <brobecker@gnat.com>
Wed, 24 Oct 2012 18:17:22 +0000 (18:17 +0000)
We use a list of regular expressions to match a symtab filenames
against the names of the files in the Ada runtime.  These regular
expressions do assume that the filename is a basename, however.
So make sure to evaluate these regular expressions against
the symtab's filename.

Without this patch, we run into problems when the Ada runtime was built
using a project file (through gprbuild).

gdb/ChangeLog:

        * ada-lang.c (is_known_support_routine): Use lbasename when
        matching the symtab's filename against
        known_runtime_file_name_patterns.

gdb/ChangeLog
gdb/ada-lang.c

index 55ad4d9145d0c4d1ad0ee57d2996140d1831c210..a4dd74e135ccbf0ebb106f497a6e68fc766b760f 100644 (file)
@@ -1,3 +1,9 @@
+2012-10-24  Joel Brobecker  <brobecker@adacore.com>
+
+       * ada-lang.c (is_known_support_routine): Use lbasename when
+       matching the symtab's filename against
+       known_runtime_file_name_patterns.
+
 2012-10-24  Joel Brobecker  <brobecker@adacore.com>
 
        * ada-lang.c (ada_same_array_size_p): New function.
index edef6bdd3e91889c0ce15df98173616dd675469f..2dde81485a915cd515b4381cd0e3a80b7355ce63 100644 (file)
@@ -10973,7 +10973,7 @@ is_known_support_routine (struct frame_info *frame)
   for (i = 0; known_runtime_file_name_patterns[i] != NULL; i += 1)
     {
       re_comp (known_runtime_file_name_patterns[i]);
-      if (re_exec (sal.symtab->filename))
+      if (re_exec (lbasename (sal.symtab->filename)))
         return 1;
       if (sal.symtab->objfile != NULL
           && re_exec (sal.symtab->objfile->name))