Patch from dawn@burble.org to build on linux!

llvm-svn: 141593
This commit is contained in:
Johnny Chen 2011-10-10 23:11:50 +00:00
parent c11b7c3805
commit 48d042b659
5 changed files with 21 additions and 6 deletions

View File

@ -112,7 +112,7 @@ DynamicLoaderLinuxDYLD::DidAttach()
executable = m_process->GetTarget().GetExecutableModule();
load_offset = ComputeLoadOffset();
if (!executable.empty() && load_offset != LLDB_INVALID_ADDRESS)
if (executable.get() && load_offset != LLDB_INVALID_ADDRESS)
{
ModuleList module_list;
module_list.Append(executable);
@ -132,7 +132,7 @@ DynamicLoaderLinuxDYLD::DidLaunch()
executable = m_process->GetTarget().GetExecutableModule();
load_offset = ComputeLoadOffset();
if (!executable.empty() && load_offset != LLDB_INVALID_ADDRESS)
if (executable.get() && load_offset != LLDB_INVALID_ADDRESS)
{
ModuleList module_list;
module_list.Append(executable);
@ -264,7 +264,7 @@ DynamicLoaderLinuxDYLD::RefreshModules()
{
FileSpec file(I->path.c_str(), true);
ModuleSP module_sp = LoadModuleAtAddress(file, I->base_addr);
if (!module_sp.empty())
if (module_sp.get())
new_modules.Append(module_sp);
}
m_process->GetTarget().ModulesDidLoad(new_modules);
@ -280,7 +280,7 @@ DynamicLoaderLinuxDYLD::RefreshModules()
FileSpec file(I->path.c_str(), true);
ModuleSP module_sp =
loaded_modules.FindFirstModuleForFileSpec(file, NULL, NULL);
if (!module_sp.empty())
if (module_sp.get())
old_modules.Append(module_sp);
}
m_process->GetTarget().ModulesDidUnload(old_modules);
@ -355,7 +355,7 @@ DynamicLoaderLinuxDYLD::LoadAllCurrentModules()
{
FileSpec file(I->path.c_str(), false);
ModuleSP module_sp = LoadModuleAtAddress(file, I->base_addr);
if (!module_sp.empty())
if (module_sp.get())
module_list.Append(module_sp);
}

View File

@ -437,6 +437,13 @@ ProcessLinux::UpdateThreadListIfNeeded()
return m_thread_list.GetSize(false);
}
uint32_t
ProcessLinux::UpdateThreadList(ThreadList &old_thread_list, ThreadList &new_thread_list)
{
// FIXME: Should this be implemented?
return 0;
}
ByteOrder
ProcessLinux::GetByteOrder() const
{

View File

@ -129,6 +129,10 @@ public:
virtual uint32_t
UpdateThreadListIfNeeded();
uint32_t
UpdateThreadList(lldb_private::ThreadList &old_thread_list,
lldb_private::ThreadList &new_thread_list);
virtual lldb::ByteOrder
GetByteOrder() const;

View File

@ -241,7 +241,7 @@ ReadRegOperation::Execute(ProcessMonitor *monitor)
// Set errno to zero so that we can detect a failed peek.
errno = 0;
unsigned long data = ptrace(PTRACE_PEEKUSER, pid, m_offset, NULL);
uint32_t data = ptrace(PTRACE_PEEKUSER, pid, m_offset, NULL);
if (data == -1UL && errno)
m_result = false;

View File

@ -94,7 +94,9 @@ lldb_private::Initialize ()
UnwindAssemblyInstEmulation::Initialize();
UnwindAssembly_x86::Initialize();
EmulateInstructionARM::Initialize ();
#if !defined (__linux__)
ObjectFilePECOFF::Initialize ();
#endif
#if defined (__APPLE__)
//----------------------------------------------------------------------
// Apple/Darwin hosted plugins
@ -166,7 +168,9 @@ lldb_private::Terminate ()
UnwindAssembly_x86::Terminate();
UnwindAssemblyInstEmulation::Terminate();
EmulateInstructionARM::Terminate ();
#if !defined (__linux__)
ObjectFilePECOFF::Terminate ();
#endif
#if defined (__APPLE__)
DynamicLoaderMacOSXDYLD::Terminate();