From patchwork Wed Aug 8 22:14:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Marchi X-Patchwork-Id: 28799 Received: (qmail 79011 invoked by alias); 8 Aug 2018 22:14:53 -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 78983 invoked by uid 89); 8 Aug 2018 22:14:52 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_PASS autolearn=ham version=3.3.2 spammy=H*r:sk:NAM03-C, H*RU:sk:NAM03-C, Hx-spam-relays-external:sk:NAM03-C, HX-HELO:sk:sessmg2 X-HELO: sessmg23.ericsson.net Received: from sessmg23.ericsson.net (HELO sessmg23.ericsson.net) (193.180.251.45) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 08 Aug 2018 22:14:51 +0000 DKIM-Signature: v=1; a=rsa-sha256; d=ericsson.com; s=mailgw201801; c=relaxed/simple; q=dns/txt; i=@ericsson.com; t=1533766488; h=From:Sender:Reply-To:Subject:Date:Message-ID:To:CC:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=AKyXAjui4QYbjg5xaaFcSoxXSFWRt6eceqqrKs8/44c=; b=QkWTkKOMPPjIyng31Bw8S6J4skx29m71QNkLpC+DZveVVqRVs69NWtQoXVP6B6tW DVPoTrw981T5NnHwscCpIqlNzBFQjMsntJo0Ug6RSnx4Gjps7AHdvJ2iytLhSauo uVze8xU7bLo9tiLP5tBPFPZvh4iOOCKijYvr6auq2Zw=; Received: from ESESSMB502.ericsson.se (Unknown_Domain [153.88.183.120]) by sessmg23.ericsson.net (Symantec Mail Security) with SMTP id 1B.83.22015.85B6B6B5; Thu, 9 Aug 2018 00:14:48 +0200 (CEST) Received: from ESESBMB502.ericsson.se (153.88.183.169) by ESESSMB502.ericsson.se (153.88.183.163) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3; Thu, 9 Aug 2018 00:14:48 +0200 Received: from NAM03-CO1-obe.outbound.protection.outlook.com (153.88.183.157) by ESESBMB502.ericsson.se (153.88.183.169) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3 via Frontend Transport; Thu, 9 Aug 2018 00:14:47 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericsson.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=F+rexs1lEskXimpJpLoQTo7tfM8WgD5Ha7KpdgtYg60=; b=lcBMyzw2gnSVjq1YcNyStzQKBbbfhELX/1RjJScnyCimtzjud7QB4UF0APuENQPpeEYQHTx+A4cenVzYzqpW5e6iXXKJ2CaGO3Jmk7aB5XxBJCMdzdrdz1ECMPdj12T2l6n21iqQl0OvQ736aCCr1i4MNqAcVTsKZTm8g/JEY+s= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=simon.marchi@ericsson.com; Received: from [10.0.0.110] (192.222.164.54) by BYAPR15MB2391.namprd15.prod.outlook.com (2603:10b6:a02:8c::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1038.20; Wed, 8 Aug 2018 22:14:44 +0000 Subject: Re: [pushed] Make target_options_to_string return an std::string To: Tom Tromey , Simon Marchi CC: References: <20180808014216.30089-1-simon.marchi@polymtl.ca> <878t5gao5d.fsf@tromey.com> From: Simon Marchi Message-ID: <70adb666-e0c5-6059-601f-90f151417802@ericsson.com> Date: Wed, 8 Aug 2018 18:14:33 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <878t5gao5d.fsf@tromey.com> Return-Path: simon.marchi@ericsson.com Received-SPF: None (protection.outlook.com: ericsson.com does not designate permitted sender hosts) X-IsSubscribed: yes On 2018-08-08 11:11 AM, Tom Tromey wrote: >>>>>> "Simon" == Simon Marchi writes: > > Simon> Return an std::string instead of a char *, saving some manual freeing. > Simon> I only manually tested with "set debug target 1" and "set debug lin-lwp > Simon> 1", since this only deals with debug output. > > Simon> -/* Concatenate ELEM to LIST, a comma separate list, and return the > Simon> - result. The LIST incoming argument is released. */ > Simon> +/* Concatenate ELEM to LIST, a comma separate list. */ > > I think this should read "comma-separated". > > Other than that nit, this looks good to me. Good catch, here's what I pushed: From fdbac7d8d1c9403a857db6e0c1dc92ce7bb65925 Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Wed, 8 Aug 2018 18:13:18 -0400 Subject: [PATCH] Fix some comments in target.c Fix a typo and add a missing one. gdb/ChangeLog: * target.c (str_comma_list_concat_elem): Fix typo in comment. (target_options_to_string): Add comment. --- gdb/ChangeLog | 5 +++++ gdb/target.c | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 49a7e39..4d0593f 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2018-08-08 Simon Marchi + + * target.c (str_comma_list_concat_elem): Fix typo in comment. + (target_options_to_string): Add comment. + 2018-08-08 Tom Tromey * unittests/scoped_mmap-selftests.c: Check result of "write". diff --git a/gdb/target.c b/gdb/target.c index 115e9ae..2d98954 100644 --- a/gdb/target.c +++ b/gdb/target.c @@ -3447,7 +3447,7 @@ target_continue (ptid_t ptid, enum gdb_signal signal) target_resume (ptid, 0, signal); } -/* Concatenate ELEM to LIST, a comma separate list. */ +/* Concatenate ELEM to LIST, a comma-separated list. */ static void str_comma_list_concat_elem (std::string *list, const char *elem) @@ -3473,6 +3473,8 @@ do_option (int *target_options, std::string *ret, } } +/* See target.h. */ + std::string target_options_to_string (int target_options) {