Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Simon Marchi via Gdb-patches <gdb-patches@sourceware.org>
To: gdb-patches@sourceware.org
Subject: [PATCH 4/5] gdb: convert solib-aix to new-style debug macros
Date: Fri,  8 Jan 2021 23:28:15 -0500	[thread overview]
Message-ID: <20210109042816.4140840-4-simon.marchi@polymtl.ca> (raw)
In-Reply-To: <20210109042816.4140840-1-simon.marchi@polymtl.ca>

This is only compile-tested.

gdb/ChangeLog:

	* solib-aix.c (solib_aix_debug_printf): New, use throughout
	file.

Change-Id: I7ec4baa15ab5b8ad786212b8b9de61c2c447bac1
---
 gdb/solib-aix.c | 23 +++++++++++------------
 1 file changed, 11 insertions(+), 12 deletions(-)

diff --git a/gdb/solib-aix.c b/gdb/solib-aix.c
index 92a3345b06e2..a0dbdde4d49b 100644
--- a/gdb/solib-aix.c
+++ b/gdb/solib-aix.c
@@ -32,6 +32,11 @@
    this module.  */
 static bool solib_aix_debug;
 
+/* Print an "aix-solib" debug statement.  */
+
+#define solib_aix_debug_printf(fmt, ...) \
+  debug_prefixed_printf_cond (solib_aix_debug, "aix-solib",fmt, ##__VA_ARGS__)
+
 /* Our private data in struct so_list.  */
 
 struct lm_info_aix : public lm_info_base
@@ -250,10 +255,8 @@ solib_aix_get_library_list (struct inferior *inf, const char *warning_msg)
       return data->library_list;
     }
 
-  if (solib_aix_debug)
-    fprintf_unfiltered (gdb_stdlog,
-			"DEBUG: TARGET_OBJECT_LIBRARIES_AIX = \n%s\n",
-			library_document->data ());
+  solib_aix_debug_printf ("TARGET_OBJECT_LIBRARIES_AIX = %s",
+			  library_document->data ());
 
   data->library_list = solib_aix_parse_libraries (library_document->data ());
   if (!data->library_list.has_value () && warning_msg != NULL)
@@ -374,9 +377,7 @@ solib_aix_free_so (struct so_list *so)
 {
   lm_info_aix *li = (lm_info_aix *) so->lm_info;
 
-  if (solib_aix_debug)
-    fprintf_unfiltered (gdb_stdlog, "DEBUG: solib_aix_free_so (%s)\n",
-			so->so_name);
+  solib_aix_debug_printf ("%s", so->so_name);
 
   delete li;
 }
@@ -685,11 +686,9 @@ solib_aix_get_toc_value (CORE_ADDR pc)
 
   result = (obj_section_addr (data_osect)
 	    + xcoff_get_toc_offset (pc_osect->objfile));
-  if (solib_aix_debug)
-    fprintf_unfiltered (gdb_stdlog,
-			"DEBUG: solib_aix_get_toc_value (pc=%s) -> %s\n",
-			core_addr_to_string (pc),
-			core_addr_to_string (result));
+
+  solib_aix_debug_printf ("pc=%s -> %s", core_addr_to_string (pc),
+			  core_addr_to_string (result));
 
   return result;
 }
-- 
2.29.2


  parent reply	other threads:[~2021-01-09  4:28 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-09  4:28 [PATCH 1/5] gdb: change jit_debug to a bool Simon Marchi via Gdb-patches
2021-01-09  4:28 ` [PATCH 2/5] gdb: convert jit to new-style debug macros Simon Marchi via Gdb-patches
2021-01-11 21:18   ` Tom Tromey
2021-01-11 21:20     ` Simon Marchi via Gdb-patches
2021-01-09  4:28 ` [PATCH 3/5] gdb: convert aarch64 " Simon Marchi via Gdb-patches
2021-01-09  4:31   ` Simon Marchi via Gdb-patches
2021-01-11 13:18     ` Luis Machado via Gdb-patches
2021-01-11 21:30       ` Simon Marchi via Gdb-patches
2021-01-11 21:50         ` Luis Machado via Gdb-patches
2021-01-11 21:54           ` Simon Marchi via Gdb-patches
2021-01-09  4:28 ` Simon Marchi via Gdb-patches [this message]
2021-01-11 21:19   ` [PATCH 4/5] gdb: convert solib-aix " Tom Tromey
2021-01-11 21:32     ` Simon Marchi via Gdb-patches
2021-01-09  4:28 ` [PATCH 5/5] gdb: convert arc " Simon Marchi via Gdb-patches
2021-01-09  4:37   ` Simon Marchi via Gdb-patches
2021-01-13 15:35     ` Shahab Vahedi via Gdb-patches
2021-01-09  4:29 ` [PATCH 1/5] gdb: change jit_debug to a bool Simon Marchi via Gdb-patches
2021-01-11 21:17 ` Tom Tromey
2021-01-11 21:19   ` Simon Marchi via Gdb-patches
2021-01-13 14:32 ` Shahab Vahedi via Gdb-patches
2021-01-13 15:49   ` Simon Marchi via Gdb-patches

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210109042816.4140840-4-simon.marchi@polymtl.ca \
    --to=gdb-patches@sourceware.org \
    --cc=simon.marchi@polymtl.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox