From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 105474 invoked by alias); 13 Aug 2019 21:00:44 -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 105460 invoked by uid 89); 13 Aug 2019 21:00:44 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-6.6 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS autolearn=ham version=3.3.1 spammy= X-HELO: gateway21.websitewelcome.com Received: from gateway21.websitewelcome.com (HELO gateway21.websitewelcome.com) (192.185.46.113) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 13 Aug 2019 21:00:42 +0000 Received: from cm16.websitewelcome.com (cm16.websitewelcome.com [100.42.49.19]) by gateway21.websitewelcome.com (Postfix) with ESMTP id 5ED79400D05D2 for ; Tue, 13 Aug 2019 16:00:41 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id xduLhkbE34FKpxduLhrY0d; Tue, 13 Aug 2019 16:00:41 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=kVTqa7cg+gFewFEebGKJutcHxVJ4QZqQef7s9kgMPZw=; b=YzuxRFtMk3EeIAZDW1i+zyrReE uj8s8jbr81GLkkybVwA2pP0O1/IrRvzKu4k6QWcL5ygA7IpSqgW4WOqbzNFFK+4eBLzV0BE82M1qD ksXQUhB4KGczIpvACG2TaT6DR; Received: from 97-122-178-82.hlrn.qwest.net ([97.122.178.82]:38568 helo=murgatroyd) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from ) id 1hxduK-001GIf-Qf; Tue, 13 Aug 2019 16:00:40 -0500 From: Tom Tromey To: Philippe Waroquiers Cc: gdb-patches@sourceware.org Subject: Re: [RFAv2] Output the Ada task name in more messages, output task names between "". References: <20190804151051.3356-1-philippe.waroquiers@skynet.be> Date: Tue, 13 Aug 2019 21:00:00 -0000 In-Reply-To: <20190804151051.3356-1-philippe.waroquiers@skynet.be> (Philippe Waroquiers's message of "Sun, 4 Aug 2019 17:10:51 +0200") Message-ID: <8736i4wzk8.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2019-08/txt/msg00278.txt.bz2 >>>>> "Philippe" == Philippe Waroquiers writes: Philippe> Also, task names are output between double quotes, similarly to what GDB Philippe> does for thread names. Philippe> (gdb) info task Philippe> ID TID P-ID Pri State Name Philippe> * 1 555555759030 48 Runnable "main_task" I am not sure about using the quoting here. I had talked my way into it, but then I saw the implementation... Philippe> +static std::string Philippe> +task_to_str (int taskno, const ada_task_info *task_info) Philippe> +{ Philippe> + if (task_info->name[0] == '\0') Looks like this function has too much indentation. Philippe> + const struct ada_task_info *const task_info = Philippe> + &data->task_list[taskno - 1]; The "=" should be on the next line here. Philippe> + if (uiout->is_mi_like_p ()) Philippe> + uiout->field_string ("name", Philippe> + task_info->name[0] != '\0' ? task_info->name Philippe> + : _("")); Philippe> + else Philippe> + { Philippe> + uiout->field_fmt ("name", Philippe> + "\"%s\"", Philippe> + task_info->name[0] != '\0' ? task_info->name Philippe> + : _("")); Philippe> + } I'm not a big fan of using is_mi_like_p in general, and here it seems especially ugly. thanks, Tom