diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2016-07-23 20:50:09 +0000 | 
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2016-07-23 20:50:09 +0000 | 
| commit | f3fbd1c0586ff6ec7895991e6c28f61a503c36a8 (patch) | |
| tree | 48d008fd3df8c0e73271a4b18474e0aac6dbfe33 /source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp | |
| parent | 2fc5d2d1dfaf623ce4e24cd8590565902f8c557c (diff) | |
Notes
Diffstat (limited to 'source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp')
| -rw-r--r-- | source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp | 19 | 
1 files changed, 16 insertions, 3 deletions
diff --git a/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp b/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp index a502aa03eb26..d3c1c805a83b 100644 --- a/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp +++ b/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp @@ -30,6 +30,7 @@  #include "lldb/Interpreter/OptionValueFileSpecList.h"  #include "lldb/Interpreter/OptionValueProperties.h"  #include "lldb/Interpreter/Property.h" +#include "lldb/Symbol/ObjectFile.h"  #include "lldb/Target/Platform.h"  #include "lldb/Target/Process.h"  #include "lldb/Target/Target.h" @@ -881,12 +882,24 @@ PlatformDarwinKernel::GetSharedModule (const ModuleSpec &module_spec,                  ModuleSP module_sp (new Module (kern_spec));                  if (module_sp && module_sp->GetObjectFile() && module_sp->MatchesModuleSpec (kern_spec))                  { -                    Error error; -                    error = ModuleList::GetSharedModule (kern_spec, module_sp, NULL, NULL, NULL); -                    if (module_sp && module_sp->GetObjectFile()) +                    // module_sp is an actual kernel binary we want to add. +                    if (process)                      { +                        process->GetTarget().GetImages().AppendIfNeeded (module_sp); +                        error.Clear();                          return error;                      } +                    else +                    { +                        error = ModuleList::GetSharedModule (kern_spec, module_sp, NULL, NULL, NULL); +                        if (module_sp  +                            && module_sp->GetObjectFile()  +                            && module_sp->GetObjectFile()->GetType() != ObjectFile::Type::eTypeCoreFile) +                        { +                            return error; +                        } +                        module_sp.reset(); +                    }                  }              }          }  | 
