Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Simon Marchi via Gdb-patches <gdb-patches@sourceware.org>
To: Tom Tromey <tom@tromey.com>,
	Simon Marchi via Gdb-patches <gdb-patches@sourceware.org>
Subject: Re: [PATCH] gdb: convert auto-load to new-style debug macros
Date: Thu, 21 Jan 2021 14:11:17 -0500	[thread overview]
Message-ID: <32329128-6e61-3f4f-dcef-5166df5f63d1@polymtl.ca> (raw)
In-Reply-To: <878s8mw1p9.fsf@tromey.com>



On 2021-01-21 2:05 p.m., Tom Tromey wrote:
>>>>>> "Simon" == Simon Marchi via Gdb-patches <gdb-patches@sourceware.org> writes:
> 
> Simon> Function file_is_auto_load_safe was taking a format string and varargs
> Simon> just to output a debug print.  This is probably because that function is
> Simon> used in linux-thread-db.c and main.c, but debug_auto_load is static in
> Simon> auto-load.c.  I simplified that, making debug_auto_load visible outside
> Simon> of auto-load.c, and making the callers of file_is_auto_load_safe output
> Simon> the debug print themselves.
> 
> Simon> The rest is pretty much standard.
> 
> Simon> gdb/ChangeLog:
> 
> Simon> 	* auto-load.h (debug_auto_load): Move here.
> Simon> 	(auto_load_debug_printf): New.
> Simon> 	* auto-load.c: Use auto_load_debug_printf.
> Simon> 	(debug_auto_load): Move to header.
> Simon> 	* linux-thread-db.c (try_thread_db_load): Use
> Simon> 	auto_load_debug_printf.
> Simon> 	* main.c (captured_main_1): Likewise.
> 
> Thanks.  This seems like a nice cleanup.
> I have one comment.
> 
> Simon> -				     _("auto-load: Loading .gdbinit "
> Simon> -				       "file \"%s\".\n"),
> Simon> -				     local_gdbinit.c_str ()))
> Simon> +      if (!inhibit_gdbinit && auto_load_local_gdbinit)
> Simon>  	{
> Simon> -	  auto_load_local_gdbinit_loaded = 1;
> Simon> +	  auto_load_debug_printf ("Loading .gdbinit file \"%s\".",
> Simon> +				  local_gdbinit.c_str ());
> 
> Some of these changes lose the _() wrapper.
> I don't know if we care for debug logging .. or maybe we actively want
> to remove them in this case?  Anyway I thought I'd point it out.

I removed them on purpose (will add a mention in the commit log), because
I have not seen them used for logging elsewhere.  I don't really think
it's necessary.

I'll push with the mention added, and if I stumble on other places that
uses _ for logging, I'll remove it.

Thanks,

Simon

      reply	other threads:[~2021-01-21 19:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-21  3:40 Simon Marchi via Gdb-patches
2021-01-21 19:05 ` Tom Tromey
2021-01-21 19:11   ` Simon Marchi via Gdb-patches [this message]

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=32329128-6e61-3f4f-dcef-5166df5f63d1@polymtl.ca \
    --to=gdb-patches@sourceware.org \
    --cc=simon.marchi@polymtl.ca \
    --cc=tom@tromey.com \
    /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