This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
+ the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA. */
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* This module provides subroutines used for creating and adding to
the symbol table. These routines are called from various symbol-
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
e = subfile->line_vector->item + subfile->line_vector->nitems++;
e->line = line;
- e->pc = ADDR_BITS_REMOVE(pc);
+ e->pc = gdbarch_addr_bits_remove (current_gdbarch, pc);
}
/* Needed in order to sort line tables from IBM xcoff files. Sigh! */
void
record_producer (const char *producer)
{
+ /* The producer is not always provided in the debugging info.
+ Do nothing if PRODUCER is NULL. */
+ if (producer == NULL)
+ return;
+
current_subfile->producer = savestring (producer, strlen (producer));
}