aboutsummaryrefslogtreecommitdiff
path: root/gdb/build-id.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2021-12-26 14:10:05 -0700
committerTom Tromey <tom@tromey.com>2021-12-29 10:47:48 -0700
commit0bc1fe382ec7e9b68f9331e5c74586fa88e0199c (patch)
tree3cab3d4ece6f75089db81386e9743bd30dd246cc /gdb/build-id.c
parent3defe97705e325f2f3048b8c18321518a6c7e190 (diff)
downloadgdb-0bc1fe382ec7e9b68f9331e5c74586fa88e0199c.zip
gdb-0bc1fe382ec7e9b68f9331e5c74586fa88e0199c.tar.gz
gdb-0bc1fe382ec7e9b68f9331e5c74586fa88e0199c.tar.bz2
Use gdb_stdlog for separate debug file logging
This changes the separate debug file logging code (spread across two files) to use gdb_stdlog for its output. This is part of PR gdb/7233. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=7233
Diffstat (limited to 'gdb/build-id.c')
-rw-r--r--gdb/build-id.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/gdb/build-id.c b/gdb/build-id.c
index d68b7a7..e6da0ab 100644
--- a/gdb/build-id.c
+++ b/gdb/build-id.c
@@ -76,8 +76,8 @@ build_id_to_debug_bfd_1 (const std::string &link, size_t build_id_len,
{
if (separate_debug_file_debug)
{
- printf_unfiltered (_(" Trying %s..."), link.c_str ());
- gdb_flush (gdb_stdout);
+ fprintf_unfiltered (gdb_stdlog, _(" Trying %s..."), link.c_str ());
+ gdb_flush (gdb_stdlog);
}
/* lrealpath() is expensive even for the usually non-existent files. */
@@ -94,7 +94,8 @@ build_id_to_debug_bfd_1 (const std::string &link, size_t build_id_len,
if (filename == NULL)
{
if (separate_debug_file_debug)
- printf_unfiltered (_(" no, unable to compute real path\n"));
+ fprintf_unfiltered (gdb_stdlog,
+ _(" no, unable to compute real path\n"));
return {};
}
@@ -105,7 +106,7 @@ build_id_to_debug_bfd_1 (const std::string &link, size_t build_id_len,
if (debug_bfd == NULL)
{
if (separate_debug_file_debug)
- printf_unfiltered (_(" no, unable to open.\n"));
+ fprintf_unfiltered (gdb_stdlog, _(" no, unable to open.\n"));
return {};
}
@@ -113,13 +114,13 @@ build_id_to_debug_bfd_1 (const std::string &link, size_t build_id_len,
if (!build_id_verify (debug_bfd.get(), build_id_len, build_id))
{
if (separate_debug_file_debug)
- printf_unfiltered (_(" no, build-id does not match.\n"));
+ fprintf_unfiltered (gdb_stdlog, _(" no, build-id does not match.\n"));
return {};
}
if (separate_debug_file_debug)
- printf_unfiltered (_(" yes!\n"));
+ fprintf_unfiltered (gdb_stdlog, _(" yes!\n"));
return debug_bfd;
}
@@ -209,8 +210,9 @@ find_separate_debug_file_by_buildid (struct objfile *objfile)
if (build_id != NULL)
{
if (separate_debug_file_debug)
- printf_unfiltered (_("\nLooking for separate debug info (build-id) for "
- "%s\n"), objfile_name (objfile));
+ fprintf_unfiltered (gdb_stdlog,
+ _("\nLooking for separate debug info (build-id) for "
+ "%s\n"), objfile_name (objfile));
gdb_bfd_ref_ptr abfd (build_id_to_debug_bfd (build_id->size,
build_id->data));