[lldb-dev] New linux process plugin

Greg Clayton gclayton at apple.com
Sun Jul 25 09:21:27 PDT 2010


On Jul 23, 2010, at 7:19 PM, Stephen Wilson wrote:

> Hi all,
> 
> I just pushed the new linux process plugin.  A few notes:
> 
> I updated the makefiles to build only under linux.  I do not know if
> this will build on a mac.  Perhaps someone can try and let me know the
> result.
> 
> Only very basic breakpoint/step-over functionality is present.  

Great start though, it should be easy to add new functionality very quickly now.

> For
> example, we cannot resolve pending breakpoints yet, so one must set
> breakpoints with the debugee stopped on entry.

This stems from the dynamic loader plug-in not being implemented. The dynamic loader is responsible for synchronously letting the Process know when shared libraries are loaded/unloaded. On Mac OS X this is done by setting a breakpoint at a specific dyld location, adding a breakpoint function callback to that breakpoint that will be called when the breakpoint gets hit. The breakpoint callback then notifies that new shared libraries are loaded/unloaded, the returns "false" from to indicate that the target should resume without any notifications going out that would let any UI or command line know that the process stopped.

> Only x86_64 at the moment (will add i386 soon).
> 
> Here is a simple example of what is working for those who might like to
> test it out:
> 
> ===--------------------------------------------------------------------------===
>> cat ctest.c
> 
>   void foo() { return; }
> 
>   void bar() { return; }
> 
>   int main()
>   {
>       foo();
>       bar();
>       return 0;
>   }
> 
>> lldb ./ctest
>   Current executable set to './ctest' (x86_64).
>   (lldb) r -s
>   Launching '/home/steve/tmp/ctest'  (x86_64)
>   (lldb) Process 0 Launching
>   Process 0 Stopped
>   * thread #1: tid = 0x4789, pc = 0x0000003206200af0, ...
>   (lldb) b s -n foo
>   Breakpoint created: 1: name = 'foo', locations = 1, resolved = 1
>   (lldb) b s -n bar
>   Breakpoint created: 2: name = 'bar', locations = 1, resolved = 1
>   (lldb) p c
>   Resuming process 0
>   (lldb) Process 0 Stopped
>   * thread #1: tid = 0x4789, pc = 0x0000000000400478, ...
>      1         
>      2 ->      void foo() { return; }
>      3         
>      4         void bar() { return; }
>      5         
>   (lldb) p c
>   Resuming process 0
>   (lldb) Process 0 Stopped
>   * thread #1: tid = 0x4789, pc = 0x000000000040047e, ...
>      1         
>      2         void foo() { return; }
>      3         
>      4 ->      void bar() { return; }
>      5         
>      6         int main()
>      7         {
>   (lldb) q
> ===--------------------------------------------------------------------------===
> 
> 
> It's a start.  Let be know of any issues, comments, advice, etc.
> 
> Thanks!
> Steve
> _______________________________________________
> lldb-dev mailing list
> lldb-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev





More information about the lldb-dev mailing list