GDB 8.0 release/branching 2017-03-20 update

Yao Qi qiyaoltc@gmail.com
Mon Mar 27 11:19:00 GMT 2017


"Metzger, Markus T" <markus.t.metzger@intel.com> writes:

> Instruction would have to be an abstract class.  Then we could have two
> derived classes DisassembleInstruction for the disassemble command
> that likely wants to store the pc and maybe the inferior id - or even the
> disassembled string.
> And we have Record(Btrace)Instruction that wants to store the ptid
> and the number in the recorded instruction-history.

Instruction doesn't have to be an abstract class, instead, it can be a
base class which has attribute pc, data, and disassembled string.  All
of them can be used in Record(Btrace)Instruction too, but "data" and
"disassembled string" can be got lazily.  Record(Btrace)Instruction
extends Instruction, and add its own stuff.  In the future, we can add
new RecordFooInstruction, extends Instruction, and add its own stuff too.

>
> What won't work is that we simply extend an Instruction base class by
> adding new functions and data members.  We need to overwrite every
> function in the base class and each derived class will provide its own set
> of data members to work on.

I don't expect the change like that.

-- 
Yao (齐尧)



More information about the Gdb-patches mailing list