bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v3 1/2] Emit inferior, thread and frame selection events to a


From: Thomas Schwinge
Subject: Re: [PATCH v3 1/2] Emit inferior, thread and frame selection events to all UIs
Date: Thu, 8 Dec 2016 13:01:44 +0100
User-agent: Notmuch/0.9-125-g4686d11 (http://notmuchmail.org) Emacs/24.5.1 (x86_64-pc-linux-gnu)

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]