#include "JITLoaderGDB.h"
#include "Plugins/ObjectFile/Mach-O/ObjectFileMachO.h"
#include "lldb/Breakpoint/Breakpoint.h"
#include "lldb/Core/Module.h"
#include "lldb/Core/ModuleSpec.h"
#include "lldb/Core/PluginManager.h"
#include "lldb/Core/Section.h"
#include "lldb/Interpreter/OptionValueProperties.h"
#include "lldb/Symbol/ObjectFile.h"
#include "lldb/Symbol/Symbol.h"
#include "lldb/Symbol/SymbolContext.h"
#include "lldb/Symbol/SymbolVendor.h"
#include "lldb/Target/Process.h"
#include "lldb/Target/SectionLoadList.h"
#include "lldb/Target/Target.h"
#include "lldb/Utility/DataBufferHeap.h"
#include "lldb/Utility/LLDBAssert.h"
#include "lldb/Utility/LLDBLog.h"
#include "lldb/Utility/Log.h"
#include "lldb/Utility/StreamString.h"
#include "llvm/Support/MathExtras.h"
#include <memory>
usingnamespacelldb;
usingnamespacelldb_private;
LLDB_PLUGIN_DEFINE(…)
namespace {
enum jit_actions_t { … };
template <typename ptr_t> struct jit_code_entry { … };
template <typename ptr_t> struct jit_descriptor { … };
enum EnableJITLoaderGDB { … };
static constexpr OptionEnumValueElement g_enable_jit_loader_gdb_enumerators[] = …;
#define LLDB_PROPERTIES_jitloadergdb
#include "JITLoaderGDBProperties.inc"
enum { … };
class PluginProperties : public Properties { … };
}
static PluginProperties &GetGlobalPluginProperties() { … }
template <typename ptr_t>
static bool ReadJITEntry(const addr_t from_addr, Process *process,
jit_code_entry<ptr_t> *entry) { … }
JITLoaderGDB::JITLoaderGDB(lldb_private::Process *process)
: … { … }
JITLoaderGDB::~JITLoaderGDB() { … }
void JITLoaderGDB::DebuggerInitialize(Debugger &debugger) { … }
void JITLoaderGDB::DidAttach() { … }
void JITLoaderGDB::DidLaunch() { … }
void JITLoaderGDB::ModulesDidLoad(ModuleList &module_list) { … }
void JITLoaderGDB::SetJITBreakpoint(lldb_private::ModuleList &module_list) { … }
bool JITLoaderGDB::JITDebugBreakpointHit(void *baton,
StoppointCallbackContext *context,
user_id_t break_id,
user_id_t break_loc_id) { … }
static void updateSectionLoadAddress(const SectionList §ion_list,
Target &target, uint64_t symbolfile_addr,
uint64_t symbolfile_size,
uint64_t &vmaddrheuristic,
uint64_t &min_addr, uint64_t &max_addr) { … }
bool JITLoaderGDB::ReadJITDescriptor(bool all_entries) { … }
template <typename ptr_t>
bool JITLoaderGDB::ReadJITDescriptorImpl(bool all_entries) { … }
JITLoaderSP JITLoaderGDB::CreateInstance(Process *process, bool force) { … }
llvm::StringRef JITLoaderGDB::GetPluginDescriptionStatic() { … }
void JITLoaderGDB::Initialize() { … }
void JITLoaderGDB::Terminate() { … }
bool JITLoaderGDB::DidSetJITBreakpoint() const { … }
addr_t JITLoaderGDB::GetSymbolAddress(ModuleList &module_list,
ConstString name,
SymbolType symbol_type) const { … }