Skip to content

Commit a22a215

Browse files
gdb: rename ldirname to gdb_ldirname
It conflicts with the ldirname function that will be added in the next libiberty sync.
1 parent d1851ed commit a22a215

File tree

10 files changed

+13
-13
lines changed

10 files changed

+13
-13
lines changed

gdb/corelow.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -957,7 +957,7 @@ locate_exec_from_corefile_exec_context (bfd *cbfd,
957957
execbfd = open_and_check_build_id (exec_name);
958958
else
959959
{
960-
std::string p = (ldirname (bfd_get_filename (cbfd))
960+
std::string p = (gdb_ldirname (bfd_get_filename (cbfd))
961961
+ '/'
962962
+ exec_name);
963963
execbfd = open_and_check_build_id (p.c_str ());
@@ -971,7 +971,7 @@ locate_exec_from_corefile_exec_context (bfd *cbfd,
971971
if (execbfd == nullptr)
972972
{
973973
const char *base_name = lbasename (exec_name);
974-
std::string p = (ldirname (bfd_get_filename (cbfd))
974+
std::string p = (gdb_ldirname (bfd_get_filename (cbfd))
975975
+ '/'
976976
+ base_name);
977977
execbfd = open_and_check_build_id (p.c_str ());

gdb/darwin-nat.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1853,7 +1853,7 @@ copy_shell_to_cache (const char *shell, const std::string &new_name)
18531853
error (_("Could not open shell (%s) for reading: %s"),
18541854
shell, safe_strerror (errno));
18551855

1856-
std::string new_dir = ldirname (new_name.c_str ());
1856+
std::string new_dir = gdb_ldirname (new_name.c_str ());
18571857
if (!mkdir_recursive (new_dir.c_str ()))
18581858
error (_("Could not make cache directory \"%s\": %s"),
18591859
new_dir.c_str (), safe_strerror (errno));

gdb/dwarf2/dwz.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ dwz_file::read_dwz_file (dwarf2_per_objfile *per_objfile)
343343
{
344344
gdb::unique_xmalloc_ptr<char> abs = gdb_realpath (per_bfd->filename ());
345345

346-
filename = ldirname (abs.get ()) + SLASH_STRING + filename;
346+
filename = gdb_ldirname (abs.get ()) + SLASH_STRING + filename;
347347
}
348348

349349
/* First try the file name given in the section. If that doesn't

gdb/dwarf2/read.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5859,7 +5859,7 @@ find_file_and_directory (struct die_info *die, struct dwarf2_cu *cu)
58595859
&& res.get_name () != nullptr
58605860
&& IS_ABSOLUTE_PATH (res.get_name ()))
58615861
{
5862-
res.set_comp_dir (ldirname (res.get_name ()));
5862+
res.set_comp_dir (gdb_ldirname (res.get_name ()));
58635863
res.set_name (make_unique_xstrdup (lbasename (res.get_name ())));
58645864
}
58655865

@@ -7434,7 +7434,7 @@ try_open_dwop_file (dwarf2_per_bfd *per_bfd, const char *file_name, int is_dwp,
74347434
search_path = per_bfd->captured_debug_dir.c_str ();
74357435

74367436
/* Add the path for the executable binary to the list of search paths. */
7437-
std::string objfile_dir = ldirname (per_bfd->filename ());
7437+
std::string objfile_dir = gdb_ldirname (per_bfd->filename ());
74387438
search_path_holder.reset (concat (objfile_dir.c_str (),
74397439
dirname_separator_string,
74407440
search_path, nullptr));
@@ -7807,7 +7807,7 @@ open_and_init_dwp_file (dwarf2_per_objfile *per_objfile)
78077807
struct objfile *backlink = objfile->separate_debug_objfile_backlink;
78087808
const char *backlink_basename = lbasename (backlink->original_name);
78097809

7810-
dwp_name = ldirname (objfile->original_name) + SLASH_STRING + backlink_basename;
7810+
dwp_name = gdb_ldirname (objfile->original_name) + SLASH_STRING + backlink_basename;
78117811
}
78127812
else
78137813
dwp_name = objfile->original_name;

gdb/python/python.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2446,7 +2446,7 @@ py_initialize ()
24462446
/foo/lib/pythonX.Y/...
24472447
This must be done before calling Py_Initialize. */
24482448
gdb::unique_xmalloc_ptr<char> progname
2449-
(concat (ldirname (python_libdir.c_str ()).c_str (), SLASH_STRING, "bin",
2449+
(concat (gdb_ldirname (python_libdir.c_str ()).c_str (), SLASH_STRING, "bin",
24502450
SLASH_STRING, "python", (char *) NULL));
24512451

24522452
{

gdb/symtab.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4492,7 +4492,7 @@ info_sources_filter::matches (const char *fullname) const
44924492
switch (m_match_type)
44934493
{
44944494
case match_on::DIRNAME:
4495-
dirname = ldirname (fullname);
4495+
dirname = gdb_ldirname (fullname);
44964496
to_match = dirname.c_str ();
44974497
break;
44984498
case match_on::BASENAME:

gdb/utils.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3333,7 +3333,7 @@ gdb_argv_as_array_view_test ()
33333333
argument. */
33343334

33353335
std::string
3336-
ldirname (const char *filename)
3336+
gdb_ldirname (const char *filename)
33373337
{
33383338
std::string dirname;
33393339
const char *base = lbasename (filename);

gdb/utils.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ struct set_batch_flag_and_restore_page_info
133133
extern int gdb_filename_fnmatch (const char *pattern, const char *string,
134134
int flags);
135135

136-
std::string ldirname (const char *filename);
136+
std::string gdb_ldirname (const char *filename);
137137

138138
extern int count_path_elements (const char *path);
139139

gdb/xml-syscall.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ xml_init_syscalls_info (const char *filename)
319319
if (!full_file)
320320
return NULL;
321321

322-
const std::string dirname = ldirname (filename);
322+
const std::string dirname = gdb_ldirname (filename);
323323
auto fetch_another = [&dirname] (const char *name)
324324
{
325325
return xml_fetch_content_from_file (name, dirname.c_str ());

gdb/xml-tdesc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -670,7 +670,7 @@ file_read_description_xml (const char *filename)
670670
return NULL;
671671
}
672672

673-
const std::string dirname = ldirname (filename);
673+
const std::string dirname = gdb_ldirname (filename);
674674
auto fetch_another = [&dirname] (const char *name)
675675
{
676676
return xml_fetch_content_from_file (name, dirname.c_str ());

0 commit comments

Comments
 (0)