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

Yao Qi
2017-03-24T14:41:51Z

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

> I meant that's all we store internally. Everything else, the pc, the
> instruction's bytes,
> the disassembly, even the is_speculative flag, is computed when the respective
> function is called (or field is accessed).
>

We can also compute them lazily in gdb.disassemble ().

> I think we already agreed to remove the ptid from the API. I'm also
> not really sure
> we need the number in Python. It is needed by the CLI to refer to an
> instruction
> but in Python we can use an instruction object directly.
>
> Once we drop those, the internal representation will be completely
> different from the
> external one. And it will be record-(btrace-)specific. I like that a
> lot since computing

AFAICS, The internal representation of instruction object provided by
gdb.disassemble () can be a base class, and record-(target-) specific
instruction object can extend it, but doesn't have to. It is an
implementation decision, and user invisible, right?

> the disassembly is rather expensive and the string is relatively big.
> When a script is
> iterating over a few million instructions and all it needs is the pc
> or the sal or the
> is_speculative flag to find a TSX region, we don't want to disassemble
> the instruction.

I agree.

--
Yao (齐尧)