From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 50001 invoked by alias); 5 Dec 2017 16:46:09 -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 49097 invoked by uid 89); 5 Dec 2017 16:46:08 -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,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=H*r:sk:static., door, relationship X-HELO: mail-wm0-f49.google.com Received: from mail-wm0-f49.google.com (HELO mail-wm0-f49.google.com) (74.125.82.49) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 05 Dec 2017 16:46:07 +0000 Received: by mail-wm0-f49.google.com with SMTP id f206so2425666wmf.5 for ; Tue, 05 Dec 2017 08:46:06 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=lZg56m82EFBGmCkmw2gZuECXWpG7d9Pp+xYYcBx7ysY=; b=Y0JU0fR8envm5rrgxcSsMJuxp0n9VOS9JiYjPFxctPDHKHgYFoAGuyhvv/Gt+6IYAl 8GIBrTpWEqL8a9R05HlhsCYZmnoA2VCVEUfcZNX/Nu4Hldc6KpuiMSFXLTeB/Ax3ycaW 94Obca+gP026xAYKRa48nF/xt3YYRgXuEaY2skkhsK39+rFPoMqZEvFA1irAH8O3hw4C otP0LkmytQnLIylykQRrIYrv8ZfDzDEfFtt2ePw0+48cDvHz0GBjGr6YBY65/h3MIFTH 5MSPiSCzEnEKOth8iqFuiQqRcGp1VAA95p4TZa8tVTMAJNwS5oaN3htfEEUqL1YgJgWP 3uLA== X-Gm-Message-State: AKGB3mIulJaL0oIdOKvWgZpfQFTwdE72iUoXcbi7fVHrUJUUlmm6jvhT DkL8OWPJs8wFnjHxINn8lf95yw== X-Google-Smtp-Source: AGs4zMZsc5aqqq7Tz7ebZQ+NBFEKK8IKkTrsACMKKg6rPv8A6rHcimLCB3Lf+CLR+AROAJyd2OwJ9g== X-Received: by 10.28.114.13 with SMTP id n13mr7085891wmc.146.1512492364976; Tue, 05 Dec 2017 08:46:04 -0800 (PST) Received: from E107787-LIN (static.42.136.251.148.clients.your-server.de. [148.251.136.42]) by smtp.gmail.com with ESMTPSA id n17sm514279wrg.94.2017.12.05.08.46.03 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Tue, 05 Dec 2017 08:46:03 -0800 (PST) From: Yao Qi To: Simon Marchi Cc: gdb-patches@sourceware.org Subject: Re: [PATCH 11/10] Split tdesc_type into multiple classes References: <409e1beb-1f18-f5d5-9973-b060925c8536@ericsson.com> <20171203160430.20933-1-simon.marchi@polymtl.ca> Date: Tue, 05 Dec 2017 16:46:00 -0000 In-Reply-To: <20171203160430.20933-1-simon.marchi@polymtl.ca> (Simon Marchi's message of "Sun, 3 Dec 2017 11:04:30 -0500") Message-ID: <86o9ndp1h1.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2017-12/txt/msg00110.txt.bz2 Simon Marchi writes: > Hi Yao, > > I revisited this patch, and implemented as best as I could what you > suggested. This patch applies on top of the current series. > > This patch makes tdesc_type an abstract base class and creates three > subclasses: > > - tdesc_type_builtin, for builtin types > - tdesc_type_vector, for vector types > - tdesc_type_with_fields, for struct, union, flag and enum types > > This allows getting rid of the union in tdesc_type and to not allow the > std::vector separately. I tried to go further and create separate > classes for struct, union, flag and enum, but it proved too difficult. > One problem is that from the point of the of the target description > code, the types tdesc_type_* are opaque (only forward-declared). > Therefore, it doesn't know about inheritance relationship between those > classes. This makes it impossible to make functions that accept a > pointer to a base class and pass a pointer to a derived class, for > example. I think this patch here is a good compromise, and if somebody > wants to improve things further, the door is open. > > A make_gdb_type virtual pure method is added to tdesc_type, which > replaces the current tdesc_gdb_type function. Calling this method on a > tdesc_type returns the corresponding built gdb type. Hi Simon, Thanks for doing this, patch looks good to me. --=20 Yao (=E9=BD=90=E5=B0=A7)