diff options
author | Greg Clayton <gclayton@apple.com> | 2012-02-26 05:51:37 +0000 |
---|---|---|
committer | Greg Clayton <gclayton@apple.com> | 2012-02-26 05:51:37 +0000 |
commit | b9a01b3990ee0911c560939b8caa282e03b7f42d (patch) | |
tree | da515ffdc0753faf5c08d615a08b30bbaa56dee9 /lldb/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp | |
parent | a640db900abcc49d5390192b2bcbd7760a9c3113 (diff) | |
download | bcm5719-llvm-b9a01b3990ee0911c560939b8caa282e03b7f42d.tar.gz bcm5719-llvm-b9a01b3990ee0911c560939b8caa282e03b7f42d.zip |
Made a ModuleSpec class in Module.h which can specify a module using one or
more of the local path, platform path, associated symbol file, UUID, arch,
object name and object offset. This allows many of the calls that were
GetSharedModule to reduce the number of arguments that were used in a call
to these functions. It also allows a module to be created with a ModuleSpec
which allows many things to be specified prior to any accessors being called
on the Module class itself.
I was running into problems when adding support for "target symbol add"
where you can specify a stand alone debug info file after debugging has started
where I needed to specify the associated symbol file path and if I waited until
after construction, the wrong symbol file had already been located. By using
the ModuleSpec it allows us to construct a module with as little or as much
information as needed and not have to change the parameter list.
llvm-svn: 151476
Diffstat (limited to 'lldb/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp')
-rw-r--r-- | lldb/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp | 33 |
1 files changed, 10 insertions, 23 deletions
diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp b/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp index 5210682667e..5e08581f975 100644 --- a/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp +++ b/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp @@ -142,11 +142,8 @@ PlatformRemoteiOS::ResolveExecutable (const FileSpec &exe_file, { if (exe_arch.IsValid()) { - error = ModuleList::GetSharedModule (resolved_exe_file, - exe_arch, - NULL, - NULL, - 0, + ModuleSpec module_spec (resolved_exe_file, exe_arch); + error = ModuleList::GetSharedModule (module_spec, exe_module_sp, NULL, NULL, @@ -163,11 +160,8 @@ PlatformRemoteiOS::ResolveExecutable (const FileSpec &exe_file, ArchSpec platform_arch; for (uint32_t idx = 0; GetSupportedArchitectureAtIndex (idx, platform_arch); ++idx) { - error = ModuleList::GetSharedModule (resolved_exe_file, - platform_arch, - NULL, - NULL, - 0, + ModuleSpec module_spec (resolved_exe_file, platform_arch); + error = ModuleList::GetSharedModule (module_spec, exe_module_sp, NULL, NULL, @@ -363,11 +357,7 @@ PlatformRemoteiOS::GetFile (const FileSpec &platform_file, } Error -PlatformRemoteiOS::GetSharedModule (const FileSpec &platform_file, - const ArchSpec &arch, - const UUID *uuid_ptr, - const ConstString *object_name_ptr, - off_t object_offset, +PlatformRemoteiOS::GetSharedModule (const ModuleSpec &module_spec, ModuleSP &module_sp, const FileSpecList *module_search_paths_ptr, ModuleSP *old_module_sp_ptr, @@ -377,21 +367,18 @@ PlatformRemoteiOS::GetSharedModule (const FileSpec &platform_file, // system. So first we ask for the file in the cached SDK, // then we attempt to get a shared module for the right architecture // with the right UUID. - Error error; + const FileSpec &platform_file = module_spec.GetFileSpec(); + FileSpec local_file; - error = GetFile (platform_file, uuid_ptr, local_file); + Error error (GetFile (platform_file, module_spec.GetUUIDPtr(), local_file)); if (error.Success()) { - error = ResolveExecutable (local_file, arch, module_sp, module_search_paths_ptr); + error = ResolveExecutable (local_file, module_spec.GetArchitecture(), module_sp, module_search_paths_ptr); } else { const bool always_create = false; - error = ModuleList::GetSharedModule (platform_file, - arch, - uuid_ptr, - object_name_ptr, - object_offset, + error = ModuleList::GetSharedModule (module_spec, module_sp, module_search_paths_ptr, old_module_sp_ptr, |