summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Platform/Windows/PlatformWindows.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Plugins/Platform/Windows/PlatformWindows.cpp')
-rw-r--r--lldb/source/Plugins/Platform/Windows/PlatformWindows.cpp50
1 files changed, 23 insertions, 27 deletions
diff --git a/lldb/source/Plugins/Platform/Windows/PlatformWindows.cpp b/lldb/source/Plugins/Platform/Windows/PlatformWindows.cpp
index c6e79e4e190..ade4dccf6f8 100644
--- a/lldb/source/Plugins/Platform/Windows/PlatformWindows.cpp
+++ b/lldb/source/Plugins/Platform/Windows/PlatformWindows.cpp
@@ -196,8 +196,7 @@ PlatformWindows::~PlatformWindows()
}
Error
-PlatformWindows::ResolveExecutable (const FileSpec &exe_file,
- const ArchSpec &exe_arch,
+PlatformWindows::ResolveExecutable (const ModuleSpec &ms,
lldb::ModuleSP &exe_module_sp,
const FileSpecList *module_search_paths_ptr)
{
@@ -205,25 +204,25 @@ PlatformWindows::ResolveExecutable (const FileSpec &exe_file,
// Nothing special to do here, just use the actual file and architecture
char exe_path[PATH_MAX];
- FileSpec resolved_exe_file (exe_file);
+ ModuleSpec resolved_module_spec(ms);
if (IsHost())
{
// if we cant resolve the executable loation based on the current path variables
- if (!resolved_exe_file.Exists())
+ if (!resolved_module_spec.GetFileSpec().Exists())
{
- exe_file.GetPath(exe_path, sizeof(exe_path));
- resolved_exe_file.SetFile(exe_path, true);
+ resolved_module_spec.GetFileSpec().GetPath(exe_path, sizeof(exe_path));
+ resolved_module_spec.GetFileSpec().SetFile(exe_path, true);
}
- if (!resolved_exe_file.Exists())
- resolved_exe_file.ResolveExecutableLocation ();
+ if (!resolved_module_spec.GetFileSpec().Exists())
+ resolved_module_spec.GetFileSpec().ResolveExecutableLocation ();
- if (resolved_exe_file.Exists())
+ if (resolved_module_spec.GetFileSpec().Exists())
error.Clear();
else
{
- exe_file.GetPath(exe_path, sizeof(exe_path));
+ ms.GetFileSpec().GetPath(exe_path, sizeof(exe_path));
error.SetErrorStringWithFormat("unable to find executable for '%s'", exe_path);
}
}
@@ -231,15 +230,14 @@ PlatformWindows::ResolveExecutable (const FileSpec &exe_file,
{
if (m_remote_platform_sp)
{
- error = m_remote_platform_sp->ResolveExecutable (exe_file,
- exe_arch,
+ error = m_remote_platform_sp->ResolveExecutable (ms,
exe_module_sp,
NULL);
}
else
{
// We may connect to a process and use the provided executable (Don't use local $PATH).
- if (resolved_exe_file.Exists())
+ if (resolved_module_spec.GetFileSpec().Exists())
error.Clear();
else
error.SetErrorStringWithFormat("the platform is not currently connected, and '%s' doesn't exist in the system root.", exe_path);
@@ -248,10 +246,9 @@ PlatformWindows::ResolveExecutable (const FileSpec &exe_file,
if (error.Success())
{
- ModuleSpec module_spec (resolved_exe_file, exe_arch);
- if (exe_arch.IsValid())
+ if (resolved_module_spec.GetArchitecture().IsValid())
{
- error = ModuleList::GetSharedModule (module_spec,
+ error = ModuleList::GetSharedModule (resolved_module_spec,
exe_module_sp,
NULL,
NULL,
@@ -261,8 +258,8 @@ PlatformWindows::ResolveExecutable (const FileSpec &exe_file,
{
exe_module_sp.reset();
error.SetErrorStringWithFormat ("'%s' doesn't contain the architecture %s",
- exe_file.GetPath().c_str(),
- exe_arch.GetArchitectureName());
+ resolved_module_spec.GetFileSpec().GetPath().c_str(),
+ resolved_module_spec.GetArchitecture().GetArchitectureName());
}
}
else
@@ -271,9 +268,9 @@ PlatformWindows::ResolveExecutable (const FileSpec &exe_file,
// the architectures that we should be using (in the correct order)
// and see if we can find a match that way
StreamString arch_names;
- for (uint32_t idx = 0; GetSupportedArchitectureAtIndex (idx, module_spec.GetArchitecture()); ++idx)
+ for (uint32_t idx = 0; GetSupportedArchitectureAtIndex (idx, resolved_module_spec.GetArchitecture()); ++idx)
{
- error = ModuleList::GetSharedModule (module_spec,
+ error = ModuleList::GetSharedModule (resolved_module_spec,
exe_module_sp,
NULL,
NULL,
@@ -289,21 +286,21 @@ PlatformWindows::ResolveExecutable (const FileSpec &exe_file,
if (idx > 0)
arch_names.PutCString (", ");
- arch_names.PutCString (module_spec.GetArchitecture().GetArchitectureName());
+ arch_names.PutCString (resolved_module_spec.GetArchitecture().GetArchitectureName());
}
if (error.Fail() || !exe_module_sp)
{
- if (exe_file.Readable())
+ if (resolved_module_spec.GetFileSpec().Readable())
{
error.SetErrorStringWithFormat ("'%s' doesn't contain any '%s' platform architectures: %s",
- exe_file.GetPath().c_str(),
+ resolved_module_spec.GetFileSpec().GetPath().c_str(),
GetPluginName().GetCString(),
arch_names.GetString().c_str());
}
else
{
- error.SetErrorStringWithFormat("'%s' is not readable", exe_file.GetPath().c_str());
+ error.SetErrorStringWithFormat("'%s' is not readable", resolved_module_spec.GetFileSpec().GetPath().c_str());
}
}
}
@@ -518,7 +515,6 @@ lldb::ProcessSP
PlatformWindows::Attach(ProcessAttachInfo &attach_info,
Debugger &debugger,
Target *target,
- Listener &listener,
Error &error)
{
lldb::ProcessSP process_sp;
@@ -547,7 +543,7 @@ PlatformWindows::Attach(ProcessAttachInfo &attach_info,
// The Windows platform always currently uses the GDB remote debugger plug-in
// so even when debugging locally we are debugging remotely!
// Just like the darwin plugin.
- process_sp = target->CreateProcess (listener, "gdb-remote", NULL);
+ process_sp = target->CreateProcess (attach_info.GetListenerForProcess(debugger), "gdb-remote", NULL);
if (process_sp)
error = process_sp->Attach (attach_info);
@@ -556,7 +552,7 @@ PlatformWindows::Attach(ProcessAttachInfo &attach_info,
else
{
if (m_remote_platform_sp)
- process_sp = m_remote_platform_sp->Attach (attach_info, debugger, target, listener, error);
+ process_sp = m_remote_platform_sp->Attach (attach_info, debugger, target, error);
else
error.SetErrorString ("the platform is not currently connected");
}
OpenPOWER on IntegriCloud