LLDB mainline
Block.cpp
Go to the documentation of this file.
1//===-- Block.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 "lldb/Symbol/Block.h"
10
11#include "lldb/Core/Module.h"
12#include "lldb/Core/Section.h"
17#include "lldb/Utility/Log.h"
18
19#include <memory>
20
21using namespace lldb;
22using namespace lldb_private;
23
24Block::Block(Function &function, user_id_t function_uid)
25 : Block(function_uid, function) {}
26
28 : UserID(uid), m_parent_scope(parent_scope), m_parsed_block_info(false),
29 m_parsed_block_variables(false), m_parsed_child_blocks(false) {}
30
31Block::~Block() = default;
32
34 lldb::DescriptionLevel level, Target *target) const {
35 *s << "id = " << ((const UserID &)*this);
36
37 size_t num_ranges = m_ranges.GetSize();
38 if (num_ranges > 0) {
39
40 addr_t base_addr = LLDB_INVALID_ADDRESS;
41 if (target)
42 base_addr = function->GetAddress().GetLoadAddress(target);
43 if (base_addr == LLDB_INVALID_ADDRESS)
44 base_addr = function->GetAddress().GetFileAddress();
45
46 s->Printf(", range%s = ", num_ranges > 1 ? "s" : "");
47 for (size_t i = 0; i < num_ranges; ++i) {
48 const Range &range = m_ranges.GetEntryRef(i);
49 DumpAddressRange(s->AsRawOstream(), base_addr + range.GetRangeBase(),
50 base_addr + range.GetRangeEnd(), 4);
51 }
52 }
53
54 if (m_inlineInfoSP.get() != nullptr) {
55 bool show_fullpaths = (level == eDescriptionLevelVerbose);
56 m_inlineInfoSP->Dump(s, show_fullpaths);
57 }
58}
59
60void Block::Dump(Stream *s, addr_t base_addr, int32_t depth,
61 bool show_context) const {
62 if (depth < 0) {
63 Block *parent = GetParent();
64 if (parent) {
65 // We have a depth that is less than zero, print our parent blocks first
66 parent->Dump(s, base_addr, depth + 1, show_context);
67 }
68 }
69
70 s->Printf("%p: ", static_cast<const void *>(this));
71 s->Indent();
72 *s << "Block" << static_cast<const UserID &>(*this);
73 const Block *parent_block = GetParent();
74 if (parent_block) {
75 s->Printf(", parent = {0x%8.8" PRIx64 "}", parent_block->GetID());
76 }
77 if (m_inlineInfoSP.get() != nullptr) {
78 bool show_fullpaths = false;
79 m_inlineInfoSP->Dump(s, show_fullpaths);
80 }
81
82 if (!m_ranges.IsEmpty()) {
83 *s << ", ranges =";
84
85 size_t num_ranges = m_ranges.GetSize();
86 for (size_t i = 0; i < num_ranges; ++i) {
87 const Range &range = m_ranges.GetEntryRef(i);
88 if (parent_block != nullptr && !parent_block->Contains(range))
89 *s << '!';
90 else
91 *s << ' ';
92 DumpAddressRange(s->AsRawOstream(), base_addr + range.GetRangeBase(),
93 base_addr + range.GetRangeEnd(), 4);
94 }
95 }
96 s->EOL();
97
98 if (depth > 0) {
99 s->IndentMore();
100
101 if (m_variable_list_sp.get()) {
102 m_variable_list_sp->Dump(s, show_context);
103 }
104
105 collection::const_iterator pos, end = m_children.end();
106 for (pos = m_children.begin(); pos != end; ++pos)
107 (*pos)->Dump(s, base_addr, depth - 1, show_context);
108
109 s->IndentLess();
110 }
111}
112
114 if (block_id == GetID())
115 return this;
116
117 Block *matching_block = nullptr;
118 collection::const_iterator pos, end = m_children.end();
119 for (pos = m_children.begin(); pos != end; ++pos) {
120 matching_block = (*pos)->FindBlockByID(block_id);
121 if (matching_block)
122 break;
123 }
124 return matching_block;
125}
126
128 if (!Contains(offset))
129 return nullptr;
130 for (const BlockSP &block_sp : m_children) {
131 if (Block *block = block_sp->FindInnermostBlockByOffset(offset))
132 return block;
133 }
134 return this;
135}
136
139 sc->block = this;
140}
141
144}
145
148}
149
152}
153
155
158 if (function)
159 function->DumpSymbolContext(s);
160 s->Printf(", Block{0x%8.8" PRIx64 "}", GetID());
161}
162
164 if (!m_ranges.IsEmpty()) {
165 size_t num_ranges = m_ranges.GetSize();
166 for (size_t i = 0; i < num_ranges; ++i) {
167 const Range &range = m_ranges.GetEntryRef(i);
168 DumpAddressRange(s->AsRawOstream(), base_addr + range.GetRangeBase(),
169 base_addr + range.GetRangeEnd(), 4);
170 }
171 }
172}
173
174bool Block::Contains(addr_t range_offset) const {
175 return m_ranges.FindEntryThatContains(range_offset) != nullptr;
176}
177
178bool Block::Contains(const Block *block) const {
179 if (this == block)
180 return false; // This block doesn't contain itself...
181
182 // Walk the parent chain for "block" and see if any if them match this block
183 const Block *block_parent;
184 for (block_parent = block->GetParent(); block_parent != nullptr;
185 block_parent = block_parent->GetParent()) {
186 if (this == block_parent)
187 return true; // One of the parents of "block" is this object!
188 }
189 return false;
190}
191
192bool Block::Contains(const Range &range) const {
193 return m_ranges.FindEntryThatContains(range) != nullptr;
194}
195
198}
199
202 return this;
203 return GetInlinedParent();
204}
205
207 Block *parent_block = GetParent();
208 if (parent_block) {
209 if (parent_block->GetInlinedFunctionInfo())
210 return parent_block;
211 else
212 return parent_block->GetInlinedParent();
213 }
214 return nullptr;
215}
216
218 const Declaration &find_call_site) {
219 Block *inlined_block = GetContainingInlinedBlock();
220
221 while (inlined_block) {
222 const auto *function_info = inlined_block->GetInlinedFunctionInfo();
223
224 if (function_info &&
225 function_info->GetCallSite().FileAndLineEqual(find_call_site, true))
226 return inlined_block;
227 inlined_block = inlined_block->GetInlinedParent();
228 }
229 return nullptr;
230}
231
232bool Block::GetRangeContainingOffset(const addr_t offset, Range &range) {
233 const Range *range_ptr = m_ranges.FindEntryThatContains(offset);
234 if (range_ptr) {
235 range = *range_ptr;
236 return true;
237 }
238 range.Clear();
239 return false;
240}
241
243 AddressRange &range) {
245 if (function) {
246 const AddressRange &func_range = function->GetAddressRange();
247 if (addr.GetModule() == func_range.GetBaseAddress().GetModule()) {
248 const addr_t file_addr = addr.GetFileAddress();
249 const addr_t func_file_addr =
250 func_range.GetBaseAddress().GetFileAddress();
251 if (file_addr >= func_file_addr &&
252 file_addr < func_file_addr + func_range.GetByteSize()) {
253 addr_t offset = file_addr - func_file_addr;
254
255 const Range *range_ptr = m_ranges.FindEntryThatContains(offset);
256
257 if (range_ptr) {
258 range.GetBaseAddress() =
259 Address(func_file_addr + range_ptr->GetRangeBase(),
260 addr.GetModule()->GetSectionList());
261 range.SetByteSize(range_ptr->GetByteSize());
262 return true;
263 }
264 }
265 }
266 }
267 range.Clear();
268 return false;
269}
270
272 Target &target, AddressRange &range) {
273 Address load_address;
274 load_address.SetLoadAddress(load_addr, &target);
275 AddressRange containing_range;
276 return GetRangeContainingAddress(load_address, containing_range);
277}
278
281 if (function) {
282 const AddressRange &func_range = function->GetAddressRange();
283 if (addr.GetSection() == func_range.GetBaseAddress().GetSection()) {
284 const addr_t addr_offset = addr.GetOffset();
285 const addr_t func_offset = func_range.GetBaseAddress().GetOffset();
286 if (addr_offset >= func_offset &&
287 addr_offset < func_offset + func_range.GetByteSize()) {
288 addr_t offset = addr_offset - func_offset;
290 }
291 }
292 }
293 return UINT32_MAX;
294}
295
296bool Block::GetRangeAtIndex(uint32_t range_idx, AddressRange &range) {
297 if (range_idx < m_ranges.GetSize()) {
299 if (function) {
300 const Range &vm_range = m_ranges.GetEntryRef(range_idx);
301 range.GetBaseAddress() = function->GetAddress();
302 range.GetBaseAddress().Slide(vm_range.GetRangeBase());
303 range.SetByteSize(vm_range.GetByteSize());
304 return true;
305 }
306 }
307 return false;
308}
309
311 AddressRanges ranges;
313 if (!function)
314 return ranges;
315 for (size_t i = 0, e = m_ranges.GetSize(); i < e; ++i) {
316 ranges.emplace_back();
317 auto &range = ranges.back();
318 const Range &vm_range = m_ranges.GetEntryRef(i);
319 range.GetBaseAddress() = function->GetAddress();
320 range.GetBaseAddress().Slide(vm_range.GetRangeBase());
321 range.SetByteSize(vm_range.GetByteSize());
322 }
323 return ranges;
324}
325
327 if (m_ranges.IsEmpty())
328 return false;
329
331 if (function) {
332 addr = function->GetAddress();
334 return true;
335 }
336 return false;
337}
338
340 m_ranges.Sort();
342}
343
344void Block::AddRange(const Range &range) {
345 Block *parent_block = GetParent();
346 if (parent_block && !parent_block->Contains(range)) {
348 if (log) {
351 const addr_t function_file_addr = function->GetAddress().GetFileAddress();
352 const addr_t block_start_addr = function_file_addr + range.GetRangeBase();
353 const addr_t block_end_addr = function_file_addr + range.GetRangeEnd();
354 Type *func_type = function->GetType();
355
356 const Declaration &func_decl = func_type->GetDeclaration();
357 if (func_decl.GetLine()) {
358 LLDB_LOGF(log,
359 "warning: %s:%u block {0x%8.8" PRIx64
360 "} has range[%u] [0x%" PRIx64 " - 0x%" PRIx64
361 ") which is not contained in parent block {0x%8.8" PRIx64
362 "} in function {0x%8.8" PRIx64 "} from %s",
363 func_decl.GetFile().GetPath().c_str(), func_decl.GetLine(),
364 GetID(), (uint32_t)m_ranges.GetSize(), block_start_addr,
365 block_end_addr, parent_block->GetID(), function->GetID(),
366 module_sp->GetFileSpec().GetPath().c_str());
367 } else {
368 LLDB_LOGF(log,
369 "warning: block {0x%8.8" PRIx64 "} has range[%u] [0x%" PRIx64
370 " - 0x%" PRIx64
371 ") which is not contained in parent block {0x%8.8" PRIx64
372 "} in function {0x%8.8" PRIx64 "} from %s",
373 GetID(), (uint32_t)m_ranges.GetSize(), block_start_addr,
374 block_end_addr, parent_block->GetID(), function->GetID(),
375 module_sp->GetFileSpec().GetPath().c_str());
376 }
377 }
378 parent_block->AddRange(range);
379 }
380 m_ranges.Append(range);
381}
382
383// Return the current number of bytes that this object occupies in memory
384size_t Block::MemorySize() const {
385 size_t mem_size = sizeof(Block) + m_ranges.GetSize() * sizeof(Range);
386 if (m_inlineInfoSP.get())
387 mem_size += m_inlineInfoSP->MemorySize();
388 if (m_variable_list_sp.get())
389 mem_size += m_variable_list_sp->MemorySize();
390 return mem_size;
391}
392
394 m_children.push_back(std::shared_ptr<Block>(new Block(uid, *this)));
395 return m_children.back();
396}
397
398void Block::SetInlinedFunctionInfo(const char *name, const char *mangled,
399 const Declaration *decl_ptr,
400 const Declaration *call_decl_ptr) {
401 m_inlineInfoSP = std::make_shared<InlineFunctionInfo>(name, mangled, decl_ptr,
402 call_decl_ptr);
403}
404
407 if (m_variable_list_sp.get() == nullptr && can_create) {
409 SymbolContext sc;
411 assert(sc.module_sp);
412 sc.module_sp->GetSymbolFile()->ParseVariablesForContext(sc);
413 }
414 }
415 return m_variable_list_sp;
416}
417
418uint32_t
419Block::AppendBlockVariables(bool can_create, bool get_child_block_variables,
420 bool stop_if_child_block_is_inlined_function,
421 const std::function<bool(Variable *)> &filter,
422 VariableList *variable_list) {
423 uint32_t num_variables_added = 0;
424 VariableList *block_var_list = GetBlockVariableList(can_create).get();
425 if (block_var_list) {
426 for (const VariableSP &var_sp : *block_var_list) {
427 if (filter(var_sp.get())) {
428 num_variables_added++;
429 variable_list->AddVariable(var_sp);
430 }
431 }
432 }
433
434 if (get_child_block_variables) {
435 collection::const_iterator pos, end = m_children.end();
436 for (pos = m_children.begin(); pos != end; ++pos) {
437 Block *child_block = pos->get();
438 if (!stop_if_child_block_is_inlined_function ||
439 child_block->GetInlinedFunctionInfo() == nullptr) {
440 num_variables_added += child_block->AppendBlockVariables(
441 can_create, get_child_block_variables,
442 stop_if_child_block_is_inlined_function, filter, variable_list);
443 }
444 }
445 }
446 return num_variables_added;
447}
448
449uint32_t Block::AppendVariables(bool can_create, bool get_parent_variables,
450 bool stop_if_block_is_inlined_function,
451 const std::function<bool(Variable *)> &filter,
452 VariableList *variable_list) {
453 uint32_t num_variables_added = 0;
454 VariableListSP variable_list_sp(GetBlockVariableList(can_create));
455
456 bool is_inlined_function = GetInlinedFunctionInfo() != nullptr;
457 if (variable_list_sp) {
458 for (size_t i = 0; i < variable_list_sp->GetSize(); ++i) {
459 VariableSP variable = variable_list_sp->GetVariableAtIndex(i);
460 if (filter(variable.get())) {
461 num_variables_added++;
462 variable_list->AddVariable(variable);
463 }
464 }
465 }
466
467 if (get_parent_variables) {
468 if (stop_if_block_is_inlined_function && is_inlined_function)
469 return num_variables_added;
470
471 Block *parent_block = GetParent();
472 if (parent_block)
473 num_variables_added += parent_block->AppendVariables(
474 can_create, get_parent_variables, stop_if_block_is_inlined_function,
475 filter, variable_list);
476 }
477 return num_variables_added;
478}
479
481 if (ModuleSP module_sp = CalculateSymbolContextModule())
482 return module_sp->GetSymbolFile();
483 return nullptr;
484}
485
487 if (SymbolFile *sym_file = GetSymbolFile())
488 return sym_file->GetDeclContextForUID(GetID());
489 return CompilerDeclContext();
490}
491
492void Block::SetBlockInfoHasBeenParsed(bool b, bool set_children) {
494 if (set_children) {
496 collection::const_iterator pos, end = m_children.end();
497 for (pos = m_children.begin(); pos != end; ++pos)
498 (*pos)->SetBlockInfoHasBeenParsed(b, true);
499 }
500}
501
502void Block::SetDidParseVariables(bool b, bool set_children) {
504 if (set_children) {
505 collection::const_iterator pos, end = m_children.end();
506 for (pos = m_children.begin(); pos != end; ++pos)
507 (*pos)->SetDidParseVariables(b, true);
508 }
509}
510
512 if (Block *parent_block = GetParent())
513 return parent_block->GetSiblingForChild(this);
514 return nullptr;
515}
516
517// A parent of child blocks can be asked to find a sibling block given
518// one of its child blocks
519Block *Block::GetSiblingForChild(const Block *child_block) const {
520 if (!m_children.empty()) {
521 collection::const_iterator pos, end = m_children.end();
522 for (pos = m_children.begin(); pos != end; ++pos) {
523 if (pos->get() == child_block) {
524 if (++pos != end)
525 return pos->get();
526 break;
527 }
528 }
529 }
530 return nullptr;
531}
#define LLDB_LOGF(log,...)
Definition: Log.h:376
A section + offset based address range class.
Definition: AddressRange.h:25
Address & GetBaseAddress()
Get accessor for the base address of the range.
Definition: AddressRange.h:211
void Clear()
Clear the object's state.
void SetByteSize(lldb::addr_t byte_size)
Set accessor for the byte size of this range.
Definition: AddressRange.h:239
lldb::addr_t GetByteSize() const
Get accessor for the byte size of this range.
Definition: AddressRange.h:223
A section + offset based address class.
Definition: Address.h:62
lldb::addr_t GetLoadAddress(Target *target) const
Get the load address.
Definition: Address.cpp:313
bool SetLoadAddress(lldb::addr_t load_addr, Target *target, bool allow_section_end=false)
Set the address to represent load_addr.
Definition: Address.cpp:1047
lldb::SectionSP GetSection() const
Get const accessor for the section.
Definition: Address.h:439
bool Slide(int64_t offset)
Definition: Address.h:459
lldb::ModuleSP GetModule() const
Get accessor for the module for this address.
Definition: Address.cpp:285
lldb::addr_t GetFileAddress() const
Get the file address.
Definition: Address.cpp:293
lldb::addr_t GetOffset() const
Get the section relative offset value.
Definition: Address.h:329
A class that describes a single lexical block.
Definition: Block.h:41
RangeList::Entry Range
Definition: Block.h:44
lldb::VariableListSP m_variable_list_sp
The variable list for all local, static and parameter variables scoped to this block.
Definition: Block.h:357
lldb::VariableListSP GetBlockVariableList(bool can_create)
Get the variable list for this block only.
Definition: Block.cpp:405
Block * GetContainingInlinedBlockWithCallSite(const Declaration &find_call_site)
Get the inlined block at the given call site that contains this block.
Definition: Block.cpp:217
void CalculateSymbolContext(SymbolContext *sc) override
Reconstruct the object's symbol context into sc.
Definition: Block.cpp:137
Block * FindInnermostBlockByOffset(const lldb::addr_t offset)
Definition: Block.cpp:127
lldb::ModuleSP CalculateSymbolContextModule() override
Definition: Block.cpp:142
Block * GetContainingInlinedBlock()
Get the inlined block that contains this block.
Definition: Block.cpp:200
void SetBlockInfoHasBeenParsed(bool b, bool set_children)
Definition: Block.cpp:492
bool GetRangeAtIndex(uint32_t range_idx, AddressRange &range)
Definition: Block.cpp:296
const InlineFunctionInfo * GetInlinedFunctionInfo() const
Get const accessor for any inlined function information.
Definition: Block.h:266
Block(Function &function, lldb::user_id_t function_uid)
Definition: Block.cpp:24
AddressRanges GetRanges()
Definition: Block.cpp:310
bool m_parsed_child_blocks
Definition: Block.h:362
lldb::InlineFunctionInfoSP m_inlineInfoSP
Inlined function information.
Definition: Block.h:356
void DumpSymbolContext(Stream *s) override
Dump the object's symbol context to the stream s.
Definition: Block.cpp:156
bool GetRangeContainingAddress(const Address &addr, AddressRange &range)
Definition: Block.cpp:242
lldb::BlockSP CreateChild(lldb::user_id_t uid)
Creates a block with the specified UID uid.
Definition: Block.cpp:393
Block * FindBlockByID(lldb::user_id_t block_id)
Definition: Block.cpp:113
bool m_parsed_block_info
Set to true if this block and it's children have all been parsed.
Definition: Block.h:361
Block * GetSibling() const
Get the sibling block for this block.
Definition: Block.cpp:511
bool Contains(lldb::addr_t range_offset) const
Check if an offset is in one of the block offset ranges.
Definition: Block.cpp:174
CompileUnit * CalculateSymbolContextCompileUnit() override
Definition: Block.cpp:146
Block * GetSiblingForChild(const Block *child_block) const
Definition: Block.cpp:519
Function * CalculateSymbolContextFunction() override
Definition: Block.cpp:150
bool GetRangeContainingLoadAddress(lldb::addr_t load_addr, Target &target, AddressRange &range)
Definition: Block.cpp:271
CompilerDeclContext GetDeclContext()
Definition: Block.cpp:486
collection m_children
Definition: Block.h:354
bool m_parsed_block_variables
Definition: Block.h:362
Block * GetParent() const
Get the parent block.
Definition: Block.cpp:196
uint32_t AppendVariables(bool can_create, bool get_parent_variables, bool stop_if_block_is_inlined_function, const std::function< bool(Variable *)> &filter, VariableList *variable_list)
Appends the variables from this block, and optionally from all parent blocks, to variable_list.
Definition: Block.cpp:449
bool GetStartAddress(Address &addr)
Definition: Block.cpp:326
SymbolFile * GetSymbolFile()
Get the symbol file which contains debug info for this block's symbol context module.
Definition: Block.cpp:480
void Dump(Stream *s, lldb::addr_t base_addr, int32_t depth, bool show_context) const
Dump the block contents.
Definition: Block.cpp:60
void SetDidParseVariables(bool b, bool set_children)
Definition: Block.cpp:502
bool GetRangeContainingOffset(const lldb::addr_t offset, Range &range)
Definition: Block.cpp:232
void AddRange(const Range &range)
Add a new offset range to this block.
Definition: Block.cpp:344
Block * CalculateSymbolContextBlock() override
Definition: Block.cpp:154
void DumpAddressRanges(Stream *s, lldb::addr_t base_addr)
Definition: Block.cpp:163
Block * GetInlinedParent()
Get the inlined parent block for this block.
Definition: Block.cpp:206
void FinalizeRanges()
Definition: Block.cpp:339
SymbolContextScope & m_parent_scope
Definition: Block.h:353
uint32_t GetRangeIndexContainingAddress(const Address &addr)
Definition: Block.cpp:279
void SetInlinedFunctionInfo(const char *name, const char *mangled, const Declaration *decl_ptr, const Declaration *call_decl_ptr)
Set accessor for any inlined function information.
Definition: Block.cpp:398
size_t MemorySize() const
Get the memory cost of this object.
Definition: Block.cpp:384
uint32_t AppendBlockVariables(bool can_create, bool get_child_block_variables, bool stop_if_child_block_is_inlined_function, const std::function< bool(Variable *)> &filter, VariableList *variable_list)
Get the variable list for this block and optionally all child blocks if get_child_variables is true.
Definition: Block.cpp:419
void GetDescription(Stream *s, Function *function, lldb::DescriptionLevel level, Target *target) const
Definition: Block.cpp:33
RangeList m_ranges
Definition: Block.h:355
A class that describes a compilation unit.
Definition: CompileUnit.h:43
Represents a generic declaration context in a program.
A class that describes the declaration location of a lldb object.
Definition: Declaration.h:24
uint32_t GetLine() const
Get accessor for the declaration line number.
Definition: Declaration.h:124
FileSpec & GetFile()
Get accessor for file specification.
Definition: Declaration.h:111
size_t GetPath(char *path, size_t max_path_length, bool denormalize=true) const
Extract the full path to the file.
Definition: FileSpec.cpp:367
A class that describes a function.
Definition: Function.h:399
const Address & GetAddress() const
Return the address of the function (its entry point).
Definition: Function.h:455
const AddressRange & GetAddressRange()
DEPRECATED: Use GetAddressRanges instead.
Definition: Function.h:448
void DumpSymbolContext(Stream *s) override
Dump the object's symbol context to the stream s.
Definition: Function.cpp:518
Type * GetType()
Get accessor for the type that describes the function return value type, and parameter types.
Definition: Function.cpp:566
const Entry * FindEntryThatContains(B addr) const
Definition: RangeMap.h:338
uint32_t FindEntryIndexThatContains(B addr) const
Definition: RangeMap.h:316
Entry & GetEntryRef(size_t i)
Definition: RangeMap.h:303
void Append(const Entry &entry)
Definition: RangeMap.h:179
bool IsEmpty() const
Definition: RangeMap.h:293
size_t GetSize() const
Definition: RangeMap.h:295
A stream class that can stream formatted output to a file.
Definition: Stream.h:28
llvm::raw_ostream & AsRawOstream()
Returns a raw_ostream that forwards the data to this Stream object.
Definition: Stream.h:401
size_t Indent(llvm::StringRef s="")
Indent the current line in the stream.
Definition: Stream.cpp:157
size_t Printf(const char *format,...) __attribute__((format(printf
Output printf formatted output to the stream.
Definition: Stream.cpp:134
size_t EOL()
Output and End of Line character to the stream.
Definition: Stream.cpp:155
void IndentLess(unsigned amount=2)
Decrement the current indentation level.
Definition: Stream.cpp:198
void IndentMore(unsigned amount=2)
Increment the current indentation level.
Definition: Stream.cpp:195
"lldb/Symbol/SymbolContextScope.h" Inherit from this if your object is part of a symbol context and c...
virtual Function * CalculateSymbolContextFunction()
virtual CompileUnit * CalculateSymbolContextCompileUnit()
virtual void CalculateSymbolContext(SymbolContext *sc)=0
Reconstruct the object's symbol context into sc.
virtual Block * CalculateSymbolContextBlock()
virtual lldb::ModuleSP CalculateSymbolContextModule()
Defines a symbol context baton that can be handed other debug core functions.
Definition: SymbolContext.h:34
Block * block
The Block for a given query.
lldb::ModuleSP module_sp
The Module for a given query.
Provides public interface for all SymbolFiles.
Definition: SymbolFile.h:50
const lldb_private::Declaration & GetDeclaration() const
Definition: Type.cpp:576
void AddVariable(const lldb::VariableSP &var_sp)
#define LLDB_INVALID_ADDRESS
Definition: lldb-defines.h:82
#define UINT32_MAX
Definition: lldb-defines.h:19
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
void DumpAddressRange(llvm::raw_ostream &s, uint64_t lo_addr, uint64_t hi_addr, uint32_t addr_size, const char *prefix=nullptr, const char *suffix=nullptr)
Output an address range to this stream.
Definition: Stream.cpp:120
Definition: SBAddress.h:15
DescriptionLevel
Description levels for "void GetDescription(Stream *, DescriptionLevel)" calls.
@ eDescriptionLevelVerbose
std::shared_ptr< lldb_private::Block > BlockSP
Definition: lldb-forward.h:320
std::shared_ptr< lldb_private::VariableList > VariableListSP
Definition: lldb-forward.h:487
std::shared_ptr< lldb_private::Variable > VariableSP
Definition: lldb-forward.h:486
uint64_t user_id_t
Definition: lldb-types.h:82
uint64_t addr_t
Definition: lldb-types.h:80
std::shared_ptr< lldb_private::Module > ModuleSP
Definition: lldb-forward.h:373
void Clear(BaseType b=0)
Definition: RangeMap.h:40
BaseType GetRangeBase() const
Definition: RangeMap.h:45
SizeType GetByteSize() const
Definition: RangeMap.h:87
BaseType GetRangeEnd() const
Definition: RangeMap.h:78
A mix in class that contains a generic user ID.
Definition: UserID.h:31
lldb::user_id_t GetID() const
Get accessor for the user ID.
Definition: UserID.h:47