From patchwork Thu Dec 8 12:01:44 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Schwinge X-Patchwork-Id: 18284 Received: (qmail 52686 invoked by alias); 8 Dec 2016 12:02:09 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 52663 invoked by uid 89); 8 Dec 2016 12:02:08 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=Sat, H*r:PST X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 08 Dec 2016 12:01:58 +0000 Received: from svr-orw-fem-02x.mgc.mentorg.com ([147.34.96.206] helo=SVR-ORW-FEM-02.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1cExOd-00055s-In from Thomas_Schwinge@mentor.com ; Thu, 08 Dec 2016 04:01:55 -0800 Received: from tftp-cs (147.34.91.1) by svr-orw-fem-02.mgc.mentorg.com (147.34.96.168) with Microsoft SMTP Server id 14.3.224.2; Thu, 8 Dec 2016 04:01:55 -0800 Received: by tftp-cs (Postfix, from userid 49978) id 7FA87C222B; Thu, 8 Dec 2016 04:01:54 -0800 (PST) From: Thomas Schwinge To: Antoine Tremblay , Simon Marchi , CC: Subject: Re: [PATCH v3 1/2] Emit inferior, thread and frame selection events to all UIs In-Reply-To: <20160924201331.23605-1-simon.marchi@polymtl.ca> References: <20160924201331.23605-1-simon.marchi@polymtl.ca> User-Agent: Notmuch/0.9-125-g4686d11 (http://notmuchmail.org) Emacs/24.5.1 (x86_64-pc-linux-gnu) Date: Thu, 8 Dec 2016 13:01:44 +0100 Message-ID: <87shpyiq8n.fsf@euler.schwinge.homeip.net> MIME-Version: 1.0 Hi! On Sat, 24 Sep 2016 16:13:30 -0400, Simon Marchi 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 > + : _(""))); > + 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? Grüße Thomas --- 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 - : _(""))); - 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 + : _(""))); } /* Prints the list of inferiors and their details on UIOUT. This is a