[PATCH] Change llvm-objdump to print (bad) for invalid instructions
Jim Grosbach
grosbach at apple.com
Wed Oct 16 11:05:45 PDT 2013
- errs() << ToolName << ": warning: invalid instruction encoding\n";
- if (Size == 0)
- Size = 1; // skip illegible bytes
+ Size = 1; // skip illegible bytes
+ if (!NoShowRawInsn) {
+ outs() << '\t';
+ DumpBytes(StringRef(Bytes.data() + Index, Size));
+ }
+ outs() << " (bad)\n”;
I don’t think you want to always set the size to ‘1’ here. Won’t that result in mis-aligned instruction decoding for fixed-width instruction sets?
-Jim
On Oct 16, 2013, at 10:33 AM, Stephen Checkoway <s at pahtak.org> wrote:
> llvm-objdump was giving a warning on stderr about invalid instructions. The attached patch changes that to print (bad) which is agrees with what objdump does.
>
> --
> Stephen Checkoway
>
> <llvm-objdump-invalid-opcode.diff>
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
More information about the llvm-commits
mailing list