> On Mar 17, 2016, at 5:01 AM, Tyro Software via lldb-dev 
> <lldb-dev@lists.llvm.org> wrote:
> 
> I have a simulator for a custom ["toy"] CPU running on Linux, to which I want 
> to add at least basic debugging support (e.g. stepping instructions, 
> reading/writing registers and memory), then driving this from lldb over a 
> local TCP socket. 
> 
> I could implement this as a custom socket server handling the GDB Remote 
> Serial Protocol, like GDB server stubs that I've seen. But probably there's 
> already a suitable interface and library in LLDB for this, e.g. providing the 
> RSP parsing and basic state maintennce with callbacks/virtuals for the 
> target-specific actions?
> 
We have classes you can use to receive the packets. See the 
GDBRemoteCommunicationServerLLGS class. This is the "LLDB GDB server" class. It 
uses classes whose type is:

    class NativeBreakpoint;
    class NativeBreakpointList;
    class NativeProcessProtocol;
    class NativeRegisterContext;
    class NativeThreadProtocol;
    class UnixSignals;

You would subclass these and fill them in similar to what the linux 
implementations are doing.


> Thanks for any guidance (and apologies that I'm probably using terminology 
> like "server" incorrectly and so overlooking the existing documentation)

Let me know if the above info makes sense and feel free to ask any questions.

Greg

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

Reply via email to