gdb/
Replace xfullpath calls by gdb_realpath calls. * cli/cli-cmds.c (find_and_open_script): Remove xfullpath from the function comment. * dwarf2read.c (dw2_map_expand_apply): Remove parameter full_path. Remove it from the iterate_over_some_symtabs call. (dw2_map_symtabs_matching_filename): Remove parameter full_path. Remove it from the dw2_map_expand_apply calls, remove a block handling it. * psymtab.c (partial_map_expand_apply): Remove parameter full_path. Remove it from the iterate_over_some_symtabs call. (partial_map_symtabs_matching_filename): Remove parameter full_path. Remove it from the partial_map_expand_apply calls, remove a block handling it. Drop gdb_realpath call and cleanups from the real_path handling. * source.c (openp): Drop the comment part about xfullpath. Replace xfullpath calls by gdb_realpath calls. (find_and_open_source): Replace xfullpath call by gdb_realpath call. * symfile.h (struct quick_symbol_functions): Remove parameter full_path from method map_symtabs_matching_filename and its comment. * symmisc.c (maintenance_print_msymbols): Replace xfullpath call by gdb_realpath call. * symtab.c (iterate_over_some_symtabs): Remove parameter full_path, remove it also from the function comment, remove a block handling it. Drop gdb_realpath call and cleanups from the real_path handling. (iterate_over_symtabs): Drop variable full_path and its use. * symtab.h (iterate_over_some_symtabs): Remove parameter full_path. * utils.c (xfullpath): Remove. * utils.h (xfullpath): Remove. gdb/testsuite/ * gdb.gdb/xfullpath.exp: Replace xfullpath calls by gdb_realpath calls.
This commit is contained in:
parent
c709f4566d
commit
f5b95b5073
13 changed files with 66 additions and 164 deletions
46
gdb/utils.c
46
gdb/utils.c
|
@ -3286,52 +3286,6 @@ gdb_realpath (const char *filename)
|
|||
return xstrdup (filename);
|
||||
}
|
||||
|
||||
/* Return a copy of FILENAME, with its directory prefix canonicalized
|
||||
by gdb_realpath. */
|
||||
|
||||
char *
|
||||
xfullpath (const char *filename)
|
||||
{
|
||||
const char *base_name = lbasename (filename);
|
||||
char *dir_name;
|
||||
char *real_path;
|
||||
char *result;
|
||||
|
||||
/* Extract the basename of filename, and return immediately
|
||||
a copy of filename if it does not contain any directory prefix. */
|
||||
if (base_name == filename)
|
||||
return xstrdup (filename);
|
||||
|
||||
dir_name = alloca ((size_t) (base_name - filename + 2));
|
||||
/* Allocate enough space to store the dir_name + plus one extra
|
||||
character sometimes needed under Windows (see below), and
|
||||
then the closing \000 character. */
|
||||
strncpy (dir_name, filename, base_name - filename);
|
||||
dir_name[base_name - filename] = '\000';
|
||||
|
||||
#ifdef HAVE_DOS_BASED_FILE_SYSTEM
|
||||
/* We need to be careful when filename is of the form 'd:foo', which
|
||||
is equivalent of d:./foo, which is totally different from d:/foo. */
|
||||
if (strlen (dir_name) == 2 && isalpha (dir_name[0]) && dir_name[1] == ':')
|
||||
{
|
||||
dir_name[2] = '.';
|
||||
dir_name[3] = '\000';
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Canonicalize the directory prefix, and build the resulting
|
||||
filename. If the dirname realpath already contains an ending
|
||||
directory separator, avoid doubling it. */
|
||||
real_path = gdb_realpath (dir_name);
|
||||
if (IS_DIR_SEPARATOR (real_path[strlen (real_path) - 1]))
|
||||
result = concat (real_path, base_name, (char *) NULL);
|
||||
else
|
||||
result = concat (real_path, SLASH_STRING, base_name, (char *) NULL);
|
||||
|
||||
xfree (real_path);
|
||||
return result;
|
||||
}
|
||||
|
||||
ULONGEST
|
||||
align_up (ULONGEST v, int n)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue