From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 43401 invoked by alias); 20 Feb 2017 11:19:58 -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 43390 invoked by uid 89); 20 Feb 2017 11:19:57 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00,MIME_BASE64_BLANKS,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy=Hayward, hayward, 170208, sk:native- X-HELO: EUR02-AM5-obe.outbound.protection.outlook.com Received: from mail-eopbgr00081.outbound.protection.outlook.com (HELO EUR02-AM5-obe.outbound.protection.outlook.com) (40.107.0.81) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 20 Feb 2017 11:19:55 +0000 Received: from VI1PR0801MB1822.eurprd08.prod.outlook.com (10.168.68.7) by VI1PR0801MB1822.eurprd08.prod.outlook.com (10.168.68.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.919.13; Mon, 20 Feb 2017 11:19:52 +0000 Received: from VI1PR0801MB1822.eurprd08.prod.outlook.com ([10.168.68.7]) by VI1PR0801MB1822.eurprd08.prod.outlook.com ([10.168.68.7]) with mapi id 15.01.0919.015; Mon, 20 Feb 2017 11:19:52 +0000 From: Alan Hayward To: Yao Qi CC: Pedro Alves , Joel Brobecker , "gdb-patches@sourceware.org" , nd Subject: Re: [PATCH] Removal of uses of MAX_REGISTER_SIZE Date: Mon, 20 Feb 2017 11:19:00 -0000 Message-ID: <0D96BC74-B486-49BC-A4AA-B3187C4E91F9@arm.com> References: <20170203102819.GA11916@E107787-LIN> <25716edf-096e-20c5-4170-fb8ca04d897b@redhat.com> <0C6A0D51-4C49-4400-8C46-E77DD512DF56@arm.com> <20170203165022.GB11916@E107787-LIN> <1E0030CE-FB37-4821-AA53-9C6D1CC285C9@arm.com> <20170206152635.GE11916@E107787-LIN> <5F3D30AE-9A53-493A-B6DC-DF594C2FAB18@arm.com> <86inokq39w.fsf@gmail.com> <9DD2B6B8-9FC3-4339-996F-F58B387190EC@arm.com> <20170218231843.olcxjbu367cqtcic@localhost> In-Reply-To: <20170218231843.olcxjbu367cqtcic@localhost> authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alan.Hayward@arm.com; x-ms-exchange-messagesentrepresentingtype: 1 x-ms-office365-filtering-correlation-id: 32e70ed4-2832-4f40-a74b-08d4598263d2 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(48565401081);SRVR:VI1PR0801MB1822; x-microsoft-exchange-diagnostics: 1;VI1PR0801MB1822;7:9OaW8ti+jRWzuYjiJ+JZ4BGJUOtEYvItWEKtd8Pxtb+BSzM1CEfRzq9ndKLQtMwLc+QuPTAuMfaphsAmThansZ+lGnUTQc1yK+svUPMk2eHl4y6O3sdjjVWpePGWJ9w3Lwb8jqc3Q0AuS53Ln67ATTwa6xzMA1FUXmYrBEBXWQkpwFTvCbRtiLFwAvVd1A7kIzrb02n1i8yPX1xclRX24aw5JEhLohRfwODexVAR0v8JNlfChvrfbbSKYBQSwjg18mW2B2CSvauAiy58akQ88r9VWWgRPHXxf6gYk0sb5YsJk7xWbbGnt/M+2DpIrXqQ1EOm5I7Zc+cyXjuJ7I0nuQ== nodisclaimer: True x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(180628864354917); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040375)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6055026)(6041248)(20161123555025)(20161123564025)(20161123562025)(20161123560025)(20161123558025)(6072148);SRVR:VI1PR0801MB1822;BCL:0;PCL:0;RULEID:;SRVR:VI1PR0801MB1822; x-forefront-prvs: 02243C58C6 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(6009001)(7916002)(39850400002)(39450400003)(39840400002)(39410400002)(199003)(377424004)(189002)(24454002)(2900100001)(76176999)(6506006)(50986999)(6436002)(81166006)(6246003)(81156014)(5660300001)(105586002)(106116001)(2950100002)(6916009)(3280700002)(106356001)(83716003)(25786008)(1411001)(97736004)(189998001)(66066001)(6486002)(8676002)(77096006)(54356999)(229853002)(86362001)(2906002)(3846002)(33656002)(305945005)(7736002)(6512007)(122556002)(99286003)(38730400002)(92566002)(3660700001)(4326007)(110136004)(39060400002)(53546006)(68736007)(82746002)(53936002)(93886004)(102836003)(101416001)(8936002)(36756003)(6116002)(54906002)(104396002);DIR:OUT;SFP:1101;SCL:1;SRVR:VI1PR0801MB1822;H:VI1PR0801MB1822.eurprd08.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX: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: <4E24EEC30150434A9F99CE9E2117065A@eurprd08.prod.outlook.com> Content-Transfer-Encoding: base64 MIME-Version: 1.0 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Feb 2017 11:19:51.7789 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0801MB1822 X-SW-Source: 2017-02/txt/msg00536.txt.bz2 DQo+IE9uIDE4IEZlYiAyMDE3LCBhdCAyMzoxOCwgWWFvIFFpIDxxaXlhb2x0 Y0BnbWFpbC5jb20+IHdyb3RlOg0KPiANCj4gT24gMTctMDItMDggMTQ6NDQ6 MzgsIEFsYW4gSGF5d2FyZCB3cm90ZToNCj4+IA0KPj4gT2ssIGNoYW5nZWQg YXMgcmVxdWVzdGVkLg0KPj4gDQo+PiBBbGFuLg0KPj4gDQo+PiAyMDE3LTAy LTA4ICBBbGFuIEhheXdhcmQgIDxhbGFuLmhheXdhcmRAYXJtLmNvbT4NCj4+ IA0KPj4gCSogc3RhY2suYyAoZnJhbWVfaW5mbyk6IFVzZSBmcmFtZV91bndp bmRfcmVnaXN0ZXJfdmFsdWUgdG8gYXZvaWQgYnVmLg0KPiANCj4gVGhpcyBs aW5lIGlzIHRvbyBsb25nLg0KPiANCj4gRGlkIHlvdSBydW4gcmVncmVzc2lv biB0ZXN0IHdpdGggYm9hcmQgZmlsZSB1bml4IGFuZCBuYXRpdmUtZ2Ric2Vy dmVyPw0KPiANCj4gUGF0Y2ggaXMgZ29vZCB0byBtZSBpZiBpdCBpcyByZWdy ZXNzaW9uLWZyZWUuDQo+IA0KPiAtLSANCj4gWWFvIA0KDQpZZXMsIEnigJl2 ZSBydW4gYSB1bml4IGFuZCBuYXRpdmUtZ2Ric2VydmVyIHJ1biB3aXRoIHRo ZSB0aHJlZSBwYXRjaGVzOg0KKkkzODYgKyBNNjhLIGNoYW5nZXMNCipzdGFj ay5jIGNoYW5nZXMNCiptaS1tYWluIGNoYW5nZXMNCg0KDQpBbGFuLg== >From gdb-patches-return-137160-listarch-gdb-patches=sources.redhat.com@sourceware.org Mon Feb 20 11:41:48 2017 Return-Path: Delivered-To: listarch-gdb-patches@sources.redhat.com Received: (qmail 101992 invoked by alias); 20 Feb 2017 11:41:48 -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 101978 invoked by uid 89); 20 Feb 2017 11:41:47 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=evolve, wish 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; Mon, 20 Feb 2017 11:41:46 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7C7C13D94D; Mon, 20 Feb 2017 11:41:46 +0000 (UTC) Received: from [127.0.0.1] (ovpn04.gateway.prod.ext.ams2.redhat.com [10.39.146.4]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v1KBfeIi027902; Mon, 20 Feb 2017 06:41:40 -0500 Subject: Re: [PATCH 5/8] DWARF-5 basic functionality To: Jan Kratochvil References: <148693097396.9024.2288256732840761882.stgit@host1.jankratochvil.net> <148693100178.9024.12379587332727380536.stgit@host1.jankratochvil.net> <18b01458-037f-d871-8195-19731a35d38e@redhat.com> <20170219212630.GC1291@host1.jankratochvil.net> Cc: gdb-patches@sourceware.org, Victor Leschuk From: Pedro Alves Message-ID: Date: Mon, 20 Feb 2017 11:41: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: <20170219212630.GC1291@host1.jankratochvil.net> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2017-02/txt/msg00537.txt.bz2 Content-length: 1861 On 02/19/2017 09:26 PM, Jan Kratochvil wrote: >>> -/* Call CALLBACK from DW_AT_ranges attribute value OFFSET. >>> +/* Call CALLBACK from DW_AT_ranges attribute value OFFSET >>> + reading .debug_rnglists. >>> + Return 1 if the attributes are present and valid, otherwise, return 0. */ >>> + >>> +static int >>> +dwarf2_rnglists_process (unsigned offset, struct dwarf2_cu *cu, >> >> bool/true/false? > > It is just a variant of dwarf2_ranges_process which still does use int from > the C days of GDB. > Its return value is also passed as a return value of > dwarf2_ranges_process. Using bool here would need to refactor > dwarf2_ranges_process first. Why would it? bool converts to int just fine. You're already using bool inside the function, which prompted my comment. Not that I'd be opposed to changing dwarf2_ranges_process too, but I'm not seeing the "need". If we stick with the easy incremental progress, then over time using "int" as bool ends up fading that way. If we keep using "int" as bool, then we'll never evolve past it. > And then one can rather refactor it all to > a virtual class and after more refactoring to a different debugger. > > So I have kept it as it was. Otherwise specify which level of refactorization > do you wish. All I meant was to use bool in the new code. > >>> + std::function>> + CORE_ADDR range_end)> callback) >> >> Same comment about std::function. (and I had forgotten to suggest >> that callback should probably be a universal reference / "&&callback"). > > That is OK, I have already noticed you had studied a lot of C++ schoolbooks > before you permitted GDB to use C++. If my comment was incorrect, feel free to correct me. Otherwise, let's keep the discussion technical please. How I learned C++ is not called for here. Thanks, Pedro Alves