Patch from Viktor Kutuzov <vkutuzov@accesssoftek.com>:
Hello everyone,
please find the attached patch for TOT and lldb-platform-work branch, which provides the following changes:
- fixed a crash in the ProcessPOSIX constructor when an executable module object is not yet created.
- added support for the multi instanciated FreeBSD platform objects (the local host and remote as example).
- enabled the remote gdb plugin on FreeBSD.
git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@154724 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Plugins/Process/POSIX/ProcessPOSIX.cpp b/source/Plugins/Process/POSIX/ProcessPOSIX.cpp
index b8b989b..fd1b0e0 100644
--- a/source/Plugins/Process/POSIX/ProcessPOSIX.cpp
+++ b/source/Plugins/Process/POSIX/ProcessPOSIX.cpp
@@ -66,6 +66,7 @@
ProcessPOSIX::ProcessPOSIX(Target& target, Listener &listener)
: Process(target, listener),
+ m_byte_order(lldb::endian::InlHostByteOrder()),
m_monitor(NULL),
m_module(NULL),
m_in_limbo(false),
@@ -73,8 +74,9 @@
{
// FIXME: Putting this code in the ctor and saving the byte order in a
// member variable is a hack to avoid const qual issues in GetByteOrder.
- ObjectFile *obj_file = GetTarget().GetExecutableModule()->GetObjectFile();
- m_byte_order = obj_file->GetByteOrder();
+ lldb::ModuleSP module = GetTarget().GetExecutableModule();
+ if (module != NULL && module->GetObjectFile() != NULL)
+ m_byte_order = module->GetObjectFile()->GetByteOrder();
}
ProcessPOSIX::~ProcessPOSIX()