[PATCH] Change llvm-objdump to print (bad) for invalid instructions

Stephen Checkoway s at pahtak.org
Thu Oct 17 16:12:30 PDT 2013


On Oct 17, 2013, at 5:31 PM, Rafael Espíndola <rafael.espindola at gmail.com> wrote:

> I think you forgot to attache the patch.

And I was just being impressed with myself for sending so many emails and remembering to attach the patches. Ah hubris. Patch attached. Thanks!

> 
> On 17 October 2013 14:18, Stephen Checkoway <s at pahtak.org> wrote:
>> 
>> On Oct 16, 2013, at 7:13 PM, Jim Grosbach <grosbach at apple.com> wrote:
>> 
>>> Looks like there’s something addition that may need cleaned up in that interface. The assertion is firing in test case "MC/ARM/AlignedBundling/group-bundle-arm.s”. Can you have a look and see what’s up?
>> 
>> 
>> Good catch. The other disassemblers were setting Size to 0 when they failed to disassemble the instruction.
>> 
>> The attached patch changes all of the targets in the tree with disassemblers and adds a unittest to check that each target with a disassembler (and for which we can trivially construct an MCSubtargetInfo) returns a nonzero size when it fails to disassemble an instruction. It's a pretty limited check since it only tries to disassemble 0x00 and it's certainly possible that an architecture has an instruction that is simply 0x00 (e.g., Z80's NOP is 0x00).
>> 
>> Can you think of a better way to test this, particularly for out-of-tree targets that may need to change?
>> 
>> After this, the llvm-objdump and the header comment patches should apply cleanly.
>> 
>> --
>> Stephen Checkoway
>> 
>> 
>> 
>> 
>> 
>> 
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
> 

-- 
Stephen Checkoway


-------------- next part --------------
A non-text attachment was scrubbed...
Name: MCDisassembler-nonzero-size.diff
Type: application/octet-stream
Size: 20076 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20131017/24e08fba/attachment.obj>
-------------- next part --------------





More information about the llvm-commits mailing list