[llvm-commits] [llvm] r156593 - in /llvm/trunk: docs/LangRef.html include/llvm/CodeGen/ISDOpcodes.h include/llvm/Intrinsics.td include/llvm/Target/TargetSelectionDAG.td lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp lib/Target/X86/X86InstrSystem.td test/CodeGen/X86/trap.ll

Dan Gohman gohman at apple.com
Mon May 14 11:42:35 PDT 2012


On May 11, 2012, at 12:12 PM, Nick Lewycky <nicholas at mxc.ca> wrote:

> Dan Gohman wrote:
>> 
>> On May 10, 2012, at 10:26 PM, Nick Lewycky wrote:
>> 
>>> Dan Gohman wrote:
>>>> Modified: llvm/trunk/docs/LangRef.html
>>>> +<h5>Semantics:</h5>
>>>> +<p>This intrinsic is lowered to code which is intended to cause an
>>>> execution
>>>> + trap with the intention of requesting the attention of a debugger.</p>
>>> 
>>> ... but no other effect? Is that how it's different from @llvm.trap,
>>> that if there is no debugger, the program continue running normally?
>> 
>> The main difference is that on x86 it generates int3, rather than ud2.
>> Perhaps I
>> tried to hard to make the language generic.
> 
> Right, but I don't know what that does either. I know that ud2 is going to stop your program (signal handlers notwithstanding), but what does int 3 do? Call into the debugger if there is a debugger, otherwise the program trundles along? Or does it do the exact same thing as ud2? (In which case, what's the point of this new intrinsic?)


In short, ud2 gets SIGILL, which connotes that something is
buggy, while int3 gets SIGTRAP, which merely connotes that
something requested a trap.

Dan




More information about the llvm-commits mailing list