Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: 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 12:05:06 -0700	[thread overview]
Message-ID: <878s8mw1p9.fsf@tromey.com> (raw)
In-Reply-To: <20210121034032.113861-1-simon.marchi@polymtl.ca> (Simon Marchi via Gdb-patches's message of "Wed, 20 Jan 2021 22:40:32 -0500")

>>>>> "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.

Tom

  reply	other threads:[~2021-01-21 19:05 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 [this message]
2021-01-21 19:11   ` 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=878s8mw1p9.fsf@tromey.com \
    --to=tom@tromey.com \
    --cc=gdb-patches@sourceware.org \
    /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