LLDB  mainline
NativeProcessWindows.cpp
Go to the documentation of this file.
1 //===-- NativeProcessWindows.cpp ------------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
10 #include <psapi.h>
11 
12 #include "NativeProcessWindows.h"
13 #include "NativeThreadWindows.h"
14 #include "lldb/Host/FileSystem.h"
16 #include "lldb/Host/HostProcess.h"
22 #include "lldb/Target/Process.h"
23 #include "lldb/Utility/State.h"
24 #include "llvm/Support/ConvertUTF.h"
25 #include "llvm/Support/Errc.h"
26 #include "llvm/Support/Error.h"
27 #include "llvm/Support/Format.h"
28 #include "llvm/Support/Threading.h"
29 #include "llvm/Support/raw_ostream.h"
30 
31 #include "DebuggerThread.h"
32 #include "ExceptionRecord.h"
33 #include "ProcessWindowsLog.h"
34 
35 #include <tlhelp32.h>
36 
37 #pragma warning(disable : 4005)
38 #include "winternl.h"
39 #include <ntstatus.h>
40 
41 using namespace lldb;
42 using namespace lldb_private;
43 using namespace llvm;
44 
45 namespace lldb_private {
46 
47 NativeProcessWindows::NativeProcessWindows(ProcessLaunchInfo &launch_info,
48  NativeDelegate &delegate,
49  llvm::Error &E)
51  launch_info.GetPTY().ReleasePrimaryFileDescriptor(),
52  delegate),
53  ProcessDebugger(), m_arch(launch_info.GetArchitecture()) {
54  ErrorAsOutParameter EOut(&E);
55  DebugDelegateSP delegate_sp(new NativeDebugDelegate(*this));
56  E = LaunchProcess(launch_info, delegate_sp).ToError();
57  if (E)
58  return;
59 
61 }
62 
64  NativeDelegate &delegate,
65  llvm::Error &E)
66  : NativeProcessProtocol(pid, terminal_fd, delegate), ProcessDebugger() {
67  ErrorAsOutParameter EOut(&E);
68  DebugDelegateSP delegate_sp(new NativeDebugDelegate(*this));
69  ProcessAttachInfo attach_info;
70  attach_info.SetProcessID(pid);
71  E = AttachProcess(pid, attach_info, delegate_sp).ToError();
72  if (E)
73  return;
74 
76 
78  if (!Host::GetProcessInfo(pid, info)) {
79  E = createStringError(inconvertibleErrorCode(),
80  "Cannot get process information");
81  return;
82  }
83  m_arch = info.GetArchitecture();
84 }
85 
88  Status error;
89  llvm::sys::ScopedLock lock(m_mutex);
90 
91  StateType state = GetState();
92  if (state == eStateStopped || state == eStateCrashed) {
93  LLDB_LOG(log, "process {0} is in state {1}. Resuming...",
94  GetDebuggedProcessId(), state);
95  LLDB_LOG(log, "resuming {0} threads.", m_threads.size());
96 
97  bool failed = false;
98  for (uint32_t i = 0; i < m_threads.size(); ++i) {
99  auto thread = static_cast<NativeThreadWindows *>(m_threads[i].get());
100  const ResumeAction *const action =
101  resume_actions.GetActionForThread(thread->GetID(), true);
102  if (action == nullptr)
103  continue;
104 
105  switch (action->state) {
106  case eStateRunning:
107  case eStateStepping: {
108  Status result = thread->DoResume(action->state);
109  if (result.Fail()) {
110  failed = true;
111  LLDB_LOG(log,
112  "Trying to resume thread at index {0}, but failed with "
113  "error {1}.",
114  i, result);
115  }
116  break;
117  }
118  case eStateSuspended:
119  case eStateStopped:
120  llvm_unreachable("Unexpected state");
121 
122  default:
123  return Status(
124  "NativeProcessWindows::%s (): unexpected state %s specified "
125  "for pid %" PRIu64 ", tid %" PRIu64,
126  __FUNCTION__, StateAsCString(action->state), GetID(),
127  thread->GetID());
128  }
129  }
130 
131  if (failed) {
132  error.SetErrorString("NativeProcessWindows::DoResume failed");
133  } else {
135  }
136 
137  // Resume the debug loop.
138  ExceptionRecordSP active_exception =
139  m_session_data->m_debugger->GetActiveException().lock();
140  if (active_exception) {
141  // Resume the process and continue processing debug events. Mask the
142  // exception so that from the process's view, there is no indication that
143  // anything happened.
144  m_session_data->m_debugger->ContinueAsyncException(
146  }
147  } else {
148  LLDB_LOG(log, "error: process {0} is in state {1}. Returning...",
150  }
151 
152  return error;
153 }
154 
157  return static_cast<NativeThreadWindows *>(
159 }
160 
162  bool caused_stop = false;
163  StateType state = GetState();
164  if (state != eStateStopped)
165  return HaltProcess(caused_stop);
166  return Status();
167 }
168 
170  Status error;
172  StateType state = GetState();
173  if (state != eStateExited && state != eStateDetached) {
174  error = DetachProcess();
175  if (error.Success())
177  else
178  LLDB_LOG(log, "Detaching process error: {0}", error);
179  } else {
180  error.SetErrorStringWithFormatv("error: process {0} in state = {1}, but "
181  "cannot detach it in this state.",
182  GetID(), state);
183  LLDB_LOG(log, "error: {0}", error);
184  }
185  return error;
186 }
187 
189  Status error;
190  error.SetErrorString("Windows does not support sending signals to processes");
191  return error;
192 }
193 
195 
197  StateType state = GetState();
198  return DestroyProcess(state);
199 }
200 
201 Status NativeProcessWindows::IgnoreSignals(llvm::ArrayRef<int> signals) {
202  return Status();
203 }
204 
206  MemoryRegionInfo &range_info) {
207  return ProcessDebugger::GetMemoryRegionInfo(load_addr, range_info);
208 }
209 
211  size_t size, size_t &bytes_read) {
212  return ProcessDebugger::ReadMemory(addr, buf, size, bytes_read);
213 }
214 
216  size_t size, size_t &bytes_written) {
217  return ProcessDebugger::WriteMemory(addr, buf, size, bytes_written);
218 }
219 
221  lldb::addr_t &addr) {
222  return ProcessDebugger::AllocateMemory(size, permissions, addr);
223 }
224 
227 }
228 
230 
232  StateType state = GetState();
233  switch (state) {
234  case eStateCrashed:
235  case eStateDetached:
236  case eStateExited:
237  case eStateInvalid:
238  case eStateUnloaded:
239  return false;
240  default:
241  return true;
242  }
243 }
244 
246  lldb::StopReason reason,
247  std::string description) {
248  SetCurrentThreadID(thread.GetID());
249 
250  ThreadStopInfo stop_info;
251  stop_info.reason = reason;
252 
253  // No signal support on Windows but required to provide a 'valid' signum.
254  if (reason == StopReason::eStopReasonException) {
255  stop_info.details.exception.type = 0;
256  stop_info.details.exception.data_count = 0;
257  } else {
258  stop_info.details.signal.signo = SIGTRAP;
259  }
260 
261  thread.SetStopReason(stop_info, description);
262 }
263 
265  lldb::StopReason reason,
266  std::string description) {
267  NativeThreadWindows *thread = GetThreadByID(thread_id);
268  if (!thread)
269  return;
270 
271  for (uint32_t i = 0; i < m_threads.size(); ++i) {
272  auto t = static_cast<NativeThreadWindows *>(m_threads[i].get());
273  Status error = t->DoStop();
274  if (error.Fail())
275  exit(1);
276  }
277  SetStopReasonForThread(*thread, reason, description);
278 }
279 
281 
282 llvm::ErrorOr<std::unique_ptr<llvm::MemoryBuffer>>
284  // Not available on this target.
285  return llvm::errc::not_supported;
286 }
287 
289  auto it = m_software_breakpoints.find(addr);
290  if (it == m_software_breakpoints.end())
291  return false;
292  return true;
293 }
294 
296  bool hardware) {
297  if (hardware)
298  return SetHardwareBreakpoint(addr, size);
299  return SetSoftwareBreakpoint(addr, size);
300 }
301 
303  bool hardware) {
304  if (hardware)
305  return RemoveHardwareBreakpoint(addr);
306  return RemoveSoftwareBreakpoint(addr);
307 }
308 
310  Status error;
311  if (!m_loaded_modules.empty())
312  return Status();
313 
314  // Retrieve loaded modules by a Target/Module free implemenation.
315  AutoHandle snapshot(CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, GetID()));
316  if (snapshot.IsValid()) {
317  MODULEENTRY32W me;
318  me.dwSize = sizeof(MODULEENTRY32W);
319  if (Module32FirstW(snapshot.get(), &me)) {
320  do {
321  std::string path;
322  if (!llvm::convertWideToUTF8(me.szExePath, path))
323  continue;
324 
325  FileSpec file_spec(path);
326  FileSystem::Instance().Resolve(file_spec);
327  m_loaded_modules[file_spec] = (addr_t)me.modBaseAddr;
328  } while (Module32Next(snapshot.get(), &me));
329  }
330 
331  if (!m_loaded_modules.empty())
332  return Status();
333  }
334 
335  error.SetError(::GetLastError(), lldb::ErrorType::eErrorTypeWin32);
336  return error;
337 }
338 
340  FileSpec &file_spec) {
342  if (error.Fail())
343  return error;
344 
345  FileSpec module_file_spec(module_path);
346  FileSystem::Instance().Resolve(module_file_spec);
347  for (auto &it : m_loaded_modules) {
348  if (it.first == module_file_spec) {
349  file_spec = it.first;
350  return Status();
351  }
352  }
353  return Status("Module (%s) not found in process %" PRIu64 "!",
354  module_file_spec.GetCString(), GetID());
355 }
356 
357 Status
358 NativeProcessWindows::GetFileLoadAddress(const llvm::StringRef &file_name,
359  lldb::addr_t &load_addr) {
361  if (error.Fail())
362  return error;
363 
364  load_addr = LLDB_INVALID_ADDRESS;
365  FileSpec file_spec(file_name);
366  FileSystem::Instance().Resolve(file_spec);
367  for (auto &it : m_loaded_modules) {
368  if (it.first == file_spec) {
369  load_addr = it.second;
370  return Status();
371  }
372  }
373  return Status("Can't get loaded address of file (%s) in process %" PRIu64 "!",
374  file_spec.GetCString(), GetID());
375 }
376 
379  LLDB_LOG(log, "Process {0} exited with code {1}", GetID(), exit_code);
380 
382 
383  // No signal involved. It is just an exit event.
384  WaitStatus wait_status(WaitStatus::Exit, exit_code);
385  SetExitStatus(wait_status, true);
386 
387  // Notify the native delegate.
388  SetState(eStateExited, true);
389 }
390 
393  LLDB_LOG(log, "Debugger connected to process {0}. Image base = {1:x}",
394  GetDebuggedProcessId(), image_base);
395 
396  // This is the earliest chance we can resolve the process ID and
397  // architecture if we don't know them yet.
400 
401  if (GetArchitecture().GetMachine() == llvm::Triple::UnknownArch) {
402  ProcessInstanceInfo process_info;
403  if (!Host::GetProcessInfo(GetDebuggedProcessId(), process_info)) {
404  LLDB_LOG(log, "Cannot get process information during debugger connecting "
405  "to process");
406  return;
407  }
408  SetArchitecture(process_info.GetArchitecture());
409  }
410 
411  // The very first one shall always be the main thread.
412  assert(m_threads.empty());
413  m_threads.push_back(std::make_unique<NativeThreadWindows>(
414  *this, m_session_data->m_debugger->GetMainThread()));
415 }
416 
419  const ExceptionRecord &record) {
421  llvm::sys::ScopedLock lock(m_mutex);
422 
423  // Let the debugger establish the internal status.
424  ProcessDebugger::OnDebugException(first_chance, record);
425 
426  static bool initial_stop = false;
427  if (!first_chance) {
428  SetState(eStateStopped, false);
429  }
430 
432  switch (record.GetExceptionCode()) {
433  case DWORD(STATUS_SINGLE_STEP):
434  case STATUS_WX86_SINGLE_STEP: {
436  if (NativeThreadWindows *thread = GetThreadByID(record.GetThreadID())) {
437  NativeRegisterContextWindows &reg_ctx = thread->GetRegisterContext();
438  Status error =
439  reg_ctx.GetWatchpointHitIndex(wp_id, record.GetExceptionAddress());
440  if (error.Fail())
441  LLDB_LOG(log,
442  "received error while checking for watchpoint hits, pid = "
443  "{0}, error = {1}",
444  thread->GetID(), error);
445  if (wp_id != LLDB_INVALID_INDEX32) {
446  addr_t wp_addr = reg_ctx.GetWatchpointAddress(wp_id);
447  addr_t wp_hit_addr = reg_ctx.GetWatchpointHitAddress(wp_id);
448  std::string desc =
449  formatv("{0} {1} {2}", wp_addr, wp_id, wp_hit_addr).str();
451  desc);
452  }
453  }
454  if (wp_id == LLDB_INVALID_INDEX32)
456 
457  SetState(eStateStopped, true);
458 
459  // Continue the debugger.
461  }
462  case DWORD(STATUS_BREAKPOINT):
465  LLDB_LOG(log, "Hit non-loader breakpoint at address {0:x}.",
466  record.GetExceptionAddress());
467 
469 
470  if (NativeThreadWindows *stop_thread =
471  GetThreadByID(record.GetThreadID())) {
472  auto &register_context = stop_thread->GetRegisterContext();
473  // The current EIP is AFTER the BP opcode, which is one byte '0xCC'
474  uint64_t pc = register_context.GetPC() - 1;
475  register_context.SetPC(pc);
476  }
477 
478  SetState(eStateStopped, true);
480  }
481 
482  if (!initial_stop) {
483  initial_stop = true;
484  LLDB_LOG(log,
485  "Hit loader breakpoint at address {0:x}, setting initial stop "
486  "event.",
487  record.GetExceptionAddress());
488 
489  // We are required to report the reason for the first stop after
490  // launching or being attached.
491  if (NativeThreadWindows *thread = GetThreadByID(record.GetThreadID()))
493 
494  // Do not notify the native delegate (e.g. llgs) since at this moment
495  // the program hasn't returned from Factory::Launch() and the delegate
496  // might not have an valid native process to operate on.
497  SetState(eStateStopped, false);
498 
499  // Hit the initial stop. Continue the application.
501  }
502 
503  LLVM_FALLTHROUGH;
504  default:
505  LLDB_LOG(log,
506  "Debugger thread reported exception {0:x} at address {1:x} "
507  "(first_chance={2})",
508  record.GetExceptionCode(), record.GetExceptionAddress(),
509  first_chance);
510 
511  {
512  std::string desc;
513  llvm::raw_string_ostream desc_stream(desc);
514  desc_stream << "Exception "
515  << llvm::format_hex(record.GetExceptionCode(), 8)
516  << " encountered at address "
517  << llvm::format_hex(record.GetExceptionAddress(), 8);
519  desc_stream.str().c_str());
520 
521  SetState(eStateStopped, true);
522  }
523 
524  // For non-breakpoints, give the application a chance to handle the
525  // exception first.
526  if (first_chance)
528  else
530  }
531 
532  return result;
533 }
534 
536  llvm::sys::ScopedLock lock(m_mutex);
537 
538  auto thread = std::make_unique<NativeThreadWindows>(*this, new_thread);
539  thread->GetRegisterContext().ClearAllHardwareWatchpoints();
540  for (const auto &pair : GetWatchpointMap()) {
541  const NativeWatchpoint &wp = pair.second;
542  thread->SetWatchpoint(wp.m_addr, wp.m_size, wp.m_watch_flags,
543  wp.m_hardware);
544  }
545 
546  m_threads.push_back(std::move(thread));
547 }
548 
550  uint32_t exit_code) {
551  llvm::sys::ScopedLock lock(m_mutex);
552  NativeThreadWindows *thread = GetThreadByID(thread_id);
553  if (!thread)
554  return;
555 
556  for (auto t = m_threads.begin(); t != m_threads.end();) {
557  if ((*t)->GetID() == thread_id) {
558  t = m_threads.erase(t);
559  } else {
560  ++t;
561  }
562  }
563 }
564 
566  lldb::addr_t module_addr) {
567  // Simply invalidate the cached loaded modules.
568  if (!m_loaded_modules.empty())
569  m_loaded_modules.clear();
570 }
571 
573  if (!m_loaded_modules.empty())
574  m_loaded_modules.clear();
575 }
576 
577 llvm::Expected<std::unique_ptr<NativeProcessProtocol>>
579  ProcessLaunchInfo &launch_info,
580  NativeProcessProtocol::NativeDelegate &native_delegate,
581  MainLoop &mainloop) const {
582  Error E = Error::success();
583  auto process_up = std::unique_ptr<NativeProcessWindows>(
584  new NativeProcessWindows(launch_info, native_delegate, E));
585  if (E)
586  return std::move(E);
587  return std::move(process_up);
588 }
589 
590 llvm::Expected<std::unique_ptr<NativeProcessProtocol>>
593  MainLoop &mainloop) const {
594  Error E = Error::success();
595  // Set pty master fd invalid since it is not available.
596  auto process_up = std::unique_ptr<NativeProcessWindows>(
597  new NativeProcessWindows(pid, -1, native_delegate, E));
598  if (E)
599  return std::move(E);
600  return std::move(process_up);
601 }
602 } // namespace lldb_private
void OnCreateThread(const HostThread &thread) override
llvm::Error ToError() const
Definition: Status.cpp:90
virtual lldb::addr_t GetWatchpointHitAddress(uint32_t wp_index)
Status GetLoadedModuleFileSpec(const char *module_path, FileSpec &file_spec) override
const char * StateAsCString(lldb::StateType state)
Converts a StateType to a C string.
Definition: State.cpp:14
A class that represents a running process on the host machine.
Definition: Debugger.h:49
HANDLE get() const
Definition: AutoHandle.h:28
virtual const NativeWatchpointList::WatchpointMap & GetWatchpointMap() const
std::unique_ptr< ProcessWindowsData > m_session_data
Status AllocateMemory(size_t size, uint32_t permissions, lldb::addr_t &addr)
lldb::addr_t GetExceptionAddress() const
#define LLDB_INVALID_PROCESS_ID
Definition: lldb-defines.h:92
void OnExitThread(lldb::tid_t thread_id, uint32_t exit_code) override
#define STATUS_WX86_BREAKPOINT
llvm::Error Error
bool IsValid() const
Definition: AutoHandle.h:26
static bool GetProcessInfo(lldb::pid_t pid, ProcessInstanceInfo &proc_info)
virtual Status GetWatchpointHitIndex(uint32_t &wp_index, lldb::addr_t trap_addr)
void SetProcessID(lldb::pid_t pid)
Definition: ProcessInfo.h:70
A file utility class.
Definition: FileSpec.h:56
Status DeallocateMemory(lldb::addr_t addr) override
#define WINDOWS_LOG_EXCEPTION
virtual Status SetHardwareBreakpoint(lldb::addr_t addr, size_t size)
virtual bool SetExitStatus(WaitStatus status, bool bNotifyStateChange)
llvm::Expected< std::unique_ptr< NativeProcessProtocol > > Attach(lldb::pid_t pid, NativeDelegate &native_delegate, MainLoop &mainloop) const override
Attach to an existing process.
const ResumeAction * GetActionForThread(lldb::tid_t tid, bool default_ok) const
Definition: Debug.h:76
Process or thread is stopped and can be examined.
Status HaltProcess(bool &caused_stop)
#define LLDB_LOG(log,...)
The LLDB_LOG* macros defined below are the way to emit log messages.
Definition: Log.h:242
static FileSystem & Instance()
llvm::ErrorOr< std::unique_ptr< llvm::MemoryBuffer > > GetAuxvData() const override
Status AllocateMemory(size_t size, uint32_t permissions, lldb::addr_t &addr) override
Process or thread has crashed and can be examined.
NativeThreadProtocol * GetThreadByID(lldb::tid_t tid)
void OnUnloadDll(lldb::addr_t module_addr) override
Status ReadMemory(lldb::addr_t addr, void *buf, size_t size, size_t &bytes_read)
Status RemoveSoftwareBreakpoint(lldb::addr_t addr)
Standard Win32 error codes.
llvm::Expected< std::unique_ptr< NativeProcessProtocol > > Launch(ProcessLaunchInfo &launch_info, NativeDelegate &native_delegate, MainLoop &mainloop) const override
Launch a process for debugging.
Process has exited and can&#39;t be examined.
StopReason
Thread stop reasons.
Status RemoveBreakpoint(lldb::addr_t addr, bool hardware=false) override
void OnDebuggerConnected(lldb::addr_t image_base) override
std::shared_ptr< IDebugDelegate > DebugDelegateSP
Definition: ForwardDecl.h:33
#define LLDB_INVALID_ADDRESS
Invalid value definitions.
Definition: lldb-defines.h:85
#define LLDB_INVALID_INDEX32
Definition: lldb-defines.h:86
Status DeallocateMemory(lldb::addr_t addr)
virtual Status RemoveHardwareBreakpoint(lldb::addr_t addr)
Status Resume(const ResumeActionList &resume_actions) override
static llvm::raw_ostream & error(Stream &strm)
lldb::StateType state
Definition: Debug.h:23
Process has been detached and can&#39;t be examined.
StateType
Process and Thread States.
uint64_t tid_t
Definition: lldb-types.h:86
ExceptionResult
Definition: ForwardDecl.h:16
void SetErrorString(llvm::StringRef err_str)
Set the current error string to err_str.
Definition: Status.cpp:242
bool FindSoftwareBreakpoint(lldb::addr_t addr)
lldb::addr_t GetSharedLibraryInfoAddress() override
#define WINDOWS_LOG_PROCESS
Status AttachProcess(lldb::pid_t pid, const ProcessAttachInfo &attach_info, DebugDelegateSP delegate)
void SetStopReason(ThreadStopInfo stop_info, std::string description)
ArchSpec & GetArchitecture()
Definition: ProcessInfo.h:62
Status DestroyProcess(lldb::StateType process_state)
bool Success() const
Test for success condition.
Definition: Status.cpp:288
Process or thread is in the process of stepping and can not be examined.
void OnLoadDll(const ModuleSpec &module_spec, lldb::addr_t module_addr) override
Status IgnoreSignals(llvm::ArrayRef< int > signals) override
Process is object is valid, but not currently loaded.
void Resolve(llvm::SmallVectorImpl< char > &path)
Resolve path to make it canonical.
Status WriteMemory(lldb::addr_t addr, const void *buf, size_t size, size_t &bytes_written) override
NativeThreadWindows * GetThreadByID(lldb::tid_t thread_id)
lldb::tid_t GetThreadID() const
const char * GetCString(bool denormalize=true) const
Definition: FileSpec.cpp:364
Process or thread is in a suspended state as far as the debugger is concerned while other processes o...
lldb::StopReason reason
Definition: Debug.h:134
Status SetSoftwareBreakpoint(lldb::addr_t addr, uint32_t size_hint)
const ArchSpec & GetArchitecture() const override
uint64_t addr_t
Definition: lldb-types.h:83
void SetState(lldb::StateType state, bool notify_delegates=true)
void SetArchitecture(const ArchSpec &arch_spec)
bool Fail() const
Test for error condition.
Definition: Status.cpp:182
void StopThread(lldb::tid_t thread_id, lldb::StopReason reason, std::string description="")
ExceptionResult OnDebugException(bool first_chance, const ExceptionRecord &record) override
Status Signal(int signo) override
Sends a process a UNIX signal signal.
Status ReadMemory(lldb::addr_t addr, void *buf, size_t size, size_t &bytes_read) override
int void SetError(ValueType err, lldb::ErrorType type)
Set accessor with an error value and type.
Definition: Status.cpp:217
Status SetBreakpoint(lldb::addr_t addr, uint32_t size, bool hardware) override
Definition: SBAddress.h:15
virtual lldb::addr_t GetWatchpointAddress(uint32_t wp_index)
uint64_t pid_t
Definition: lldb-types.h:85
std::shared_ptr< ExceptionRecord > ExceptionRecordSP
Definition: ForwardDecl.h:37
Status GetMemoryRegionInfo(lldb::addr_t load_addr, MemoryRegionInfo &range_info)
Status GetMemoryRegionInfo(lldb::addr_t load_addr, MemoryRegionInfo &range_info) override
Status WriteMemory(lldb::addr_t addr, const void *buf, size_t size, size_t &bytes_written)
lldb::pid_t GetDebuggedProcessId() const
Status Interrupt() override
Tells a process to interrupt all operations as if by a Ctrl-C.
void SetErrorStringWithFormatv(const char *format, Args &&... args)
Definition: Status.h:173
Status GetFileLoadAddress(const llvm::StringRef &file_name, lldb::addr_t &load_addr) override
void SetStopReasonForThread(NativeThreadWindows &thread, lldb::StopReason reason, std::string description="")
std::unordered_map< lldb::addr_t, SoftwareBreakpoint > m_software_breakpoints
std::vector< std::unique_ptr< NativeThreadProtocol > > m_threads
#define SIGTRAP
NativeProcessWindows(ProcessLaunchInfo &launch_info, NativeDelegate &delegate, llvm::Error &E)
virtual ExceptionResult OnDebugException(bool first_chance, const ExceptionRecord &record)
static Log * GetLogIfAny(uint32_t mask)
Status LaunchProcess(ProcessLaunchInfo &launch_info, DebugDelegateSP delegate)
virtual void OnExitProcess(uint32_t exit_code)
void OnExitProcess(uint32_t exit_code) override
std::map< lldb_private::FileSpec, lldb::addr_t > m_loaded_modules
An error handling class.
Definition: Status.h:44
Process or thread is running and can&#39;t be examined.