A trip report. I tried both vanilla lldb and your git repository, and had similar<br><div class="gmail_quote">problems building them for Kubuntu 11.04 64-bit x86, with g++ 4.6.1. I attach the patches necessary<br>to make things compile (mostly just missing header includes); I also had some link <br>
ordering problems which I sort of hacked support into the generated makefiles for. These<br>are the same patches I submitted a couple of months ago so I guess they didn't end up<br>making it into the source tree, unfortunately.<br>
<br>I take it attaching to a process on Linux isn't expected to work? It crashes for me<br>in this manner:<br><br>#0 0x00007ffff7bc9004 in pthread_mutex_lock () from /lib/x86_64-linux-gnu/libpthread.so.0<br>#1 0x00007ffff50973b4 in lldb_private::Mutex::Lock (mutex_ptr=0x18) at /home/jo/lldb/llvm/tools/lldb/source/Host/common/Mutex.cpp:190<br>
#2 0x00007ffff509701c in lldb_private::Mutex::Locker::Locker (this=0x7fffffff8e00, m=...)<br> at /home/jo/lldb/llvm/tools/lldb/source/Host/common/Mutex.cpp:46<br>#3 0x00007ffff4fdad80 in lldb_private::Module::GetObjectFile (this=0x0) at /home/jo/lldb/llvm/tools/lldb/source/Core/Module.cpp:778<br>
#4 0x00007ffff5c18b2e in ProcessPOSIX::ProcessPOSIX (this=0x7b17b0, target=..., listener=...)<br> at /home/jo/lldb/llvm/tools/lldb/source/Plugins/Process/POSIX/ProcessPOSIX.cpp:76<br>#5 0x00007ffff5c1e2c1 in ProcessLinux::ProcessLinux (this=0x7b17b0, target=..., listener=...)<br>
at /home/jo/lldb/llvm/tools/lldb/source/Plugins/Process/Linux/ProcessLinux.cpp:67<br>#6 0x00007ffff5c1e205 in ProcessLinux::CreateInstance (target=..., listener=...)<br> at /home/jo/lldb/llvm/tools/lldb/source/Plugins/Process/Linux/ProcessLinux.cpp:37<br>
#7 0x00007ffff52598d9 in lldb_private::Process::FindPlugin (target=..., plugin_name=0x0, listener=...)<br> at /home/jo/lldb/llvm/tools/lldb/source/Target/Process.cpp:729<br>#8 0x00007ffff527856b in lldb_private::Target::CreateProcess (this=0x7b1130, listener=..., plugin_name=0x0)<br>
at /home/jo/lldb/llvm/tools/lldb/source/Target/Target.cpp:142<br>#9 0x00007ffff4f4849f in CommandObjectProcessAttach::Execute (this=0x6371a0, command=..., result=...)<br> at /home/jo/lldb/llvm/tools/lldb/source/Commands/CommandObjectProcess.cpp:504<br>
#10 0x00007ffff50b2ae7 in lldb_private::CommandObject::ExecuteWithOptions (this=0x6371a0, args=..., result=...)<br> at /home/jo/lldb/llvm/tools/lldb/source/Interpreter/CommandObject.cpp:290<br>#11 0x00007ffff50a9dec in lldb_private::CommandInterpreter::HandleCommand (this=0x62aa60, command_line=0x629c68 "process attach -p 1568", <br>
add_to_history=true, result=..., override_context=0x0, repeat_on_empty_command=true, no_context_switching=false)<br> at /home/jo/lldb/llvm/tools/lldb/source/Interpreter/CommandInterpreter.cpp:1510<br>#12 0x00007ffff4ed4c06 in lldb::SBCommandInterpreter::HandleCommand (this=0x7fffffffb490, command_line=0x629c68 "process attach -p 1568", <br>
result=..., add_to_history=true) at /home/jo/lldb/llvm/tools/lldb/source/API/SBCommandInterpreter.cpp:97<br>#13 0x0000000000413d4a in Driver::HandleIOEvent (this=0x7fffffffdf50, event=...) at /home/jo/lldb/llvm/tools/lldb/tools/driver/Driver.cpp:933<br>
#14 0x0000000000415017 in Driver::MainLoop (this=0x7fffffffdf50) at /home/jo/lldb/llvm/tools/lldb/tools/driver/Driver.cpp:1341<br>#15 0x00000000004155cd in main (argc=1, argv=0x7fffffffe158, envp=0x7fffffffe168) at /home/jo/lldb/llvm/tools/lldb/tools/driver/Driver.cpp:1460<br>
<br>- GetTarget().GetExecutableModule()->GetObjectFile(); returns a null pointer, on both repositories.<br><br>I'd be happy to have a look into fixing this, if no-one else is and if someone wants to give me some hints on where to start. :)<div class="HOEnZb">
<div class="h5"><br>
<br><div class="gmail_quote">On Wed, Jan 4, 2012 at 6:30 PM, <span dir="ltr"><<a href="mailto:dawn@burble.org" target="_blank">dawn@burble.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
FYI - see patch titled "[PATCH] Merge of Linux and FreeBSD"<br>
sent to lldb-commits and hopefully committed soon. :)<br>
<br>
-Dawn<br>
<div><div><br>
On Wed, Jan 04, 2012 at 02:45:54PM -0800, Mark Peek wrote:<br>
> [Resending from my subscribed email address]<br>
><br>
> Having taken a snapshot of lldb and pushed it into github, we have developed a<br>
> patch set to refactor the Linux and FreeBSD support to reduce the differences<br>
> and improve compatibility. The current repo has been built and run on 64bit<br>
> FreeBSD and Linux systems.<br>
><br>
> The github repo is located here:<br>
><br>
> <a href="https://github.com/fbsd/lldb" target="_blank">https://github.com/fbsd/lldb</a><br>
><br>
> And a patch set against rXXXXX of lldb is here:<br>
><br>
> <a href="http://people.freebsd.org/%7Emp/lldb_r147532.patch" target="_blank">http://people.freebsd.org/~mp/lldb_r147532.patch</a><br>
><br>
> We'd like the current work to not diverge too far away from the main repo and<br>
> we thought others might want to play with this or help out. Some of the todo's<br>
> on our list are:<br>
><br>
> - Verify i386 operation on Linux, implement/verify on FreeBSD<br>
> - Verify attach support<br>
> - FreeBSD stop at exit<br>
> - thread support<br>
> - core file support<br>
> - Better process control for interrupting inferior<br>
> - Get buildbot passing reliably<br>
><br>
> Are there any volunteers with commit bits willing to review and commit this<br>
> patch to the lldb repo? Dawn is going to follow up with a formal patch to<br>
> lldb-commits@.<br>
><br>
> Thanks,<br>
> Mark, Kip and Dawn<br>
><br>
> _______________________________________________<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></div></div></blockquote></div></div></div></div>