From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24093 invoked by alias); 8 Dec 2016 15:25:57 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 24073 invoked by uid 89); 8 Dec 2016 15:25:56 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.2 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_SOFTFAIL autolearn=no version=3.3.2 spammy=H*f:sk:87shpyi, H*i:sk:87shpyi X-HELO: simark.ca Received: from simark.ca (HELO simark.ca) (158.69.221.121) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 08 Dec 2016 15:25:54 +0000 Received: by simark.ca (Postfix, from userid 33) id 1E82E1E18F; Thu, 8 Dec 2016 10:25:53 -0500 (EST) To: Thomas Schwinge Subject: Re: [PATCH v3 1/2] Emit inferior, thread and frame selection events to all UIs X-PHP-Originating-Script: 33:rcube.php MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Thu, 08 Dec 2016 15:25:00 -0000 From: Simon Marchi Cc: Antoine Tremblay , gdb-patches@sourceware.org, bug-hurd@gnu.org In-Reply-To: <87shpyiq8n.fsf@euler.schwinge.homeip.net> References: <20160924201331.23605-1-simon.marchi@polymtl.ca> <87shpyiq8n.fsf@euler.schwinge.homeip.net> Message-ID: <9abd06e0a89f0409f2797c34bd4c08f7@polymtl.ca> X-Sender: simon.marchi@polymtl.ca User-Agent: Roundcube Webmail/1.2.3 X-IsSubscribed: yes X-SW-Source: 2016-12/txt/msg00209.txt.bz2 On 2016-12-08 07:01, Thomas Schwinge wrote: > 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 > - : _(""))); > - 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 Yeah it looks much better. Also, if you want to factor out complexity from this big one liner by using temporary variables, I think it would improve it further. Thanks, Simon