From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 123777 invoked by alias); 30 Mar 2017 10:50:21 -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 121223 invoked by uid 89); 30 Mar 2017 10:50:18 -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=H*r:sk:23.2017 X-HELO: mail-wr0-f181.google.com Received: from mail-wr0-f181.google.com (HELO mail-wr0-f181.google.com) (209.85.128.181) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 30 Mar 2017 10:50:17 +0000 Received: by mail-wr0-f181.google.com with SMTP id w43so54839543wrb.0 for ; Thu, 30 Mar 2017 03:50:18 -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=LM9CrOhagSAtz53DdAcyjAc9B0kDdYFCAaUlI9KKmmg=; b=TEuFujE9llygR4lWEk5mA5nLofx8JZiENzL+cJqtn5BF4+Z76mXRf3mq4rRDvNqmdT avj1yoX0mocL/F6TjuSBP7LL8IW4Nj+k8BNxkA+BZzzegrSc51FnSVcF3f5pi+Aq/cIB DDeMyUx+jJsoL3ZCmFwZYVAwmR+QqXdx4FoTCi/Hk3AvRKqfnNK2MCRrKnIxIiWhVVTh abFyMg+VuvfVL1lTOvhuMf40/zlbtCGFx2OcBeHJoaHZcStccgIulOyJsdhbwxj2LqUO w1tQ4ewLr8Lno7nO84QFVx7N0MQRedaFTS8U8oBIzrAtmHK0v88VRDG/FnHQ1rrWLJrm Ub8A== X-Gm-Message-State: AFeK/H02IykZbv+PgNz0A3hbpz0dyOHayIpj36zJCTxPVaoND0hPSgBy8YMPSZkz/xnVYg== X-Received: by 10.28.19.6 with SMTP id 6mr2890462wmt.96.1490871016497; Thu, 30 Mar 2017 03:50:16 -0700 (PDT) Received: from E107787-LIN ([194.214.185.158]) by smtp.gmail.com with ESMTPSA id t85sm2742150wmt.23.2017.03.30.03.50.14 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Thu, 30 Mar 2017 03:50:15 -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> <86mvc5o7o4.fsf@gmail.com> <86a885o0z2.fsf@gmail.com> <861stgo072.fsf@gmail.com> Date: Thu, 30 Mar 2017 10:50:00 -0000 In-Reply-To: (Markus T. Metzger's message of "Wed, 29 Mar 2017 14:38:45 +0000") Message-ID: <86lgrn3uos.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/msg00524.txt.bz2 "Metzger, Markus T" writes: > What I'm less clear about is what changes you are requesting in order to > establish that interface. > > Should we just document it that way? Yes, I think so. (,Record)Instruction.{pc, data, decode, size} should behave as expected, .pc should return the address of instruction, and .data should return the bytes of instruction, .decode should return a string of asm code. =46rom documentation point of view, these four attributes are documented in Instruction, and RecordInstruction extends Instruction. > Should we implement an Instruction base class that throws in all function= s? > Should we implement an Instruction base class that returns None in all > functions? This is the C implementation decision, not related to Python interface nor document. Python script can only get RecordInstruction objects via Record.instruction_history, and RecordInstruction.{pc, data, decode, size} should behave as we documented for Instruction. So far, that is no way in python script to get Instruction objects. We can either throw exceptions or return None. (I personally prefer exceptions, if you really want me to choose one). Suppose, one day, we add a new python interface like gdb.Inferior.read_insn (start_pc,) returns Instruction objects. The These objects should behave as we already documented. In C code, we can change Instruction's getset functions to do something meaningful rather than throwing exception. --=20 Yao (=E9=BD=90=E5=B0=A7)