DescriptionWhen working on the register allocator, I often need to introspect the various components of the model - e.g. InstructionSequence, Instruction, LiveRange, etc. A pretty printer would help. While we have a suite of operator<< defined for these types, turns out that using them at debug time is close to impossible - gdb has poor (or convoluted) support for instantiating structures (e.g. OFStream, PrintableInstructionSequence, etc), and calling operator<< with pass-by-reference semantics.
I explored gdb macros, but hit an issue quite early with instantiating and initializing an OFStream - "virtual baseclass botch".
Currently, I have a side-file that I include (and then remove before publishing CLs), which defines wrappers to the above operator<< APIs, but this is becoming quite awkward, and I believe the functionality to be quite useful to anyone working in this (regalloc) area, so it's worth having something better than local side-files. The gdb path seems overly-twisted for the problem at hand, and I've noticed elsewhere (e.g. Object) the presence of Print APIs - hence this change.
BUG=
Committed: https://crrev.com/ee005fbb8112d8ee55b4d139a5b1996cede1ea5f
Cr-Commit-Position: refs/heads/master@{#30039}
Patch Set 1 #
Messages
Total messages: 7 (2 generated)
|