diff options
Diffstat (limited to 'lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp')
| -rw-r--r-- | lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp index 7deadc0a493..a0d47b95c90 100644 --- a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp +++ b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp @@ -18,6 +18,7 @@ #include "lldb/Core/Error.h" #include "lldb/Core/Module.h" #include "lldb/Core/ModuleSpec.h" +#include "lldb/Core/Timer.h" #include "lldb/Host/Host.h" #include "lldb/Host/Symbols.h" #include "lldb/Symbol/ObjectFile.h" @@ -47,6 +48,37 @@ PlatformDarwin::~PlatformDarwin() { } +FileSpec +PlatformDarwin::LocateExecutableScriptingResource (const ModuleSpec &module_spec) +{ + const FileSpec *exec_fspec = module_spec.GetFileSpecPtr(); + const ArchSpec *arch = module_spec.GetArchitecturePtr(); + const UUID *uuid = module_spec.GetUUIDPtr(); + + Timer scoped_timer (__PRETTY_FUNCTION__, + "LocateExecutableScriptingResource (file = %s, arch = %s, uuid = %p)", + exec_fspec ? exec_fspec->GetFilename().AsCString ("<NULL>") : "<NULL>", + arch ? arch->GetArchitectureName() : "<NULL>", + uuid); + + + FileSpec symbol_fspec (Symbols::LocateExecutableSymbolFile(module_spec)); + + FileSpec script_fspec; + + if (symbol_fspec && symbol_fspec.Exists()) + { + // for OSX we are going to be in .dSYM/Contents/Resources/DWARF/<basename> + // let us go to .dSYM/Contents/Resources/Python/<basename>.py and see if the file exists + StreamString path_string; + path_string.Printf("%s/../Python/%s.py",symbol_fspec.GetDirectory().GetCString(),module_spec.GetFileSpec().GetFileNameStrippingExtension().GetCString()); + script_fspec.SetFile(path_string.GetData(), true); + if (!script_fspec.Exists()) + script_fspec.Clear(); + } + + return script_fspec; +} Error PlatformDarwin::ResolveExecutable (const FileSpec &exe_file, |

