From 0584d7fc3492c402e69f7a426e487265938a27eb Mon Sep 17 00:00:00 2001 From: Ed Maste Date: Tue, 20 Aug 2013 09:17:13 +0000 Subject: Fix crash when connecting to gdbserver without loading a file first. Patch from Abid, Hafiz. llvm-svn: 188776 --- .../source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp') diff --git a/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp b/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp index f1275e7ecb1..91c7cd3dfca 100644 --- a/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp +++ b/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp @@ -449,6 +449,9 @@ DynamicLoaderPOSIXDYLD::ComputeLoadOffset() return LLDB_INVALID_ADDRESS; ModuleSP module = m_process->GetTarget().GetExecutableModule(); + if (!module) + return LLDB_INVALID_ADDRESS; + ObjectFile *exe = module->GetObjectFile(); Address file_entry = exe->GetEntryPointAddress(); -- cgit v1.2.3