/* Symbol table lookup for the GNU debugger, GDB.
- Copyright (C) 1986-2004, 2007-2012 Free Software Foundation, Inc.
+ Copyright (C) 1986-2013 Free Software Foundation, Inc.
This file is part of GDB.
/* Either the names must completely match, or the character
preceding the trailing SEARCH_NAME segment of FILENAME must be a
- directory separator. */
+ directory separator.
+
+ The HAS_DRIVE_SPEC purpose is to make FILENAME "c:file.c"
+ compatible with SEARCH_NAME "file.c". In such case a compiler had
+ to put the "c:file.c" name into debug info. Such compatibility
+ works only on GDB built for DOS host. */
return (len == search_len
|| IS_DIR_SEPARATOR (filename[len - search_len - 1])
|| (HAS_DRIVE_SPEC (filename)
{
const char *fp = symtab_to_fullname (s);
- if (fp != NULL && FILENAME_CMP (full_path, fp) == 0)
+ if (FILENAME_CMP (full_path, fp) == 0)
{
if (callback (s, data))
return 1;
}
- if (fp != NULL && !is_abs && compare_filenames_for_search (fp, name))
+ if (!is_abs && compare_filenames_for_search (fp, name))
{
if (callback (s, data))
return 1;
if (real_path != NULL)
{
const char *fullname = symtab_to_fullname (s);
+ char *rp = gdb_realpath (fullname);
+ struct cleanup *cleanups = make_cleanup (xfree, rp);
- if (fullname != NULL)
- {
- char *rp = gdb_realpath (fullname);
-
- make_cleanup (xfree, rp);
- if (FILENAME_CMP (real_path, rp) == 0)
+ if (FILENAME_CMP (real_path, rp) == 0)
+ {
+ if (callback (s, data))
{
- if (callback (s, data))
- return 1;
+ do_cleanups (cleanups);
+ return 1;
}
+ }
- if (!is_abs && compare_filenames_for_search (rp, name))
+ if (!is_abs && compare_filenames_for_search (rp, name))
+ {
+ if (callback (s, data))
{
- if (callback (s, data))
- return 1;
+ do_cleanups (cleanups);
+ return 1;
}
- }
+ }
+ do_cleanups (cleanups);
}
}
void
symbol_set_demangled_name (struct general_symbol_info *gsymbol,
- char *name,
+ const char *name,
struct objfile *objfile)
{
if (gsymbol->language == language_cplus)
const struct block *block;
struct symtab *s;
- if (objfile->sf)
- objfile->sf->qf->pre_expand_symtabs_matching (objfile, block_index,
- name, domain);
-
ALL_OBJFILE_PRIMARY_SYMTABS (objfile, s)
{
bv = BLOCKVECTOR (s);
ALL_OBJFILES (objfile)
{
- if (objfile->sf)
- objfile->sf->qf->pre_expand_symtabs_matching (objfile,
- GLOBAL_BLOCK,
- name, STRUCT_DOMAIN);
-
ALL_OBJFILE_PRIMARY_SYMTABS (objfile, s)
{
bv = BLOCKVECTOR (s);
ALL_OBJFILES (objfile)
{
- if (objfile->sf)
- objfile->sf->qf->pre_expand_symtabs_matching (objfile, STATIC_BLOCK,
- name, STRUCT_DOMAIN);
-
ALL_OBJFILE_PRIMARY_SYMTABS (objfile, s)
{
bv = BLOCKVECTOR (s);
symtab->filename);
}
- /* Get symbol full file name if possible. */
- symtab_to_fullname (symtab);
-
ALL_SYMTABS (objfile, s)
{
struct linetable *l;
if (FILENAME_CMP (symtab->filename, s->filename) != 0)
continue;
- if (symtab->fullname != NULL
- && symtab_to_fullname (s) != NULL
- && FILENAME_CMP (symtab->fullname, s->fullname) != 0)
+ if (FILENAME_CMP (symtab_to_fullname (symtab),
+ symtab_to_fullname (s)) != 0)
continue;
l = LINETABLE (s);
ind = find_line_common (l, line, &exact, 0);
{
const char *fullname = symtab_to_fullname (s);
- output_source_filename (fullname ? fullname : s->filename, &data);
+ output_source_filename (fullname, &data);
}
printf_filtered ("\n\n");