A trip report. I tried both vanilla lldb and your git repository, and had
similar
problems building them for Kubuntu 11.04 64-bit x86, with g++ 4.6.1. I
attach the patches necessary
to make things compile (mostly just missing header includes); I also had
some link
ordering problems which I sort of hacked support into the generated
makefiles for. These
are the same patches I submitted a couple of months ago so I guess they
didn't end up
making it into the source tree, unfortunately.
I take it attaching to a process on Linux isn't expected to work? It
crashes for me
in this manner:
#0 0x00007ffff7bc9004 in pthread_mutex_lock () from
/lib/x86_64-linux-gnu/libpthread.so.0
#1 0x00007ffff50973b4 in lldb_private::Mutex::Lock (mutex_ptr=0x18) at
/home/jo/lldb/llvm/tools/lldb/source/Host/common/Mutex.cpp:190
#2 0x00007ffff509701c in lldb_private::Mutex::Locker::Locker
(this=0x7fffffff8e00, m=...)
at /home/jo/lldb/llvm/tools/lldb/source/Host/common/Mutex.cpp:46
#3 0x00007ffff4fdad80 in lldb_private::Module::GetObjectFile (this=0x0) at
/home/jo/lldb/llvm/tools/lldb/source/Core/Module.cpp:778
#4 0x00007ffff5c18b2e in ProcessPOSIX::ProcessPOSIX (this=0x7b17b0,
target=..., listener=...)
at
/home/jo/lldb/llvm/tools/lldb/source/Plugins/Process/POSIX/ProcessPOSIX.cpp:76
#5 0x00007ffff5c1e2c1 in ProcessLinux::ProcessLinux (this=0x7b17b0,
target=..., listener=...)
at
/home/jo/lldb/llvm/tools/lldb/source/Plugins/Process/Linux/ProcessLinux.cpp:67
#6 0x00007ffff5c1e205 in ProcessLinux::CreateInstance (target=...,
listener=...)
at
/home/jo/lldb/llvm/tools/lldb/source/Plugins/Process/Linux/ProcessLinux.cpp:37
#7 0x00007ffff52598d9 in lldb_private::Process::FindPlugin (target=...,
plugin_name=0x0, listener=...)
at /home/jo/lldb/llvm/tools/lldb/source/Target/Process.cpp:729
#8 0x00007ffff527856b in lldb_private::Target::CreateProcess
(this=0x7b1130, listener=..., plugin_name=0x0)
at /home/jo/lldb/llvm/tools/lldb/source/Target/Target.cpp:142
#9 0x00007ffff4f4849f in CommandObjectProcessAttach::Execute
(this=0x6371a0, command=..., result=...)
at
/home/jo/lldb/llvm/tools/lldb/source/Commands/CommandObjectProcess.cpp:504
#10 0x00007ffff50b2ae7 in lldb_private::CommandObject::ExecuteWithOptions
(this=0x6371a0, args=..., result=...)
at
/home/jo/lldb/llvm/tools/lldb/source/Interpreter/CommandObject.cpp:290
#11 0x00007ffff50a9dec in lldb_private::CommandInterpreter::HandleCommand
(this=0x62aa60, command_line=0x629c68 "process attach -p 1568",
add_to_history=true, result=..., override_context=0x0,
repeat_on_empty_command=true, no_context_switching=false)
at
/home/jo/lldb/llvm/tools/lldb/source/Interpreter/CommandInterpreter.cpp:1510
#12 0x00007ffff4ed4c06 in lldb::SBCommandInterpreter::HandleCommand
(this=0x7fffffffb490, command_line=0x629c68 "process attach -p 1568",
result=..., add_to_history=true) at
/home/jo/lldb/llvm/tools/lldb/source/API/SBCommandInterpreter.cpp:97
#13 0x0000000000413d4a in Driver::HandleIOEvent (this=0x7fffffffdf50,
event=...) at /home/jo/lldb/llvm/tools/lldb/tools/driver/Driver.cpp:933
#14 0x0000000000415017 in Driver::MainLoop (this=0x7fffffffdf50) at
/home/jo/lldb/llvm/tools/lldb/tools/driver/Driver.cpp:1341
#15 0x00000000004155cd in main (argc=1, argv=0x7fffffffe158,
envp=0x7fffffffe168) at
/home/jo/lldb/llvm/tools/lldb/tools/driver/Driver.cpp:1460
- GetTarget().GetExecutableModule()->GetObjectFile(); returns a null
pointer, on both repositories.
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. :)
On Wed, Jan 4, 2012 at 6:30 PM, <[email protected]> wrote:
> FYI - see patch titled "[PATCH] Merge of Linux and FreeBSD"
> sent to lldb-commits and hopefully committed soon. :)
>
> -Dawn
>
> On Wed, Jan 04, 2012 at 02:45:54PM -0800, Mark Peek wrote:
> > [Resending from my subscribed email address]
> >
> > Having taken a snapshot of lldb and pushed it into github, we have
> developed a
> > patch set to refactor the Linux and FreeBSD support to reduce the
> differences
> > and improve compatibility. The current repo has been built and run on
> 64bit
> > FreeBSD and Linux systems.
> >
> > The github repo is located here:
> >
> > https://github.com/fbsd/lldb
> >
> > And a patch set against rXXXXX of lldb is here:
> >
> > http://people.freebsd.org/~mp/lldb_r147532.patch
> >
> > We'd like the current work to not diverge too far away from the main
> repo and
> > we thought others might want to play with this or help out. Some of the
> todo's
> > on our list are:
> >
> > - Verify i386 operation on Linux, implement/verify on FreeBSD
> > - Verify attach support
> > - FreeBSD stop at exit
> > - thread support
> > - core file support
> > - Better process control for interrupting inferior
> > - Get buildbot passing reliably
> >
> > Are there any volunteers with commit bits willing to review and commit
> this
> > patch to the lldb repo? Dawn is going to follow up with a formal patch to
> > lldb-commits@.
> >
> > Thanks,
> > Mark, Kip and Dawn
> >
> > _______________________________________________
> > lldb-dev mailing list
> > [email protected]
> > http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev
>
Index: source/Plugins/Process/Utility/RegisterContextDarwin_i386.h
===================================================================
--- source/Plugins/Process/Utility/RegisterContextDarwin_i386.h (revision 149184)
+++ source/Plugins/Process/Utility/RegisterContextDarwin_i386.h (working copy)
@@ -11,6 +11,8 @@
#define liblldb_RegisterContextDarwin_i386_h_
// C Includes
+#include <stddef.h>
+
// C++ Includes
// Other libraries and framework includes
// Project includes
Index: source/Plugins/Process/Utility/RegisterContextDarwin_x86_64.h
===================================================================
--- source/Plugins/Process/Utility/RegisterContextDarwin_x86_64.h (revision 149184)
+++ source/Plugins/Process/Utility/RegisterContextDarwin_x86_64.h (working copy)
@@ -11,6 +11,7 @@
#define liblldb_RegisterContextDarwin_x86_64_h_
// C Includes
+#include <stddef.h>
// C++ Includes
// Other libraries and framework includes
// Project includes
Index: source/Plugins/Process/Utility/RegisterContextDarwin_i386.cpp
===================================================================
--- source/Plugins/Process/Utility/RegisterContextDarwin_i386.cpp (revision 149184)
+++ source/Plugins/Process/Utility/RegisterContextDarwin_i386.cpp (working copy)
@@ -11,6 +11,7 @@
// C Includes
// C++ Includes
// Other libraries and framework includes
+
#include "lldb/Core/DataBufferHeap.h"
#include "lldb/Core/DataExtractor.h"
#include "lldb/Core/Log.h"
Index: source/Core/Stream.cpp
===================================================================
--- source/Core/Stream.cpp (revision 149184)
+++ source/Core/Stream.cpp (working copy)
@@ -284,7 +284,7 @@
Stream&
Stream::operator<< (void *p)
{
- Printf ("0x%.*tx", (int)sizeof(void*) * 2, (ptrdiff_t)p);
+ Printf ("0x%.*tx", (int)sizeof(void*) * 2, (std::ptrdiff_t)p);
return *this;
}
diff --git a/include/lldb/Host/Host.h b/include/lldb/Host/Host.h
index 846b2b4..d80fab4 100644
--- a/include/lldb/Host/Host.h
+++ b/include/lldb/Host/Host.h
@@ -11,6 +11,7 @@
#define liblldb_Host_h_
#if defined(__cplusplus)
+#include <stdarg.h>
#include "lldb/lldb-private.h"
#include "lldb/Core/StringList.h"
diff --git a/source/Core/Stream.cpp b/source/Core/Stream.cpp
index 47b794b..162fe6d 100644
--- a/source/Core/Stream.cpp
+++ b/source/Core/Stream.cpp
@@ -284,7 +284,7 @@ Stream::operator<< (const char *s)
Stream&
Stream::operator<< (void *p)
{
- Printf ("0x%.*tx", (int)sizeof(void*) * 2, (ptrdiff_t)p);
+ Printf ("0x%.*tx", (int)sizeof(void*) * 2, (std::ptrdiff_t)p);
return *this;
}
diff --git a/source/Plugins/Process/Utility/RegisterContextDarwin_i386.h b/source/Plugins/Process/Utility/RegisterContextDarwin_i386.h
index 773aa62..bb4413e 100644
--- a/source/Plugins/Process/Utility/RegisterContextDarwin_i386.h
+++ b/source/Plugins/Process/Utility/RegisterContextDarwin_i386.h
@@ -11,6 +11,7 @@
#define liblldb_RegisterContextDarwin_i386_h_
// C Includes
+#include <stddef.h>
// C++ Includes
// Other libraries and framework includes
// Project includes
diff --git a/source/Plugins/Process/Utility/RegisterContextDarwin_x86_64.h b/source/Plugins/Process/Utility/RegisterContextDarwin_x86_64.h
index b2ed085..07214e2 100644
--- a/source/Plugins/Process/Utility/RegisterContextDarwin_x86_64.h
+++ b/source/Plugins/Process/Utility/RegisterContextDarwin_x86_64.h
@@ -11,6 +11,7 @@
#define liblldb_RegisterContextDarwin_x86_64_h_
// C Includes
+#include <stddef.h>
// C++ Includes
// Other libraries and framework includes
// Project includes
_______________________________________________
lldb-dev mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev