From: Thomas Schwinge <thomas@codesourcery.com>
To: Antoine Tremblay <antoine.tremblay@ericsson.com>,
Simon Marchi <simon.marchi@polymtl.ca>,
<gdb-patches@sourceware.org>
Cc: <bug-hurd@gnu.org>
Subject: Re: [PATCH v3 1/2] Emit inferior, thread and frame selection events to all UIs
Date: Thu, 08 Dec 2016 12:02:00 -0000 [thread overview]
Message-ID: <87shpyiq8n.fsf@euler.schwinge.homeip.net> (raw)
In-Reply-To: <20160924201331.23605-1-simon.marchi@polymtl.ca>
Hi!
On Sat, 24 Sep 2016 16:13:30 -0400, Simon Marchi <simon.marchi@polymtl.ca> wrote:
> --- a/gdb/inferior.c
> +++ b/gdb/inferior.c
> +void
> +print_selected_inferior (struct ui_out *uiout)
> +{
> + char buf[PATH_MAX + 256];
> + struct inferior *inf = current_inferior ();
> +
> + xsnprintf (buf, sizeof (buf),
> + _("[Switching to inferior %d [%s] (%s)]\n"),
> + inf->num,
> + inferior_pid_to_str (inf->pid),
> + (inf->pspace->pspace_exec_filename != NULL
> + ? inf->pspace->pspace_exec_filename
> + : _("<noexec>")));
> + ui_out_text (uiout, buf);
> +}
> +
On GNU/Hurd, there is no "#define PATH_MAX", so this fails to build.
(I'm aware that there is other PATH_MAX usage in GDB sources, which we
ought to fix at some point, for example in gdbserver -- which is not yet
enabled for GNU/Hurd.)
Unless I miss something, this issue could be addressed by simply using
ui_out_message instead of ui_out_text with a temporary "buf" -- OK to
push the following?
--- gdb/inferior.c
+++ gdb/inferior.c
@@ -556,17 +556,15 @@ inferior_pid_to_str (int pid)
void
print_selected_inferior (struct ui_out *uiout)
{
- char buf[PATH_MAX + 256];
struct inferior *inf = current_inferior ();
- xsnprintf (buf, sizeof (buf),
- _("[Switching to inferior %d [%s] (%s)]\n"),
- inf->num,
- inferior_pid_to_str (inf->pid),
- (inf->pspace->pspace_exec_filename != NULL
- ? inf->pspace->pspace_exec_filename
- : _("<noexec>")));
- ui_out_text (uiout, buf);
+ ui_out_message (uiout,
+ _("[Switching to inferior %d [%s] (%s)]\n"),
+ inf->num,
+ inferior_pid_to_str (inf->pid),
+ (inf->pspace->pspace_exec_filename != NULL
+ ? inf->pspace->pspace_exec_filename
+ : _("<noexec>")));
}
/* Prints the list of inferiors and their details on UIOUT. This is a
Grüße
Thomas
next prev parent reply other threads:[~2016-12-08 12:02 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-24 21:45 Simon Marchi
2016-09-24 20:13 ` [PATCH v3 2/2] Add test for user context selection sync Simon Marchi
2016-10-03 17:10 ` Pedro Alves
2016-10-03 17:48 ` Simon Marchi
2016-09-25 12:41 ` [PATCH v3 1/2] Emit inferior, thread and frame selection events to all UIs Eli Zaretskii
2016-09-26 2:25 ` Simon Marchi
2016-10-03 16:47 ` Pedro Alves
2016-10-03 17:40 ` Simon Marchi
2016-10-03 21:03 ` Simon Marchi
2016-12-08 12:02 ` Thomas Schwinge [this message]
2016-12-08 15:25 ` Simon Marchi
2016-12-09 6:22 ` Thomas Schwinge
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=87shpyiq8n.fsf@euler.schwinge.homeip.net \
--to=thomas@codesourcery.com \
--cc=antoine.tremblay@ericsson.com \
--cc=bug-hurd@gnu.org \
--cc=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