LLDB  mainline
LocalDebugDelegate.cpp
Go to the documentation of this file.
1 //===-- LocalDebugDelegate.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 
9 #include "LocalDebugDelegate.h"
10 #include "ProcessWindows.h"
11 
12 using namespace lldb;
13 using namespace lldb_private;
14 
15 LocalDebugDelegate::LocalDebugDelegate(ProcessWP process)
16  : m_process(process) {}
17 
19  if (ProcessWindowsSP process = GetProcessPointer())
20  process->OnExitProcess(exit_code);
21 }
22 
24  if (ProcessWindowsSP process = GetProcessPointer())
25  process->OnDebuggerConnected(image_base);
26 }
27 
30  const ExceptionRecord &record) {
31  if (ProcessWindowsSP process = GetProcessPointer())
32  return process->OnDebugException(first_chance, record);
33  else
35 }
36 
38  if (ProcessWindowsSP process = GetProcessPointer())
39  process->OnCreateThread(thread);
40 }
41 
43  uint32_t exit_code) {
44  if (ProcessWindowsSP process = GetProcessPointer())
45  process->OnExitThread(thread_id, exit_code);
46 }
47 
49  lldb::addr_t module_addr) {
50  if (ProcessWindowsSP process = GetProcessPointer())
51  process->OnLoadDll(module_spec, module_addr);
52 }
53 
55  if (ProcessWindowsSP process = GetProcessPointer())
56  process->OnUnloadDll(module_addr);
57 }
58 
60  if (ProcessWindowsSP process = GetProcessPointer())
61  process->OnDebugString(string);
62 }
63 
65  if (ProcessWindowsSP process = GetProcessPointer())
66  process->OnDebuggerError(error, type);
67 }
68 
70  ProcessSP process = m_process.lock();
71  return std::static_pointer_cast<ProcessWindows>(process);
72 }
ProcessWindows.h
lldb_private::LocalDebugDelegate::OnDebuggerConnected
void OnDebuggerConnected(lldb::addr_t image_base) override
Definition: LocalDebugDelegate.cpp:23
lldb_private::LocalDebugDelegate::OnUnloadDll
void OnUnloadDll(lldb::addr_t module_addr) override
Definition: LocalDebugDelegate.cpp:54
lldb_private::HostThread
Definition: HostThread.h:29
ExceptionResult::MaskException
@ MaskException
lldb_private::LocalDebugDelegate::GetProcessPointer
ProcessWindowsSP GetProcessPointer()
Definition: LocalDebugDelegate.cpp:69
lldb_private::LocalDebugDelegate::OnDebugString
void OnDebugString(const std::string &message) override
Definition: LocalDebugDelegate.cpp:59
lldb::addr_t
uint64_t addr_t
Definition: lldb-types.h:83
lldb_private::LocalDebugDelegate::OnLoadDll
void OnLoadDll(const lldb_private::ModuleSpec &module_spec, lldb::addr_t module_addr) override
Definition: LocalDebugDelegate.cpp:48
lldb_private::LocalDebugDelegate::OnDebuggerError
void OnDebuggerError(const Status &error, uint32_t type) override
Definition: LocalDebugDelegate.cpp:64
error
static llvm::raw_ostream & error(Stream &strm)
Definition: CommandReturnObject.cpp:17
lldb_private::LocalDebugDelegate::OnDebugException
ExceptionResult OnDebugException(bool first_chance, const ExceptionRecord &record) override
Definition: LocalDebugDelegate.cpp:29
ExceptionResult
ExceptionResult
Definition: ForwardDecl.h:16
string
string(SUBSTRING ${p} 10 -1 pStripped) if($
Definition: Plugins/CMakeLists.txt:40
lldb_private::LocalDebugDelegate::OnCreateThread
void OnCreateThread(const HostThread &thread) override
Definition: LocalDebugDelegate.cpp:37
lldb_private::ModuleSpec
Definition: ModuleSpec.h:26
lldb_private::Status
Definition: Status.h:44
uint32_t
lldb_private::ProcessWindowsSP
std::shared_ptr< ProcessWindows > ProcessWindowsSP
Definition: LocalDebugDelegate.h:20
lldb_private::LocalDebugDelegate::m_process
lldb::ProcessWP m_process
Definition: LocalDebugDelegate.h:60
lldb_private::LocalDebugDelegate::OnExitThread
void OnExitThread(lldb::tid_t thread_id, uint32_t exit_code) override
Definition: LocalDebugDelegate.cpp:42
lldb_private::LocalDebugDelegate::OnExitProcess
void OnExitProcess(uint32_t exit_code) override
Definition: LocalDebugDelegate.cpp:18
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
LocalDebugDelegate.h
lldb
Definition: SBAddress.h:15
lldb_private::ExceptionRecord
Definition: ExceptionRecord.h:25
lldb::tid_t
uint64_t tid_t
Definition: lldb-types.h:86