You will need to add ABI support.  You'll also need to make an Unwinder that 
works for your platform.  But the thread plan code is pretty generic and relies 
on the Unwinder and generic features of the Disassembler (mostly "IsBranch") to 
do its job.  For instance, thread step-out just asks the Unwinder for the 
return address for the current frame, sets a breakpoint there and continues.  
The architecture specific bits of that are all hidden by the Unwinder.

The main complication would be if your new target didn't support 
hardware-single-step.  If that's the case you will have to have a Disassembler 
that can predict the target PC of all instructions (when stopped at that 
instruction) since you'll have to use software breakpoints to drive the lowest 
level of stepping.  There's support in there for handling that at a high level 
since the first couple of iPhone ARM chips didn't have single step support but 
we haven't actually had on any real systems we support that lack hardware 
single step in years, so it may need some reviving.

Jim


> On Nov 28, 2018, at 9:50 AM, Adrian Harris via lldb-dev 
> <lldb-dev@lists.llvm.org> wrote:
> 
> Hi Everyone,
> 
> I’ve added basic support for a new target (via gdb-remote) and now it is time 
> to add ABI support to lldb to improve the debug experience. My understanding 
> is that I need to add an ABI plugin (we have a very basic stub now) and 
> thread-plan support. As a first step I’d like to be able to support the 
> ‘thread step-out’ command. Some basic guidance would be very much appreciated.
> 
> Thanks!
> Adrian
> 
> _______________________________________________
> lldb-dev mailing list
> lldb-dev@lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev

_______________________________________________
lldb-dev mailing list
lldb-dev@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev

Reply via email to