From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 122588 invoked by alias); 28 Mar 2017 13:25: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 121000 invoked by uid 89); 28 Mar 2017 13:25:08 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=no version=3.3.2 spammy=Hx-languages-length:1163, our X-HELO: mail-wr0-f175.google.com Received: from mail-wr0-f175.google.com (HELO mail-wr0-f175.google.com) (209.85.128.175) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 28 Mar 2017 13:25:07 +0000 Received: by mail-wr0-f175.google.com with SMTP id w11so86968565wrc.3 for ; Tue, 28 Mar 2017 06:25:08 -0700 (PDT) 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=QgAYLEx3aS/RYeOIHacS/2AKF9qodt02La+RKD62Cfc=; b=C3WE3KNr9GTikyBmY6DHm4rYuOf9I9g3IeI5MNPV99F/QMk++5uu0bs/uq7mi+obIG GjvgcqtfxxR9KDP8EAnSxScE3qsnVapG2jLOKUS4nbEtfZ1IspajLapAHzUsqr4kq//e C1Byww3aErzLagsVRdk+vHk5KRVj9+dMlgXd/CvFJrCtduZwDX28RHkZAsKNzt1c3xJg ec++Z7EWMZNPZyqdQMtL2vvKlJvjcXzUEPlNwua2Wbil2Bh6pMlHeqE5+Rr3B9hIS4z4 5p2rflx+9shzWU6Ydp6RfCEaA5zqgXQ3YwOgq0fp4o+j6w/ghHdp2Fcb1W6WsQ9A3trB xkBg== X-Gm-Message-State: AFeK/H2kvQMKxwhVgDniYo6pDaiX5D8OUZTuN8kQRgH6UAn0/xqzVYllwii2rtVdjWt01A== X-Received: by 10.223.161.207 with SMTP id v15mr8866806wrv.71.1490707505670; Tue, 28 Mar 2017 06:25:05 -0700 (PDT) Received: from E107787-LIN ([194.214.185.158]) by smtp.gmail.com with ESMTPSA id x131sm3624240wme.28.2017.03.28.06.25.03 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Tue, 28 Mar 2017 06:25:04 -0700 (PDT) From: Yao Qi To: "Metzger\, Markus T" Cc: "gdb-patches\@sourceware.org" , "Wiederhake\, Tim" , "xdje42\@gmail.com" , "Joel Brobecker" Subject: Re: GDB 8.0 release/branching 2017-03-20 update References: <20170320201629.pbjzaqsnvs7dx7f2@adacore.com> <86zigevkv0.fsf@gmail.com> <86inn1utkp.fsf@gmail.com> <86inmzvrbx.fsf@gmail.com> <86shm2u47t.fsf@gmail.com> <86wpbbnf1f.fsf@gmail.com> <86shlyoggb.fsf@gmail.com> Date: Tue, 28 Mar 2017 13:25:00 -0000 In-Reply-To: (Markus T. Metzger's message of "Tue, 28 Mar 2017 07:16:44 +0000") Message-ID: <86mvc5o7o4.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-03/txt/msg00479.txt.bz2 "Metzger, Markus T" writes: > That sounds good. We want to provide a fixed set of functions and we want > to be free to choose the best internal representation for each variant. > Exactly. > How would this look in our python implementation? I am not sure. One approach in my mind is that sub-class can overwrite by defining its own getset. struct PyGetSetDef py_insn_getset[] =3D { { "data", py_insn_data, NULL, "raw instruction data", NULL}, { "decoded", py_insn_decode, NULL, "decoded instruction", NULL}, { "size", py_insn_size, NULL, "instruction size in byte", NULL}, { "pc", py_insn_pc, NULL, "instruction address", NULL }, {NULL} }; struct PyGetSetDef btpy_insn_getset[] =3D { { "data", btpy_insn_data, NULL, "raw instruction data", NULL}, { "decoded", btpy_insn_decode, NULL, "decoded instruction", NULL}, { "size", btpy_insn_size, NULL, "instruction size in byte", NULL}, { "pc", btpy_insn_pc, NULL, "instruction address", NULL }, { "number", btpy_number, NULL, "instruction number", NULL}, { "sal", btpy_sal, NULL, "instruction number", NULL}, {NULL} }; --=20 Yao (=E9=BD=90=E5=B0=A7)