This is required to be able to step through calls to external functions
that are not properly marked with __declspec(dllimport). When a call
like this is emitted, the linker will inject a trampoline to produce an
indirect call through the IAT.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
Excited to see this working. I will look at the patch in detail later, do you think you could make a test for it?
Can't you just call "thread->QueueThreadPlanForStepSingleInstruction"? For the most part, it doesn't make sense to make a thread plan and not queue it right away. So the "Thread::QueueThreadPlanFor..." API's are the public ones.
@jingham, it looks like the GetStepThroughTrampolinePlan functions do not queue the thread plan themselves. See DynamicLoaderPOSIXDYLD::GetStepThroughTrampolinePlan for instance that just does new ThreadPlanRunToAddress(...).
If I understand correctly, the thread plan is pushed to the stack later on, by the caller. Let me know if I got something wrong there.
Yes, that's sad. It needs to be done that way because the plan that organizes stepping "through" and provides a safety backstop if the step through runs away needs to push the sub-plans after it has been pushed. We could move all the stuff in the ThreadPlanStepThrough constructor to the DidPush method, then let the various GetStepThroughTrampolinePlan methods -> PushStepThroughTrampolinePlans. But it looks like we've already made a bunch of the ThreadPlan constructors public to work around this sort of problem, so we should probably just give in and make all the constructors public, and just document that you should preferentially call QueueThreadPlan if you are in a place where that's possible...
Sounds good. I can make a separate patch to make all the constructors
public if you think that's better. See http://reviews.llvm.org/D22230
for a patch that makes one of the constructors public.
Is this patch good to go in its current form then?