2011-03-23 Kai Tietz <ktietz@redhat.com>

* breakpoint.c (clear_command): Use filename_cmp
	instead of strcmp for comparison.
	* buildsym.c (watch_main_source_file_lossage): Likewise.
	(patch_subfile_names): Use IS_DIR_SEPARATOR instead of
	checking just for slash.
	* dbxread.c (read_dbx_symtab): Use lbasename instead of
	strrchr and filename_cmp instead of strcmp for filenames.
	(add_old_header_file): Use filename_cmp
	instead of strcmp for comparison.
	* exec.c (exec_set_section_address): Likewise.
	* macrotab.c (macro_lookup_inclusion): Likewise.
	(macro_lookup_inclusion): Likewise.
	* elfread.c (_initialize_elfread): Likewise.
	(elfstab_offset_sections): Likewise.
	(elfstab_offset_sections): Use lbasename instead of
	strrchr.
	* mdebugread.c (parse_partial_symbols): Likewise.
	(arse_partial_symbols): Use filename_(n)cmp instead of
	str(n)cmp for comparison.
	* minsyms.c (lookup_minimal_symbol): Likewise.
	* psymtab.c (read_psymtabs_with_filename): Likewise.
	* solib.c (solib_read_symbols): Likewise.
	(reload_shared_libraries_1): Likewise.
	* symmisc.c (maintenance_print_symbols): Likewise.
	* symfile.c (separate_debug_file_exists): Likewise.
	(reread_symbols): Likewise.
	(find_separate_debug_file_by_debuglink): Likewise.
	* remote-fileio.c (remote_fileio_func_rename): Likewise.
	* source.c (add_path): Likewise.
	* symtab.c (filename_seen): Likewise.
	(file_matches): Likewise.
	(print_symbol_info): Likewise.
	(maybe_add_partial_symtab_filename): Likewise.
	(make_source_files_completion_list): Likewise.
	* xml-syscall.c (init_sysinfo): Likewise.
	* windows-nat.c (_initialize_check_for_gdb_ini): Use
	IS_DIR_SEPARATOR for checking for trailing path separator.
This commit is contained in:
Kai Tietz
2011-03-23 18:23:56 +00:00
parent 663a1470e1
commit 0ba1096ad5
18 changed files with 106 additions and 80 deletions

View File

@@ -37,6 +37,7 @@
#include "complaints.h"
#include "demangle.h"
#include "psympriv.h"
#include "filenames.h"
extern void _initialize_elfread (void);
@@ -707,7 +708,8 @@ find_separate_debug_file_by_buildid (struct objfile *objfile)
build_id_name = build_id_to_debug_filename (build_id);
xfree (build_id);
/* Prevent looping on a stripped .debug file. */
if (build_id_name != NULL && strcmp (build_id_name, objfile->name) == 0)
if (build_id_name != NULL
&& filename_cmp (build_id_name, objfile->name) == 0)
{
warning (_("\"%s\": separate debug info file has no debug info"),
build_id_name);
@@ -1023,12 +1025,10 @@ elfstab_offset_sections (struct objfile *objfile, struct partial_symtab *pst)
struct stab_section_info *maybe = dbx->stab_section_info;
struct stab_section_info *questionable = 0;
int i;
char *p;
/* The ELF symbol info doesn't include path names, so strip the path
(if any) from the psymtab filename. */
while (0 != (p = strchr (filename, '/')))
filename = p + 1;
filename = lbasename (filename);
/* FIXME: This linear search could speed up significantly
if it was chained in the right order to match how we search it,
@@ -1036,7 +1036,7 @@ elfstab_offset_sections (struct objfile *objfile, struct partial_symtab *pst)
for (; maybe; maybe = maybe->next)
{
if (filename[0] == maybe->filename[0]
&& strcmp (filename, maybe->filename) == 0)
&& filename_cmp (filename, maybe->filename) == 0)
{
/* We found a match. But there might be several source files
(from different directories) with the same name. */