* buildsym.c (start_subfile): Handle absolute pathnames
authorDaniel Jacobowitz <drow@false.org>
Mon, 14 May 2007 14:10:35 +0000 (14:10 +0000)
committerDaniel Jacobowitz <drow@false.org>
Mon, 14 May 2007 14:10:35 +0000 (14:10 +0000)
while comparing subfile names.

gdb/ChangeLog
gdb/buildsym.c

index f335419a322e2864fe7f2541307be542b2a022a0..af1cb80f7b6f45caab80c78979bca4c5d89d18ed 100644 (file)
@@ -1,3 +1,8 @@
+2007-05-14  Maxim Grigoriev  <maxim2405@gmail.com>
+
+       * buildsym.c (start_subfile): Handle absolute pathnames
+       while comparing subfile names.
+
 2007-05-13  Ulrich Weigand  <uweigand@de.ibm.com>
 
        * hppa-hpux-tdep.c: Include "regcache.h".
index 94800bd76b4e4abbc01ba886b85494f766c8bbdc..69d11e58ee45ca825a25feb9a582c090c1623180 100644 (file)
@@ -549,11 +549,27 @@ start_subfile (char *name, char *dirname)
 
   for (subfile = subfiles; subfile; subfile = subfile->next)
     {
-      if (FILENAME_CMP (subfile->name, name) == 0)
+      char *subfile_name;
+
+      /* If NAME is an absolute path, and this subfile is not, then
+        attempt to create an absolute path to compare.  */
+      if (IS_ABSOLUTE_PATH (name)
+         && !IS_ABSOLUTE_PATH (subfile->name)
+         && subfile->dirname != NULL)
+       subfile_name = concat (subfile->dirname, SLASH_STRING,
+                              subfile->name, NULL);
+      else
+       subfile_name = subfile->name;
+
+      if (FILENAME_CMP (subfile_name, name) == 0)
        {
          current_subfile = subfile;
+         if (subfile_name != subfile->name)
+           xfree (subfile_name);
          return;
        }
+      if (subfile_name != subfile->name)
+       xfree (subfile_name);
     }
 
   /* This subfile is not known.  Add an entry for it. Make an entry