Hi,<div><br></div><div>Sorry for the delay. I started doing some stuff withou replying.</div><div><br></div><div>I was creating the Process plugin, but there are some problems, like repeated enumerations, and some other issues. To minimize syncing  problems, it would be better for me to start changing DNB.h in-place (if it's possible), to use lldb's enumerations and other small fixes.</div>
<div><br></div><div>At the same time I would be writing the Process plugin that uses libdebugnub.</div><div><br></div><div>How do you suggest to organize the code? libdebugnub seems to hold as a library that we could use in lldb for the ProcessHostDebugger, but I'm not seeing a good place to put it (it's weird to put it in Core/, but it seems like the best place (or on the Plugin/Process/Utility/ or a Plugin/HostDebugger/Utility folders).</div>
<div><br></div><div>What do you think?</div><div><br></div><div>Regards,</div><div><br></div><div>  Filipe</div><div><br><br><div class="gmail_quote">On Thu, Sep 8, 2011 at 16:18, Greg Clayton <span dir="ltr"><<a href="mailto:gclayton@apple.com" target="_blank">gclayton@apple.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><div></div><div><br>
On Sep 8, 2011, at 3:58 PM, Filipe Cabecinhas wrote:<br>
<br>
> Hi, I tried sending this message earlier, but it seems it got lost along the way.<br>
><br>
> I'm re-sending the patch for allowing "target create" on the remote-macosx platform and another patch to augment the FreeBSD platform and make it like the Mac OS X platform.<br>
> In order to make the FreeBSD platform we will have to, either implement a local platform (like the Linux one) or implement debugserver on FreeBSD. I'm leaning on the second solution as it would offer us remote debugging for free.<br>


><br>
> I just want to confirm something: Is debugserver portable? I'm supposing debugserver is MacOSX specific, but I may be looking at the wrong parts of the code.<br>
<br>
</div></div>It is currently very specific. For porting to new systems, we should make binary similar to the lldb-platform binary. It links against the innards of lldb-core, and it also uses the GDBRemoteCommunicationServer class, which is the GDB server side of the GDB remote protocol in LLDB. The GDBRemoteCommunicationServer is a very clean interface and gets you all of the supported packet management built in. It should be extended to do all of the debugging stuff through an interface which is similar to the DNB.h. The DNB.h is a very clean interface as well, but we should copy it, and make a new version that is host agnostic (there are a few "#include <mach/*>" in the DNB.h version). If we abstract all debugging for all systems though a clean interface like the one in "DNB.h", then we can also have native debugger plug-ins that use this interface and allows us to have a native debugger plug-in, _and_ a remote debugger plug-in that use the exact same debug code.<br>


<br>
So the steps as I see them:<br>
- Copy DNB.h and remame it to HostDebugger.h and place it into LLDB core code and use it as the basis for all local native debugging, both local and remote<br>
- Create a new Process plug-in named ProcessHostDebugger that would use the new HostDebugger.h interface<br>
- Use GDBRemoteCommunicationServer.h to implement a new GDB server binary named "lldb-gdb-server" and have it link to lldb-core like lldb-platform already does and have it use the "HostDebugger.h" to implement the debugging inside GDBRemoteCommunicationServer or a subclass.<br>


<br>
We can look at the code in debugserver for reference, but I wouldn't use it as the basis for any new GDB server implementations.<br>
<br>
Does this make sense?<br>
<br>
Greg<br>
<br>
><br>
> Thanks,<br>
><br>
>   Filipe<br>
><br>
><br>
> <freebsd-platform.patch><darwin-remote-fix.patch>_______________________________________________<br>
> lldb-dev mailing list<br>
> <a href="mailto:lldb-dev@cs.uiuc.edu" target="_blank">lldb-dev@cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev</a><br>
<br>
</blockquote></div><br>
</div>