Turn off instruction flow control annotations by default (#84607) #8372
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Walter Erquinigo added optional instruction annotations for x86 instructions in 2022 for the
thread trace dump instruction
command, and code to DisassemblerLLVMC to add annotations for instructions that change flow control, v. https://reviews.llvm.org/D128477This was added as an option to
disassemble
, and the trace dump command enables it by default, but several other instruction dumpers were changed to display them by default as well. These are only implemented for Intel instructions, so our disassembly on other targets ends up looking likeinstead of
disassemble
's output style ofAdding symbolic annotations for assembly instructions is something I'm interested in too, because we may have users investigating a crash or apparent-incorrect behavior who must debug optimized assembly and they may not be familiar with the ISA they're using, so short of flipping through a many-thousand-page PDF to understand each instruction, they're lost. They don't write assembly or work at that level, but to understand a bug, they have to understand what the instructions are actually doing.
But the annotations that exist today don't move us forward much on that front - I'd argue that the flow control instructions on Intel are not hard to understand from their names, but that might just be my personal bias. Much trickier instructions exist in any event.
Displaying this information by default for all targets when we only have one class of instructions on one target is not a good default.
Also, in 2011 when Greg implemented the
memory read -f i
(akax/i
) commandhe had DumpDataExtractor's DumpInstructions print the bytes of the instruction -- that's the first field we see above for the
x/5i
after the address -- and this is only useful for people who are debugging the disassembler itself, I would argue. I don't want this displayed by default either.tl;dr this patch removes both fields from
memory read -f -i
and I think this is the right call today. While I'm really interested in instruction annotation, I don't thinkx/i
is the right place to have it enabled by default unless it's really compelling on at least some of our major targets.(cherry picked from commit bdbad0d)