LLDB mainline
DynamicLoaderHexagonDYLD.cpp
Go to the documentation of this file.
1//===-- DynamicLoaderHexagonDYLD.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 "lldb/Core/Module.h"
13#include "lldb/Core/Section.h"
15#include "lldb/Target/Process.h"
16#include "lldb/Target/Target.h"
17#include "lldb/Target/Thread.h"
20#include "lldb/Utility/Log.h"
21
23
24#include <memory>
25
26using namespace lldb;
27using namespace lldb_private;
28
30
31// Aidan 21/05/2014
32//
33// Notes about hexagon dynamic loading:
34//
35// When we connect to a target we find the dyld breakpoint address. We put
36// a
37// breakpoint there with a callback 'RendezvousBreakpointHit()'.
38//
39// It is possible to find the dyld structure address from the ELF symbol
40// table,
41// but in the case of the simulator it has not been initialized before the
42// target calls dlinit().
43//
44// We can only safely parse the dyld structure after we hit the dyld
45// breakpoint
46// since at that time we know dlinit() must have been called.
47//
48
49// Find the load address of a symbol
51 assert(proc != nullptr);
52
53 ModuleSP module = proc->GetTarget().GetExecutableModule();
54 assert(module.get() != nullptr);
55
56 ObjectFile *exe = module->GetObjectFile();
57 assert(exe != nullptr);
58
59 lldb_private::Symtab *symtab = exe->GetSymtab();
60 assert(symtab != nullptr);
61
62 for (size_t i = 0; i < symtab->GetNumSymbols(); i++) {
63 const Symbol *sym = symtab->SymbolAtIndex(i);
64 assert(sym != nullptr);
65 ConstString symName = sym->GetName();
66
67 if (ConstString::Compare(findName, symName) == 0) {
68 Address addr = sym->GetAddress();
69 return addr.GetLoadAddress(&proc->GetTarget());
70 }
71 }
73}
74
79
83
85 return "Dynamic loader plug-in that watches for shared library "
86 "loads/unloads in Hexagon processes.";
87}
88
90 bool force) {
91 bool create = force;
92 if (!create) {
93 const llvm::Triple &triple_ref =
94 process->GetTarget().GetArchitecture().GetTriple();
95 if (triple_ref.getArch() == llvm::Triple::hexagon)
96 create = true;
97 }
98
99 if (create)
100 return new DynamicLoaderHexagonDYLD(process);
101 return nullptr;
102}
103
108
115
117 ModuleSP executable;
118 addr_t load_offset;
119
120 executable = GetTargetExecutable();
121
122 // Find the difference between the desired load address in the elf file and
123 // the real load address in memory
124 load_offset = ComputeLoadOffset();
125
126 // Check that there is a valid executable
127 if (executable.get() == nullptr)
128 return;
129
130 // Disable JIT for hexagon targets because its not supported
131 m_process->SetCanJIT(false);
132
133 // Enable Interpreting of function call expressions
134 m_process->SetCanInterpretFunctionCalls(true);
135
136 // Add the current executable to the module list
137 ModuleList module_list;
138 module_list.Append(executable);
139
140 // Map the loaded sections of this executable
141 if (load_offset != LLDB_INVALID_ADDRESS)
142 UpdateLoadedSections(executable, LLDB_INVALID_ADDRESS, load_offset, true);
143
144 // AD: confirm this?
145 // Load into LLDB all of the currently loaded executables in the stub
147
148 // AD: confirm this?
149 // Callback for the target to give it the loaded module list
150 m_process->GetTarget().ModulesDidLoad(module_list);
151
152 // Try to set a breakpoint at the rendezvous breakpoint. DidLaunch uses
153 // ProbeEntry() instead. That sets a breakpoint, at the dyld breakpoint
154 // address, with a callback so that when hit, the dyld structure can be
155 // parsed.
157 // fail
158 }
159}
160
162
163/// Checks to see if the target module has changed, updates the target
164/// accordingly and returns the target executable module.
166 Target &target = m_process->GetTarget();
167 ModuleSP executable = target.GetExecutableModule();
168
169 // There is no executable
170 if (!executable.get())
171 return executable;
172
173 // The target executable file does not exits
174 if (!FileSystem::Instance().Exists(executable->GetFileSpec()))
175 return executable;
176
177 // Prep module for loading
178 ModuleSpec module_spec(executable->GetFileSpec(),
179 executable->GetArchitecture());
180 ModuleSP module_sp(new Module(module_spec));
181
182 // Check if the executable has changed and set it to the target executable if
183 // they differ.
184 if (module_sp.get() && module_sp->GetUUID().IsValid() &&
185 executable->GetUUID().IsValid()) {
186 // if the executable has changed ??
187 if (module_sp->GetUUID() != executable->GetUUID())
188 executable.reset();
189 } else if (executable->FileHasChanged())
190 executable.reset();
191
192 if (executable.get())
193 return executable;
194
195 // TODO: What case is this code used?
196 executable = target.GetOrCreateModule(module_spec, true /* notify */);
197 if (executable.get() != target.GetExecutableModulePointer()) {
198 // Don't load dependent images since we are in dyld where we will know and
199 // find out about all images that are loaded
200 target.SetExecutableModule(executable, eLoadDependentsNo);
201 }
202
203 return executable;
204}
205
206// AD: Needs to be updated?
208
210 addr_t link_map_addr,
211 addr_t base_addr,
212 bool base_addr_is_offset) {
213 Target &target = m_process->GetTarget();
214 const SectionList *sections = GetSectionListFromModule(module);
215
216 assert(sections && "SectionList missing from loaded module.");
217
218 m_loaded_modules[module] = link_map_addr;
219
220 const size_t num_sections = sections->GetSize();
221
222 for (unsigned i = 0; i < num_sections; ++i) {
223 SectionSP section_sp(sections->GetSectionAtIndex(i));
224 lldb::addr_t new_load_addr = section_sp->GetFileAddress() + base_addr;
225
226 // AD: 02/05/14
227 // since our memory map starts from address 0, we must not ignore
228 // sections that load to address 0. This violates the reference
229 // ELF spec, however is used for Hexagon.
230
231 // If the file address of the section is zero then this is not an
232 // allocatable/loadable section (property of ELF sh_addr). Skip it.
233 // if (new_load_addr == base_addr)
234 // continue;
235
236 target.SetSectionLoadAddress(section_sp, new_load_addr);
237 }
238}
239
240/// Removes the loaded sections from the target in \p module.
241///
242/// \param module The module to traverse.
244 Target &target = m_process->GetTarget();
245 const SectionList *sections = GetSectionListFromModule(module);
246
247 assert(sections && "SectionList missing from unloaded module.");
248
249 m_loaded_modules.erase(module);
250
251 const size_t num_sections = sections->GetSize();
252 for (size_t i = 0; i < num_sections; ++i) {
253 SectionSP section_sp(sections->GetSectionAtIndex(i));
254 target.SetSectionUnloaded(section_sp);
255 }
256}
257
258// Place a breakpoint on <_rtld_debug_state>
261
262 // This is the original code, which want to look in the rendezvous structure
263 // to find the breakpoint address. Its backwards for us, since we can easily
264 // find the breakpoint address, since it is exported in our executable. We
265 // however know that we cant read the Rendezvous structure until we have hit
266 // the breakpoint once.
267 const ConstString dyldBpName("_rtld_debug_state");
268 addr_t break_addr = findSymbolAddress(m_process, dyldBpName);
269
270 Target &target = m_process->GetTarget();
271
272 // Do not try to set the breakpoint if we don't know where to put it
273 if (break_addr == LLDB_INVALID_ADDRESS) {
274 LLDB_LOGF(log, "Unable to locate _rtld_debug_state breakpoint address");
275
276 return false;
277 }
278
279 // Save the address of the rendezvous structure
280 m_rendezvous.SetBreakAddress(break_addr);
281
282 // If we haven't set the breakpoint before then set it
284 Breakpoint *dyld_break =
285 target.CreateBreakpoint(break_addr, true, false).get();
286 dyld_break->SetCallback(RendezvousBreakpointHit, this, true);
287 dyld_break->SetBreakpointKind("shared-library-event");
288 m_dyld_bid = dyld_break->GetID();
289
290 // Make sure our breakpoint is at the right address.
291 assert(target.GetBreakpointByID(m_dyld_bid)
292 ->FindLocationByAddress(break_addr)
293 ->GetBreakpoint()
294 .GetID() == m_dyld_bid);
295
296 if (log && dyld_break == nullptr)
297 LLDB_LOGF(log, "Failed to create _rtld_debug_state breakpoint");
298
299 // check we have successfully set bp
300 return (dyld_break != nullptr);
301 } else
302 // rendezvous already set
303 return true;
304}
305
306// We have just hit our breakpoint at <_rtld_debug_state>
308 void *baton, StoppointCallbackContext *context, user_id_t break_id,
309 user_id_t break_loc_id) {
311
312 LLDB_LOGF(log, "Rendezvous breakpoint hit!");
313
314 DynamicLoaderHexagonDYLD *dyld_instance = nullptr;
315 dyld_instance = static_cast<DynamicLoaderHexagonDYLD *>(baton);
316
317 // if the dyld_instance is still not valid then try to locate it on the
318 // symbol table
319 if (!dyld_instance->m_rendezvous.IsValid()) {
320 Process *proc = dyld_instance->m_process;
321
322 const ConstString dyldStructName("_rtld_debug");
323 addr_t structAddr = findSymbolAddress(proc, dyldStructName);
324
325 if (structAddr != LLDB_INVALID_ADDRESS) {
326 dyld_instance->m_rendezvous.SetRendezvousAddress(structAddr);
327
328 LLDB_LOGF(log, "Found _rtld_debug structure @ 0x%08" PRIx64, structAddr);
329 } else {
330 LLDB_LOGF(log, "Unable to resolve the _rtld_debug structure");
331 }
332 }
333
334 dyld_instance->RefreshModules();
335
336 // Return true to stop the target, false to just let the target run.
337 return dyld_instance->GetStopWhenImagesChange();
338}
339
340/// Helper method for RendezvousBreakpointHit. Updates LLDB's current set
341/// of loaded modules.
344
345 if (!m_rendezvous.Resolve())
346 return;
347
350
351 ModuleList &loaded_modules = m_process->GetTarget().GetImages();
352
353 if (m_rendezvous.ModulesDidLoad()) {
354 ModuleList new_modules;
355
356 E = m_rendezvous.loaded_end();
357 for (I = m_rendezvous.loaded_begin(); I != E; ++I) {
358 FileSpec file(I->path);
360 ModuleSP module_sp =
361 LoadModuleAtAddress(file, I->link_addr, I->base_addr, true);
362 if (module_sp.get()) {
363 loaded_modules.AppendIfNeeded(module_sp);
364 new_modules.Append(module_sp);
365 }
366
367 if (log) {
368 LLDB_LOGF(log, "Target is loading '%s'", I->path.c_str());
369 if (!module_sp.get())
370 LLDB_LOGF(log, "LLDB failed to load '%s'", I->path.c_str());
371 else
372 LLDB_LOGF(log, "LLDB successfully loaded '%s'", I->path.c_str());
373 }
374 }
375 m_process->GetTarget().ModulesDidLoad(new_modules);
376 }
377
378 if (m_rendezvous.ModulesDidUnload()) {
379 ModuleList old_modules;
380
381 E = m_rendezvous.unloaded_end();
382 for (I = m_rendezvous.unloaded_begin(); I != E; ++I) {
383 FileSpec file(I->path);
385 ModuleSpec module_spec(file);
386 ModuleSP module_sp = loaded_modules.FindFirstModule(module_spec);
387
388 if (module_sp.get()) {
389 old_modules.Append(module_sp);
390 UnloadSections(module_sp);
391 }
392
393 LLDB_LOGF(log, "Target is unloading '%s'", I->path.c_str());
394 }
395 loaded_modules.Remove(old_modules);
396 m_process->GetTarget().ModulesDidUnload(old_modules, false);
397 }
398}
399
400// AD: This is very different to the Static Loader code.
401// It may be wise to look over this and its relation to stack
402// unwinding.
405 bool stop) {
406 ThreadPlanSP thread_plan_sp;
407
408 StackFrame *frame = thread.GetStackFrameAtIndex(0).get();
409 const SymbolContext &context = frame->GetSymbolContext(eSymbolContextSymbol);
410 const Symbol *sym = context.symbol;
411
412 if (sym == nullptr || !sym->IsTrampoline())
413 return thread_plan_sp;
414
415 const ConstString sym_name =
417 if (!sym_name)
418 return thread_plan_sp;
419
420 SymbolContextList target_symbols;
421 Target &target = thread.GetProcess()->GetTarget();
422 const ModuleList &images = target.GetImages();
423
424 images.FindSymbolsWithNameAndType(sym_name, eSymbolTypeCode, target_symbols);
425 if (target_symbols.GetSize() == 0)
426 return thread_plan_sp;
427
428 typedef std::vector<lldb::addr_t> AddressVector;
429 AddressVector addrs;
430 for (const SymbolContext &context : target_symbols) {
431 addr_t addr = context.GetFunctionOrSymbolAddress().GetLoadAddress(&target);
432 if (addr != LLDB_INVALID_ADDRESS)
433 addrs.push_back(addr);
434 }
435
436 if (addrs.size() > 0) {
437 AddressVector::iterator start = addrs.begin();
438 AddressVector::iterator end = addrs.end();
439
440 llvm::sort(start, end);
441 addrs.erase(std::unique(start, end), end);
442 thread_plan_sp =
443 std::make_shared<ThreadPlanRunToAddress>(thread, addrs, stop);
444 }
445
446 return thread_plan_sp;
447}
448
449/// Helper for the entry breakpoint callback. Resolves the load addresses
450/// of all dependent modules.
454 ModuleList module_list;
455
456 if (!m_rendezvous.Resolve()) {
458 LLDB_LOGF(
459 log,
460 "DynamicLoaderHexagonDYLD::%s unable to resolve rendezvous address",
461 __FUNCTION__);
462 return;
463 }
464
465 // The rendezvous class doesn't enumerate the main module, so track that
466 // ourselves here.
467 ModuleSP executable = GetTargetExecutable();
468 m_loaded_modules[executable] = m_rendezvous.GetLinkMapAddress();
469
470 for (I = m_rendezvous.begin(), E = m_rendezvous.end(); I != E; ++I) {
471 const char *module_path = I->path.c_str();
472 FileSpec file(module_path);
473 ModuleSP module_sp =
474 LoadModuleAtAddress(file, I->link_addr, I->base_addr, true);
475 if (module_sp.get()) {
476 module_list.Append(module_sp);
477 } else {
479 LLDB_LOGF(log,
480 "DynamicLoaderHexagonDYLD::%s failed loading module %s at "
481 "0x%" PRIx64,
482 __FUNCTION__, module_path, I->base_addr);
483 }
484 }
485
486 m_process->GetTarget().ModulesDidLoad(module_list);
487}
488
489/// Computes a value for m_load_offset returning the computed address on
490/// success and LLDB_INVALID_ADDRESS on failure.
492 // Here we could send a GDB packet to know the load offset
493 //
494 // send: $qOffsets#4b
495 // get: Text=0;Data=0;Bss=0
496 //
497 // Currently qOffsets is not supported by pluginProcessGDBRemote
498 //
499 return 0;
500}
501
502// Here we must try to read the entry point directly from the elf header. This
503// is possible if the process is not relocatable or dynamically linked.
504//
505// an alternative is to look at the PC if we can be sure that we have connected
506// when the process is at the entry point.
507// I dont think that is reliable for us.
510 return m_entry_point;
511 // check we have a valid process
512 if (m_process == nullptr)
514 // Get the current executable module
515 Module &module = *(m_process->GetTarget().GetExecutableModule().get());
516 // Get the object file (elf file) for this module
517 lldb_private::ObjectFile &object = *(module.GetObjectFile());
518 // Check if the file is executable (ie, not shared object or relocatable)
519 if (object.IsExecutable()) {
520 // Get the entry point address for this object
521 lldb_private::Address entry = object.GetEntryPointAddress();
522 // Return the entry point address
523 return entry.GetFileAddress();
524 }
525 // No idea so back out
527}
528
530 const ModuleSP module) const {
531 SectionList *sections = nullptr;
532 if (module.get()) {
533 ObjectFile *obj_file = module->GetObjectFile();
534 if (obj_file) {
535 sections = obj_file->GetSectionList();
536 }
537 }
538 return sections;
539}
540
541static int ReadInt(Process *process, addr_t addr) {
543 int value = (int)process->ReadUnsignedIntegerFromMemory(
544 addr, sizeof(uint32_t), 0, error);
545 if (error.Fail())
546 return -1;
547 else
548 return value;
549}
550
553 const lldb::ThreadSP thread,
554 lldb::addr_t tls_file_addr) {
555 auto it = m_loaded_modules.find(module);
556 if (it == m_loaded_modules.end())
558
559 addr_t link_map = it->second;
560 if (link_map == LLDB_INVALID_ADDRESS)
562
563 const HexagonDYLDRendezvous::ThreadInfo &metadata =
564 m_rendezvous.GetThreadInfo();
565 if (!metadata.valid)
567
568 // Get the thread pointer.
569 addr_t tp = thread->GetThreadPointer();
570 if (tp == LLDB_INVALID_ADDRESS)
572
573 // Find the module's modid.
574 int modid = ReadInt(m_process, link_map + metadata.modid_offset);
575 if (modid == -1)
577
578 // Lookup the DTV structure for this thread.
579 addr_t dtv_ptr = tp + metadata.dtv_offset;
580 addr_t dtv = ReadPointer(dtv_ptr);
581 if (dtv == LLDB_INVALID_ADDRESS)
583
584 // Find the TLS block for this module.
585 addr_t dtv_slot = dtv + metadata.dtv_slot_size * modid;
586 addr_t tls_block = ReadPointer(dtv_slot + metadata.tls_offset);
587
588 Module *mod = module.get();
590 LLDB_LOGF(log,
591 "DynamicLoaderHexagonDYLD::Performed TLS lookup: "
592 "module=%s, link_map=0x%" PRIx64 ", tp=0x%" PRIx64
593 ", modid=%i, tls_block=0x%" PRIx64,
594 mod->GetObjectName().AsCString(""), link_map, tp, modid, tls_block);
595
596 if (tls_block == LLDB_INVALID_ADDRESS)
598 else
599 return tls_block + tls_file_addr;
600}
static llvm::raw_ostream & error(Stream &strm)
static lldb::addr_t findSymbolAddress(Process *proc, ConstString findName)
static int ReadInt(Process *process, addr_t addr)
#define LLDB_LOGF(log,...)
Definition Log.h:376
#define LLDB_PLUGIN_DEFINE(PluginName)
lldb::ModuleSP GetTargetExecutable()
Checks to see if the target module has changed, updates the target accordingly and returns the target...
static llvm::StringRef GetPluginDescriptionStatic()
void LoadAllCurrentModules()
Helper for the entry breakpoint callback.
std::map< lldb::ModuleWP, lldb::addr_t, std::owner_less< lldb::ModuleWP > > m_loaded_modules
Loaded module list. (link map for each module)
lldb_private::Status CanLoadImage() override
Ask if it is ok to try and load or unload an shared library (image).
lldb::break_id_t m_dyld_bid
Rendezvous breakpoint.
lldb::addr_t m_entry_point
Virtual entry address of the inferior process.
bool SetRendezvousBreakpoint()
Enables a breakpoint on a function called by the runtime linker each time a module is loaded or unloa...
lldb::addr_t GetThreadLocalData(const lldb::ModuleSP module, const lldb::ThreadSP thread, lldb::addr_t tls_file_addr) override
Retrieves the per-module TLS block for a given thread.
DynamicLoaderHexagonDYLD(lldb_private::Process *process)
static lldb_private::DynamicLoader * CreateInstance(lldb_private::Process *process, bool force)
void RefreshModules()
Helper method for RendezvousBreakpointHit.
HexagonDYLDRendezvous m_rendezvous
Runtime linker rendezvous structure.
static bool RendezvousBreakpointHit(void *baton, lldb_private::StoppointCallbackContext *context, lldb::user_id_t break_id, lldb::user_id_t break_loc_id)
Callback routine which updates the current list of loaded modules based on the information supplied b...
lldb::addr_t ComputeLoadOffset()
Computes a value for m_load_offset returning the computed address on success and LLDB_INVALID_ADDRESS...
const lldb_private::SectionList * GetSectionListFromModule(const lldb::ModuleSP module) const
void DidLaunch() override
Called after launching a process.
void UnloadSections(const lldb::ModuleSP module) override
Removes the loaded sections from the target in module.
void UpdateLoadedSections(lldb::ModuleSP module, lldb::addr_t link_map_addr, lldb::addr_t base_addr, bool base_addr_is_offset) override
Updates the load address of every allocatable section in module.
static llvm::StringRef GetPluginNameStatic()
lldb::ThreadPlanSP GetStepThroughTrampolinePlan(lldb_private::Thread &thread, bool stop_others) override
Provides a plan to step through the dynamic loader trampoline for the current state of thread.
void DidAttach() override
Called after attaching a process.
lldb::addr_t GetEntryPoint()
Computes a value for m_entry_point returning the computed address on success and LLDB_INVALID_ADDRESS...
lldb::addr_t m_load_offset
Virtual load address of the inferior process.
SOEntryList::const_iterator iterator
void SetRendezvousAddress(lldb::addr_t)
Provide the dyld structure address.
A section + offset based address class.
Definition Address.h:62
lldb::addr_t GetLoadAddress(Target *target) const
Get the load address.
Definition Address.cpp:301
lldb::addr_t GetFileAddress() const
Get the file address.
Definition Address.cpp:281
llvm::Triple & GetTriple()
Architecture triple accessor.
Definition ArchSpec.h:457
General Outline: A breakpoint has four main parts, a filter, a resolver, the list of breakpoint locat...
Definition Breakpoint.h:81
void SetBreakpointKind(const char *kind)
Set the "kind" description for a breakpoint.
Definition Breakpoint.h:482
void SetCallback(BreakpointHitCallback callback, void *baton, bool is_synchronous=false)
Set the callback action invoked when the breakpoint is hit.
A uniqued constant string class.
Definition ConstString.h:40
static int Compare(ConstString lhs, ConstString rhs, const bool case_sensitive=true)
Compare two string objects.
const char * AsCString(const char *value_if_empty=nullptr) const
Get the string value as a C string.
lldb::addr_t ReadPointer(lldb::addr_t addr)
Process * m_process
The process that this dynamic loader plug-in is tracking.
bool GetStopWhenImagesChange() const
Get whether the process should stop when images change.
virtual lldb::ModuleSP LoadModuleAtAddress(const lldb_private::FileSpec &file, lldb::addr_t link_map_addr, lldb::addr_t base_addr, bool base_addr_is_offset)
Locates or creates a module given by file and updates/loads the resulting module at the virtual base ...
DynamicLoader(Process *process)
Construct with a process.
A file utility class.
Definition FileSpec.h:57
static FileSystem & Instance()
void Resolve(llvm::SmallVectorImpl< char > &path, bool force_make_absolute=false)
Resolve path to make it canonical.
ConstString GetName(NamePreference preference=ePreferDemangled) const
Best name get accessor.
Definition Mangled.cpp:369
A collection class for Module objects.
Definition ModuleList.h:125
lldb::ModuleSP FindFirstModule(const ModuleSpec &module_spec) const
Finds the first module whose file specification matches module_spec.
bool AppendIfNeeded(const lldb::ModuleSP &new_module, bool notify=true)
Append a module to the module list, if it is not already there.
void FindSymbolsWithNameAndType(ConstString name, lldb::SymbolType symbol_type, SymbolContextList &sc_list) const
bool Remove(const lldb::ModuleSP &module_sp, bool notify=true)
Remove a module from the module list.
void Append(const lldb::ModuleSP &module_sp, bool notify=true)
Append a module to the module list.
A class that describes an executable image and its associated object and symbol files.
Definition Module.h:90
ConstString GetObjectName() const
Definition Module.cpp:1186
A plug-in interface definition class for object file parsers.
Definition ObjectFile.h:46
Symtab * GetSymtab(bool can_create=true)
Gets the symbol table for the currently selected architecture (and object for archives).
virtual SectionList * GetSectionList(bool update_module_section_list=true)
Gets the section list for the currently selected architecture (and object for archives).
static bool RegisterPlugin(llvm::StringRef name, llvm::StringRef description, ABICreateInstance create_callback)
static bool UnregisterPlugin(ABICreateInstance create_callback)
A plug-in interface definition class for debugging a process.
Definition Process.h:354
uint64_t ReadUnsignedIntegerFromMemory(lldb::addr_t load_addr, size_t byte_size, uint64_t fail_value, Status &error)
Reads an unsigned integer of the specified byte size from process memory.
Definition Process.cpp:2312
Target & GetTarget()
Get the target object pointer for this module.
Definition Process.h:1250
size_t GetSize() const
Definition Section.h:77
lldb::SectionSP GetSectionAtIndex(size_t idx) const
Definition Section.cpp:553
This base class provides an interface to stack frames.
Definition StackFrame.h:44
virtual const SymbolContext & GetSymbolContext(lldb::SymbolContextItem resolve_scope)
Provide a SymbolContext for this StackFrame's current pc value.
An error handling class.
Definition Status.h:118
General Outline: When we hit a breakpoint we need to package up whatever information is needed to eva...
lldb::break_id_t GetID() const
Definition Stoppoint.cpp:22
Defines a list of symbol context objects.
uint32_t GetSize() const
Get accessor for a symbol context list size.
Defines a symbol context baton that can be handed other debug core functions.
Symbol * symbol
The Symbol for a given query.
Address GetFunctionOrSymbolAddress() const
Get the address of the function or symbol represented by this symbol context.
Mangled & GetMangled()
Definition Symbol.h:147
bool IsTrampoline() const
Definition Symbol.cpp:221
ConstString GetName() const
Definition Symbol.cpp:511
Address GetAddress() const
Definition Symbol.h:89
Symbol * SymbolAtIndex(size_t idx)
Definition Symtab.cpp:228
size_t GetNumSymbols() const
Definition Symtab.cpp:77
Module * GetExecutableModulePointer()
Definition Target.cpp:1541
lldb::BreakpointSP GetBreakpointByID(lldb::break_id_t break_id)
Definition Target.cpp:422
bool SetSectionUnloaded(const lldb::SectionSP &section_sp)
Definition Target.cpp:3382
lldb::ModuleSP GetOrCreateModule(const ModuleSpec &module_spec, bool notify, Status *error_ptr=nullptr)
Find a binary on the system and return its Module, or return an existing Module that is already in th...
Definition Target.cpp:2352
lldb::ModuleSP GetExecutableModule()
Gets the module for the main executable.
Definition Target.cpp:1525
lldb::BreakpointSP CreateBreakpoint(const FileSpecList *containingModules, const FileSpec &file, uint32_t line_no, uint32_t column, lldb::addr_t offset, LazyBool check_inlines, LazyBool skip_prologue, bool internal, bool request_hardware, LazyBool move_to_nearest_code)
Definition Target.cpp:489
const ModuleList & GetImages() const
Get accessor for the images for this process.
Definition Target.h:1141
const ArchSpec & GetArchitecture() const
Definition Target.h:1183
void SetExecutableModule(lldb::ModuleSP &module_sp, LoadDependentFiles load_dependent_files=eLoadDependentsDefault)
Set the main executable module.
Definition Target.cpp:1576
bool SetSectionLoadAddress(const lldb::SectionSP &section, lldb::addr_t load_addr, bool warn_multiple=false)
Definition Target.cpp:3333
#define LLDB_INVALID_BREAK_ID
#define LLDB_INVALID_ADDRESS
A class that represents a running process on the host machine.
Log * GetLog(Cat mask)
Retrieve the Log object for the channel associated with the given log enum.
Definition Log.h:332
std::shared_ptr< lldb_private::ThreadPlan > ThreadPlanSP
std::shared_ptr< lldb_private::Thread > ThreadSP
uint64_t user_id_t
Definition lldb-types.h:82
std::shared_ptr< lldb_private::Section > SectionSP
uint64_t addr_t
Definition lldb-types.h:80
std::shared_ptr< lldb_private::Module > ModuleSP