From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24661 invoked by alias); 7 Nov 2017 10:41:01 -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 24578 invoked by uid 89); 7 Nov 2017 10:40:59 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.0 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,MIME_BASE64_BLANKS,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: EUR01-VE1-obe.outbound.protection.outlook.com Received: from mail-ve1eur01on0048.outbound.protection.outlook.com (HELO EUR01-VE1-obe.outbound.protection.outlook.com) (104.47.1.48) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 07 Nov 2017 10:40:57 +0000 Received: from AM3PR08MB0101.eurprd08.prod.outlook.com (10.160.211.19) by AM3PR08MB0104.eurprd08.prod.outlook.com (10.160.211.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.197.13; Tue, 7 Nov 2017 10:40:53 +0000 Received: from AM3PR08MB0101.eurprd08.prod.outlook.com ([fe80::2891:52f2:59:8e54]) by AM3PR08MB0101.eurprd08.prod.outlook.com ([fe80::2891:52f2:59:8e54%16]) with mapi id 15.20.0197.020; Tue, 7 Nov 2017 10:40:52 +0000 From: Alan Hayward To: "gdb-patches@sourceware.org" CC: nd Subject: [PATCH] Better make rules for IPA objects Date: Tue, 07 Nov 2017 10:41:00 -0000 Message-ID: <9FD839CC-67AD-43A8-B28F-11F78BB6BC94@arm.com> authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alan.Hayward@arm.com; x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;AM3PR08MB0104;6:cOrccUSoer6dLsMy62LD/GDJXpBxyCs4HZOMIbP+oavbfZSJqJrz15LCkrSSS14/+94zXntN/VHlggDtWFGowaXx7D5ulKzJea6aR0wdcCrxxQdi5uRIINQfwCHRLIgtaJOCSw0iqUG9ZuXLhhWIpX6X3R0a6uepkYvYjsZLoQ+HO1/HtT1UE6F5hNjZyp061mIVhApSYqxQWVS/PkrBlQWYQk8wRVeocgP1AHnsFQ4bI7MDY9Js3DCUsXzC4J994XkTW0phc598KAOYB62GwISKcYAhFZocJ5QXuPzIxwWOQUJqGd2szStZTHNX59ZZZBrb+wFy7/Nc4aq9sLGPj1aL6/pkW4cmp9JK093mHjw=;5:wLcGdRgBEDQLhQ4KANJ+8cFgAYXskSI8BHE0QQMkB2SzJLwYzG65fRzkS63we6rib3s3hgnICUma6231lVcmTDqjGRGwT5tPzz03GYVTI/UgcFoNa65BgxpIXTq6tVG7PwvzdEeaAF3N8MnmqoUNpZN4O1wvgKBNfNqVcGHJu+A=;24:SpbdmqZUh4zUAi85RHGd6NTvcTmX12wlR/09TbcYstFad0VLevz4jDOLvPM/C7Cou2DkSqmgBrGNiZgITRrPa9/+NXZXC8Cl6z5+7G4Y9RI=;7:6T9j1XQQIQrJEHfI/De6BG9rEbu3XDs3i3S3d9T9jiucUGjI/TbIWQHEEODckoebo0bSARyI0BVqIZVASvTFOe8x6x7pIYRT8olvnLzUdqvIq3xinHnlwCfJHzqop+hoGB2roeagsUR6ozgm+adZr3uDy2abd7ks6SeJ6XER1+sZolLOOwWZyqWtrQfCjmVcGWOb0az7UZp155IqSpzMGVH91alDidfXJIULDwkXH1o9SscZutCk2AEFO4+LOolH x-ms-exchange-antispam-srfa-diagnostics: SSOS; x-ms-office365-filtering-correlation-id: 0b040e0c-f422-4702-2451-08d525cc04e7 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(48565401081)(2017052603199);SRVR:AM3PR08MB0104; x-ms-traffictypediagnostic: AM3PR08MB0104: nodisclaimer: True x-exchange-antispam-report-test: UriScan:(180628864354917); x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(93006095)(93001095)(10201501046)(100000703101)(100105400095)(3002001)(3231021)(6055026)(6041248)(20161123562025)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(20161123564025)(20161123558100)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:AM3PR08MB0104;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:AM3PR08MB0104; x-forefront-prvs: 0484063412 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(6009001)(39860400002)(346002)(376002)(189002)(199003)(377424004)(305945005)(478600001)(2906002)(54356999)(7736002)(6512007)(50986999)(53936002)(2501003)(86362001)(14454004)(36756003)(25786009)(105586002)(2900100001)(106356001)(101416001)(2351001)(33656002)(5660300001)(316002)(6916009)(6116002)(102836003)(3846002)(5250100002)(5640700003)(97736004)(189998001)(6506006)(82746002)(8676002)(6436002)(81156014)(81166006)(8936002)(99286004)(66066001)(72206003)(4326008)(3280700002)(3660700001)(68736007)(83716003)(6486002);DIR:OUT;SFP:1101;SCL:1;SRVR:AM3PR08MB0104;H:AM3PR08MB0101.eurprd08.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; received-spf: None (protection.outlook.com: arm.com does not designate permitted sender hosts) spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="utf-8" Content-ID: Content-Transfer-Encoding: base64 MIME-Version: 1.0 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0b040e0c-f422-4702-2451-08d525cc04e7 X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Nov 2017 10:40:52.6262 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM3PR08MB0104 X-IsSubscribed: yes X-SW-Source: 2017-11/txt/msg00136.txt.bz2 VGhpcyBwYXRjaCBzdHJlbmd0aGVucyB0aGUgcnVsZSBmb3IgY29tcGlsaW5n IGFyY2gvIGFuZCBjb21tb24vIGZpbGVzDQppbnRvIElQQS4NCg0KSW4gdGhl IGV4aXN0aW5nIGNvZGUsICJmb28taXBhLm8iIHdpbGwgdHJ5IHRvIG1hdGNo Og0KZm9vLWdlbmVyYXRlZC5jDQpmb28taXBhLmMNCmdkYnNlcnZlci9mb28u Yw0KY29tbW9uL2Zvby5jDQphcmNoL2Zvby5jDQoNCklmIHRoaXMgcG90ZW50 aWFsbHkgbWF0Y2hlZCBtdWx0aXBsZSBmaWxlcywgdGhlbiB0aGUgZmlyc3Qg aXMgbWF0Y2hlZC4NCg0KVGhpcyBwYXRjaCBjaGFuZ2VzIHRoZSBJUEEgcnVs ZXMgc28gdGhhdCBmaWxlcyBpbiBhcmNoLyBhbmQgY29tbW9uLyBhcmUNCmV4 cGxpY2l0bHkgbGlzdGVkIHVzaW5nIHRoZSBkaXJlY3RvcnkgbmFtZS4NCg0K QSBmdXR1cmUgcGF0Y2ggY291bGQgYmUgYWRkZWQgdG8gcmVtb3ZlIHRoZSBh bWJpZ3VpdHkgZnJvbSB0aGUgZmlyc3QgdGhyZWUNCm1hdGNoZXMuIEknbSBu b3QgcGxhbm5pbmcgb24gbWFraW5nIHRoYXQgY2hhbmdlLg0KDQpUaGlzIGNo YW5nZWQgaXMgcmVxdWlyZWQgYXMgcGFydCBvZiBtb3ZpbmcgYWFyY2g2NC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1pbmd3KikJc3J2X3JlZ29iaj0iIg0KIAkJCXNydl90Z3RvYmo9 Ing4Ni1sb3cubyB4ODYtZHJlZ3MubyBpMzg3LWZwLm8gd2luMzItbG93Lm8g d2luMzItaTM4Ni1sb3cub+KAnQ0KDQoNCg== >From gdb-patches-return-143265-listarch-gdb-patches=sources.redhat.com@sourceware.org Tue Nov 07 10:49:20 2017 Return-Path: Delivered-To: listarch-gdb-patches@sources.redhat.com Received: (qmail 107612 invoked by alias); 7 Nov 2017 10:49:20 -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 Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 107540 invoked by uid 89); 7 Nov 2017 10:49:19 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 07 Nov 2017 10:49:18 +0000 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 14BCE81E01; Tue, 7 Nov 2017 10:49:17 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 14BCE81E01 Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=palves@redhat.com Received: from [127.0.0.1] (ovpn04.gateway.prod.ext.ams2.redhat.com [10.39.146.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1E0A7600D2; Tue, 7 Nov 2017 10:49:15 +0000 (UTC) Subject: Re: [RFA] Fix regression in "commands" To: Tom Tromey , gdb-patches@sourceware.org References: <20171103190747.389-1-tom@tromey.com> From: Pedro Alves Message-ID: <3a860acf-6e64-b2ba-e3fd-560406077259@redhat.com> Date: Tue, 07 Nov 2017 10:49:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <20171103190747.389-1-tom@tromey.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2017-11/txt/msg00137.txt.bz2 Content-length: 4751 On 11/03/2017 07:07 PM, Tom Tromey wrote: > Pedro pointed out a regression in "commands", where trying to clear a > breakpoint's command list would fail: > > (top-gdb) commands > Type commands for breakpoint(s) 3, one per line. > End with a line saying just "end". > >end > No breakpoints specified. > (top-gdb) > > I believe the bug was introduced by my patch that changes > counted_command_line to be a shared_ptr. This causes the problem > because now the counted_command_line in commands_command_1 can be NULL, > whereas previously it never could be. > > The fix here is to track whether commands have been read using a > separate flag. > > 2017-11-03 Tom Tromey > > * breakpoint.c (commands_command_1): Use a flag to track whether > commands have been read. > > 2017-11-03 Tom Tromey > > * gdb.base/break.exp: Add test for empty "commands". > --- > gdb/ChangeLog | 5 +++++ > gdb/breakpoint.c | 7 +++++-- > gdb/testsuite/ChangeLog | 4 ++++ > gdb/testsuite/gdb.base/break.exp | 5 +++++ > 4 files changed, 19 insertions(+), 2 deletions(-) > > diff --git a/gdb/ChangeLog b/gdb/ChangeLog > index 1f823ca..0dc20bf 100644 > --- a/gdb/ChangeLog > +++ b/gdb/ChangeLog > @@ -1,3 +1,8 @@ > +2017-11-03 Tom Tromey > + > + * breakpoint.c (commands_command_1): Use a flag to track whether > + commands have been read. > + > 2017-11-03 Ulrich Weigand > > * doublest.c (convert_doublest_to_floatformat): Fix uninitialized > diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c > index 0bf47d5..609f1ed 100644 > --- a/gdb/breakpoint.c > +++ b/gdb/breakpoint.c > @@ -1255,6 +1255,7 @@ commands_command_1 (const char *arg, int from_tty, > struct command_line *control) > { > counted_command_line cmd; > + bool read_commands = false; > > std::string new_arg; > > @@ -1271,7 +1272,7 @@ commands_command_1 (const char *arg, int from_tty, > map_breakpoint_numbers > (arg, [&] (breakpoint *b) > { > - if (cmd == NULL) > + if (!read_commands) > { > if (control != NULL) > cmd = copy_command_lines (control->body_list[0]); > @@ -1288,6 +1289,8 @@ commands_command_1 (const char *arg, int from_tty, > ? check_tracepoint_command : 0), > b); > } > + > + read_commands = true; > } > > /* If a breakpoint was on the list more than once, we don't need to > @@ -1300,7 +1303,7 @@ commands_command_1 (const char *arg, int from_tty, > } > }); > > - if (cmd == NULL) > + if (!read_commands) > error (_("No breakpoints specified.")); Hmm, for the truly "no breakpoints specified" case, it seems to me that before we can reach this error, we've already hit the error at the top of map_breakpoint_numbers: if (args == 0 || *args == '\0') error_no_arg (_("one or more breakpoint numbers")); and for the case where the user specifies some argument that doesn't match any breakpoint, map_breakpoint_numbers already printed one of: warning (_("bad breakpoint number at or near '%s'"), p); printf_unfiltered (_("No breakpoint number %d.\n"), num); when the "No breakpoints specified." error is reached. E.g.: (gdb) commands asdf warning: bad breakpoint number at or near 'asdf' No breakpoints specified. (gdb) commands 123 No breakpoint number 123. No breakpoints specified. The "No breakpoints specified" error here looks a bit strange to me, since I did specify something. So I'm wondering what's the actual command line that we'd want to reach this error call here. I note that "disable", "delete", etc. don't have this error. Maybe it predated use of map_breakpoint_numbers and/or error_no_arg? Shouldn't we just remove it? > diff --git a/gdb/testsuite/gdb.base/break.exp b/gdb/testsuite/gdb.base/break.exp > index 96e2f35..604d957 100644 > --- a/gdb/testsuite/gdb.base/break.exp > +++ b/gdb/testsuite/gdb.base/break.exp > @@ -854,3 +854,8 @@ gdb_test_no_output "set \$foo=81.5" \ > gdb_test "break $srcfile:\$foo" \ > "Convenience variables used in line specs must have integer values.*" \ > "set breakpoint via non-integer convenience variable disallowed" > + > + > +# Test that commands can be cleared without error. > +gdb_test "commands\nend" ">end" "clear breakpoint commands" > + It'd be nice to extend this testcase a little bit more, to check whether this works on a breakpoint that actually had commands set (as opposed to silently doing nothing) and also to make sure that the commands were actually cleared, from "info breakpoints"s output, for example. I wonder whether gdb.base/commands.exp is a better home for this. Thanks, Pedro Alves