mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-01-05 07:32:36 +00:00
[lldb, windows] Update two more locations that use LaunchThread to the new function signature
llvm-svn: 365526
This commit is contained in:
parent
22b2c3d651
commit
631b5f7dc0
@ -14,6 +14,7 @@
|
||||
|
||||
#include "llvm/ADT/STLExtras.h"
|
||||
#include "llvm/Support/ConvertUTF.h"
|
||||
#include "llvm/Support/WindowsError.h"
|
||||
|
||||
#include <psapi.h>
|
||||
|
||||
@ -94,8 +95,7 @@ llvm::Expected<HostThread> HostProcessWindows::StartMonitoring(
|
||||
HostProcessWindows::MonitorThread,
|
||||
info);
|
||||
} else {
|
||||
DWORD err = GetLastError();
|
||||
return llvm::errorCodeToError(std::error_code(err, std::system_category()));
|
||||
return llvm::errorCodeToError(llvm::mapWindowsError(GetLastError()));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -63,16 +63,18 @@ Status DebuggerThread::DebugLaunch(const ProcessLaunchInfo &launch_info) {
|
||||
Log *log = ProcessWindowsLog::GetLogIfAny(WINDOWS_LOG_PROCESS);
|
||||
LLDB_LOG(log, "launching '{0}'", launch_info.GetExecutableFile().GetPath());
|
||||
|
||||
Status error;
|
||||
Status result;
|
||||
DebugLaunchContext *context = new DebugLaunchContext(this, launch_info);
|
||||
HostThread slave_thread(ThreadLauncher::LaunchThread(
|
||||
|
||||
llvm::Expected<HostThread> slave_thread = ThreadLauncher::LaunchThread(
|
||||
"lldb.plugin.process-windows.slave[?]", DebuggerThreadLaunchRoutine,
|
||||
context, &error));
|
||||
context);
|
||||
if (!slave_thread) {
|
||||
result = Status(slave_thread.takeError());
|
||||
LLDB_LOG(log, "couldn't launch debugger thread. {0}", result);
|
||||
}
|
||||
|
||||
if (!error.Success())
|
||||
LLDB_LOG(log, "couldn't launch debugger thread. {0}", error);
|
||||
|
||||
return error;
|
||||
return result;
|
||||
}
|
||||
|
||||
Status DebuggerThread::DebugAttach(lldb::pid_t pid,
|
||||
@ -80,16 +82,18 @@ Status DebuggerThread::DebugAttach(lldb::pid_t pid,
|
||||
Log *log = ProcessWindowsLog::GetLogIfAny(WINDOWS_LOG_PROCESS);
|
||||
LLDB_LOG(log, "attaching to '{0}'", pid);
|
||||
|
||||
Status error;
|
||||
Status result;
|
||||
DebugAttachContext *context = new DebugAttachContext(this, pid, attach_info);
|
||||
HostThread slave_thread(ThreadLauncher::LaunchThread(
|
||||
|
||||
llvm::Expected<HostThread> slave_thread = ThreadLauncher::LaunchThread(
|
||||
"lldb.plugin.process-windows.slave[?]", DebuggerThreadAttachRoutine,
|
||||
context, &error));
|
||||
context);
|
||||
if (!slave_thread) {
|
||||
result = Status(slave_thread.takeError());
|
||||
LLDB_LOG(log, "couldn't attach to process '{0}'. {1}", pid, result);
|
||||
}
|
||||
|
||||
if (!error.Success())
|
||||
LLDB_LOG(log, "couldn't attach to process '{0}'. {1}", pid, error);
|
||||
|
||||
return error;
|
||||
return result;
|
||||
}
|
||||
|
||||
lldb::thread_result_t DebuggerThread::DebuggerThreadLaunchRoutine(void *data) {
|
||||
|
Loading…
Reference in New Issue
Block a user