Page MenuHomePhabricator

For expression evaluation, a new ThreadPlanCallFunctionGDB for executing a function call on target via register manipulation.
Needs ReviewPublic

Authored by deepak2427 on Jul 25 2014, 10:04 AM.
This revision needs review, but there are no reviewers specified.

Details

Reviewers
None
Summary

Hi,

We wanted to be able to call functions while debugging for Hexagon however this is only possible from lldb currently when there is JIT support.
Currently LLDB supports emulation via IR interpreting and executing on target via JIT however The IR interpretation is limited and cannot currently make function calls.

We have extended the IR interpreter so that it can execute a function call on target, via register manipulation. This is the same method
that is used by GDB for calling a function. This involved handling the Call IR instruction, passing arguments to a new thread plan and collecting any return values and
passing them back into the IR interpreter.

Several interfaces to the ABI were extended to allow more detailed information about arguments and return values when setting up a trivial call. See "ABI::PrepareTrivialCall".

Currently the expression evaluator checks if an expression can be interpreted and if it can it uses the IR interpreter, if it can't then it tries to JIT the expression and
run it on target. It seems however that for targets that can JIT, it would be better to use that when executing a function call since its presumably much more robust.
Perhaps this should be used exclusively for targets that cannot JIT?

Diff Detail

Event Timeline

deepak2427 retitled this revision from to For expression evaluation, a new ThreadPlanCallFunctionGDB for executing a function call on target via register manipulation..
deepak2427 updated this object.
deepak2427 edited the test plan for this revision. (Show Details)
deepak2427 added a subscriber: Unknown Object (MLST).
emaste added a subscriber: emaste.Jul 25 2014, 11:28 AM
This comment was removed by tatyana-krasnukha.