Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] gdb: remove tailing newlines from index_cache_debug calls
@ 2022-02-07 20:45 Andrew Burgess via Gdb-patches
  2022-02-08  0:10 ` Simon Marchi via Gdb-patches
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Burgess via Gdb-patches @ 2022-02-07 20:45 UTC (permalink / raw)
  To: gdb-patches; +Cc: Andrew Burgess

I noticed that most of the calls to index_cache_debug include a
trailing newline.  As the new debug mechanism already adds a newline,
that means all of these debug calls result in a blank line being
printed, which I think is a mistake.

Remove all the trailing newlines.

I also reformatted one of the index_cache_debug where a string will
now fit onto a single line.

Unless 'set debug index-cache on' is used, there should be no visible
change in output after this commit.
---
 gdb/dwarf2/index-cache.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/gdb/dwarf2/index-cache.c b/gdb/dwarf2/index-cache.c
index fa6b7abccd5..fd76917c68b 100644
--- a/gdb/dwarf2/index-cache.c
+++ b/gdb/dwarf2/index-cache.c
@@ -63,7 +63,7 @@ index_cache::set_directory (std::string dir)
 
   m_dir = std::move (dir);
 
-  index_cache_debug ("now using directory %s\n", m_dir.c_str ());
+  index_cache_debug ("now using directory %s", m_dir.c_str ());
 }
 
 /* See dwarf-index-cache.h.  */
@@ -71,7 +71,7 @@ index_cache::set_directory (std::string dir)
 void
 index_cache::enable ()
 {
-  index_cache_debug ("enabling (%s)\n", m_dir.c_str ());
+  index_cache_debug ("enabling (%s)", m_dir.c_str ());
 
   m_enabled = true;
 }
@@ -81,7 +81,7 @@ index_cache::enable ()
 void
 index_cache::disable ()
 {
-  index_cache_debug ("disabling\n");
+  index_cache_debug ("disabling");
 
   m_enabled = false;
 }
@@ -100,7 +100,7 @@ index_cache::store (dwarf2_per_objfile *per_objfile)
   const bfd_build_id *build_id = build_id_bfd_get (obj->obfd);
   if (build_id == nullptr)
     {
-      index_cache_debug ("objfile %s has no build id\n",
+      index_cache_debug ("objfile %s has no build id",
 			 objfile_name (obj));
       return;
     }
@@ -118,7 +118,7 @@ index_cache::store (dwarf2_per_objfile *per_objfile)
 
       if (dwz_build_id == nullptr)
 	{
-	  index_cache_debug ("dwz objfile %s has no build id\n",
+	  index_cache_debug ("dwz objfile %s has no build id",
 			     dwz->filename ());
 	  return;
 	}
@@ -143,7 +143,7 @@ index_cache::store (dwarf2_per_objfile *per_objfile)
 	  return;
 	}
 
-      index_cache_debug ("writing index cache for objfile %s\n",
+      index_cache_debug ("writing index cache for objfile %s",
 			 objfile_name (obj));
 
       /* Write the index itself to the directory, using the build id as the
@@ -154,8 +154,8 @@ index_cache::store (dwarf2_per_objfile *per_objfile)
     }
   catch (const gdb_exception_error &except)
     {
-      index_cache_debug ("couldn't store index cache for objfile "
-			 "%s: %s", objfile_name (obj), except.what ());
+      index_cache_debug ("couldn't store index cache for objfile %s: %s",
+			 objfile_name (obj), except.what ());
     }
 }
 
@@ -195,7 +195,7 @@ index_cache::lookup_gdb_index (const bfd_build_id *build_id,
 
   try
     {
-      index_cache_debug ("trying to read %s\n",
+      index_cache_debug ("trying to read %s",
 			 filename.c_str ());
 
       /* Try to map that file.  */
@@ -211,7 +211,7 @@ index_cache::lookup_gdb_index (const bfd_build_id *build_id,
     }
   catch (const gdb_exception_error &except)
     {
-      index_cache_debug ("couldn't read %s: %s\n",
+      index_cache_debug ("couldn't read %s: %s",
 			 filename.c_str (), except.what ());
     }
 
-- 
2.25.4


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] gdb: remove tailing newlines from index_cache_debug calls
  2022-02-07 20:45 [PATCH] gdb: remove tailing newlines from index_cache_debug calls Andrew Burgess via Gdb-patches
@ 2022-02-08  0:10 ` Simon Marchi via Gdb-patches
  2022-02-08  9:23   ` Andrew Burgess via Gdb-patches
  0 siblings, 1 reply; 3+ messages in thread
From: Simon Marchi via Gdb-patches @ 2022-02-08  0:10 UTC (permalink / raw)
  To: Andrew Burgess, gdb-patches



On 2022-02-07 15:45, Andrew Burgess via Gdb-patches wrote:
> I noticed that most of the calls to index_cache_debug include a
> trailing newline.  As the new debug mechanism already adds a newline,
> that means all of these debug calls result in a blank line being
> printed, which I think is a mistake.
> 
> Remove all the trailing newlines.
> 
> I also reformatted one of the index_cache_debug where a string will
> now fit onto a single line.
> 
> Unless 'set debug index-cache on' is used, there should be no visible
> change in output after this commit.

Thanks for doing this, it's surely an oversight on my part.  I think it's an obvious change.

Simon

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] gdb: remove tailing newlines from index_cache_debug calls
  2022-02-08  0:10 ` Simon Marchi via Gdb-patches
@ 2022-02-08  9:23   ` Andrew Burgess via Gdb-patches
  0 siblings, 0 replies; 3+ messages in thread
From: Andrew Burgess via Gdb-patches @ 2022-02-08  9:23 UTC (permalink / raw)
  To: Simon Marchi, gdb-patches

Simon Marchi via Gdb-patches <gdb-patches@sourceware.org> writes:

> On 2022-02-07 15:45, Andrew Burgess via Gdb-patches wrote:
>> I noticed that most of the calls to index_cache_debug include a
>> trailing newline.  As the new debug mechanism already adds a newline,
>> that means all of these debug calls result in a blank line being
>> printed, which I think is a mistake.
>> 
>> Remove all the trailing newlines.
>> 
>> I also reformatted one of the index_cache_debug where a string will
>> now fit onto a single line.
>> 
>> Unless 'set debug index-cache on' is used, there should be no visible
>> change in output after this commit.
>
> Thanks for doing this, it's surely an oversight on my part.  I think it's an obvious change.

Thanks, pushed.

Andrew


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-02-08  9:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-07 20:45 [PATCH] gdb: remove tailing newlines from index_cache_debug calls Andrew Burgess via Gdb-patches
2022-02-08  0:10 ` Simon Marchi via Gdb-patches
2022-02-08  9:23   ` Andrew Burgess via Gdb-patches

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox