RE: GDB 8.0 release/branching 2017-03-20 update

Metzger, Markus T
2017-03-28T15:08:31Z

Hello Yao,

> > 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[] =
> {
> { "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}
> };

This is for the (abstract) base-class, I assume.

We don't store any data in the base class so the Python object would
contain the PyObject header and nothing else, correct?

And the above functions would throw an exception or return None.
Correct?

> struct PyGetSetDef btpy_insn_getset[] =
> {
> { "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}
> };

This is for the BtraceInstruction derived class, I assume. That's essentially
what Tim implemented. Correct?

This doesn't look too far away from what we have in GDB today.

Thanks,
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