This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Hello Yao,

Thanks for working with Tim and me on this.

> > I thought we need it because we may get RecordFullInstruction in the future
> > that needs to store different data and install different functions.
> >
> > They will behave identical but will have different implementations.
> 
> Do you have some concrete reasons that we may change
> Record{Full,Btrace,...}Instruction in C?  I can't figure out the reason
> in the future we do the change, so I don't worry it now.

They may want to store different data in the python object.  Disassemble and
record-btrace will definitely want to store different data. 


> > Can they pretend to be the same type in Python?
> 
> Suppose one day in the future, we really need such change.  We can still
> have different C structs for different record methods, different
> PyTypeObject but with the same .tp_name "gdb.RecordInstruction" and
> different .tp_getset.  I hacked GDB code, and find python doesn't
> complain that I call PyType_Ready with different PyTypeObject, but they
> have the same .tp_name.  Everything works fine.
> 
[...]
> 
> Python code still uses insn[0] as the base type RecordInstruction, and
> Python code doesn't need to know the sub-types of RecordInstruction C
> code creates.  We deliberately don't document these sub-types in GDB if
> we add them.  IMO, not every python types we added in C are public types.

If that's how GDB does it in other cases, too, I'm fine.  I am not familiar with
GDB's Python bindings or Python bindings in general.

Tim, are you OK with the result of this discussion, as well?

Joel, do we have a week or so for Tim to send a patch?

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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]