From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32056 invoked by alias); 7 May 2013 12:25:45 -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 31882 invoked by uid 89); 7 May 2013 12:25:39 -0000 X-Spam-SWARE-Status: No, score=-3.4 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,RCVD_IN_HOSTKARMA_NO,RP_MATCHES_RCVD,SPF_PASS,TW_XF autolearn=ham version=3.3.1 Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Tue, 07 May 2013 12:25:38 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id A6F362EDB1; Tue, 7 May 2013 08:25:36 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id LmMklkmAoNlu; Tue, 7 May 2013 08:25:36 -0400 (EDT) Received: from kwai.gnat.com (kwai.gnat.com [205.232.38.4]) by rock.gnat.com (Postfix) with ESMTP id 8A4452EDAB; Tue, 7 May 2013 08:25:36 -0400 (EDT) Received: by kwai.gnat.com (Postfix, from userid 4233) id 791C63FF09; Tue, 7 May 2013 08:25:36 -0400 (EDT) From: Joel Brobecker To: gdb-patches@sourceware.org Cc: Pedro Alves Subject: Re: FYI: copy/paste error in sol-thread.c ? Date: Tue, 07 May 2013 12:25:00 -0000 Message-Id: <1367929532-4849-1-git-send-email-brobecker@adacore.com> In-Reply-To: <518284AF.5090802@redhat.com> References: <518284AF.5090802@redhat.com> X-SW-Source: 2013-05/txt/msg00201.txt.bz2 > I agree it looks like a copy/paste. Ok, the first patch of this series fixes the code. > Very very very minor, but the prints look a little odd to me: > > > printf_filtered (" startfunc: %s\n", > > printf_filtered (" - Sleep func: %s\n" > > The first is lowercase, and doesn't start with '-', while the > other line is uppercase, and has a '-'... Looks odd. > It reads to me as if the original intention was to put this all > in the same line, but then the startfunc print includes \n, > breaking it... You are right. This is a copy of the current output: | (gdb) maintenance info sol-threads | user thread #1, lwp 1, (active) | system thread #2, lwp 2, (active) | system thread #3, lwp 0, (asleep) - Sleep func: 0xff32d9e0 | user thread #4, lwp 4, (asleep) startfunc: system.tasking.stages.task_wrapper | - Sleep func: 0xff3290f0 | system thread #5, lwp 7, (active) startfunc: _co_timerset Besides the lowercase/uppercase thing, two things are odd: - the '-' for thread #3 - the fact that "sleep func" gets printed on the next line for thread #4, with an indentation that makes it hard to read the info. It seems to me also that the initial intention was probably to have everything on the same line, and that seems fine to me, as this is only a maintenance command. So patch #2 makes a number of adjustments to the formatting of the output. In particular, for simplicity, I just got rid of the '-' altogether, and to compensate for the slight reduction in visual separation, I grouped the label and the value a little more tightly. And to boot, I wasn't very fond of the fact that the code printing the info was duplicated, so I factorized it a bit. This is also potentially a matter of taste - so I did not commit any of the patches yet. Tested on sparc-solaris by running the "maintenance info sol-threads" command by hand. That's probably as much time as I am willing to spend on this, and I think that's going to be sufficient anyway.