From: "Metzger, Markus T" <markus.t.metzger@intel.com>
To: Yao Qi <qiyaoltc@gmail.com>
Cc: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>,
"Wiederhake, Tim" <tim.wiederhake@intel.com>,
"xdje42@gmail.com" <xdje42@gmail.com>,
"Joel Brobecker" <brobecker@adacore.com>
Subject: RE: GDB 8.0 release/branching 2017-03-20 update
Date: Thu, 30 Mar 2017 11:58:00 -0000 [thread overview]
Message-ID: <A78C989F6D9628469189715575E55B2340077BD3@IRSMSX104.ger.corp.intel.com> (raw)
In-Reply-To: <86lgrn3uos.fsf@gmail.com>
Hello Yao,
> > 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.
>
> From documentation point of view, these four attributes are documented
> in Instruction, and RecordInstruction extends Instruction.
OK. That shouldn't take long. Also the other items we discussed shouldn't
take long to implement. We agreed to remove ptid and number from
RecordBtraceInstruction and rename it to RecordInstruction.
When we do this for record-full, we need different functions and we may also
want to store different data in the python object.
Anticipating such a change, I would document class RecordInstruction as we
discussed but keep RecordBtraceInstruction. We may introduce yet another
abstract base class RecordInstruction. OK?
We may not need to document class RecordBtraceInstruction since it does not
really add anything to class RecordInstruction. The interface consists of classes
Instruction and RecordInstruction. OK?
> > Should we implement an Instruction base class that throws in all functions?
> > 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.
We will need to introduce another derived class DisassembleInstruction
since it will want to store data in the python object and we don't want that
data in RecordInstruction objects, so we can't add it to the Instruction base
class.
That's again talking about the implementation. If we can model this in
Python without introducing new classes, I'm fine, as well. We should also
do it like this for classes RecordInstruction and RecordBtraceInstruction in
that case.
Regards,
Markus.
Intel Deutschland GmbH
Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de
Managing Directors: Christin Eisenschmid, Christian Lamprechter
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928
next prev parent reply other threads:[~2017-03-30 11:58 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-20 20:16 Joel Brobecker
2017-03-20 20:21 ` Keith Seitz
2017-03-20 22:39 ` Yao Qi
2017-03-20 22:47 ` Yao Qi
2017-03-20 22:52 ` Joel Brobecker
2017-03-20 23:03 ` Yao Qi
2017-03-21 13:28 ` Joel Brobecker
2017-03-21 7:35 ` Wiederhake, Tim
2017-03-21 13:28 ` Joel Brobecker
2017-03-21 13:07 ` Yao Qi
2017-03-21 13:31 ` Joel Brobecker
2017-03-22 13:58 ` Metzger, Markus T
2017-03-22 17:09 ` Yao Qi
2017-03-23 16:01 ` Metzger, Markus T
2017-03-23 17:25 ` Yao Qi
2017-03-23 18:17 ` Metzger, Markus T
2017-03-24 14:41 ` Yao Qi
2017-03-27 10:51 ` Metzger, Markus T
2017-03-27 11:19 ` Yao Qi
2017-03-27 12:46 ` Metzger, Markus T
2017-03-27 16:03 ` Yao Qi
2017-03-28 7:16 ` Metzger, Markus T
2017-03-28 13:25 ` Yao Qi
2017-03-28 15:08 ` Metzger, Markus T
2017-03-28 15:49 ` Yao Qi
2017-03-29 6:08 ` Metzger, Markus T
[not found] ` <861stgo072.fsf@gmail.com>
2017-03-29 14:38 ` Metzger, Markus T
2017-03-30 10:50 ` Yao Qi
2017-03-30 11:58 ` Metzger, Markus T [this message]
[not found] ` <86h92a4w86.fsf@gmail.com>
2017-03-30 15:55 ` Metzger, Markus T
2017-03-31 13:55 ` Yao Qi
2017-03-31 15:21 ` Metzger, Markus T
2017-03-31 16:02 ` Joel Brobecker
2017-04-06 14:40 ` Wiederhake, Tim
2017-04-07 8:10 ` Yao Qi
2017-04-07 11:53 ` Wiederhake, Tim
2017-04-07 15:19 ` Yao Qi
2017-03-21 14:00 ` Yao Qi
2017-03-21 14:03 ` Pedro Alves
2017-03-27 13:35 ` Antoine Tremblay
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=A78C989F6D9628469189715575E55B2340077BD3@IRSMSX104.ger.corp.intel.com \
--to=markus.t.metzger@intel.com \
--cc=brobecker@adacore.com \
--cc=gdb-patches@sourceware.org \
--cc=qiyaoltc@gmail.com \
--cc=tim.wiederhake@intel.com \
--cc=xdje42@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox