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


"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 (齐尧)


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