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 =
43 function->GetAddressRange().GetBaseAddress().GetLoadAddress(target);
44 if (base_addr == LLDB_INVALID_ADDRESS)
45 base_addr = function->GetAddressRange().GetBaseAddress().GetFileAddress();
46
47 s->Printf(", range%s = ", num_ranges > 1 ? "s" : "");
48 for (size_t i = 0; i < num_ranges; ++i) {
49 const Range &range = m_ranges.GetEntryRef(i);
50 DumpAddressRange(s->AsRawOstream(), base_addr + range.GetRangeBase(),
51 base_addr + range.GetRangeEnd(), 4);
52 }
53 }
54
55 if (m_inlineInfoSP.get() != nullptr) {
56 bool show_fullpaths = (level == eDescriptionLevelVerbose);
57 m_inlineInfoSP->Dump(s, show_fullpaths);
58 }
59}
60
61void Block::Dump(Stream *s, addr_t base_addr, int32_t depth,
62 bool show_context) const {
63 if (depth < 0) {
64 Block *parent = GetParent();
65 if (parent) {
66 // We have a depth that is less than zero, print our parent blocks first
67 parent->Dump(s, base_addr, depth + 1, show_context);
68 }
69 }
70
71 s->Printf("%p: ", static_cast<const void *>(this));
72 s->Indent();
73 *s << "Block" << static_cast<const UserID &>(*this);
74 const Block *parent_block = GetParent();
75 if (parent_block) {
76 s->Printf(", parent = {0x%8.8" PRIx64 "}", parent_block->GetID());
77 }
78 if (m_inlineInfoSP.get() != nullptr) {
79 bool show_fullpaths = false;
80 m_inlineInfoSP->Dump(s, show_fullpaths);
81 }
82
83 if (!m_ranges.IsEmpty()) {
84 *s << ", ranges =";
85
86 size_t num_ranges = m_ranges.GetSize();
87 for (size_t i = 0; i < num_ranges; ++i) {
88 const Range &range = m_ranges.GetEntryRef(i);
89 if (parent_block != nullptr && !parent_block->Contains(range))
90 *s << '!';
91 else
92 *s << ' ';
93 DumpAddressRange(s->AsRawOstream(), base_addr + range.GetRangeBase(),
94 base_addr + range.GetRangeEnd(), 4);
95 }
96 }
97 s->EOL();
98
99 if (depth > 0) {
100 s->IndentMore();
101
102 if (m_variable_list_sp.get()) {
103 m_variable_list_sp->Dump(s, show_context);
104 }
105
106 collection::const_iterator pos, end = m_children.end();
107 for (pos = m_children.begin(); pos != end; ++pos)
108 (*pos)->Dump(s, base_addr, depth - 1, show_context);
109
110 s->IndentLess();
111 }
112}
113
115 if (block_id == GetID())
116 return this;
117
118 Block *matching_block = nullptr;
119 collection::const_iterator pos, end = m_children.end();
120 for (pos = m_children.begin(); pos != end; ++pos) {
121 matching_block = (*pos)->FindBlockByID(block_id);
122 if (matching_block)
123 break;
124 }
125 return matching_block;
126}
127
129 if (!Contains(offset))
130 return nullptr;
131 for (const BlockSP &block_sp : m_children) {
132 if (Block *block = block_sp->FindInnermostBlockByOffset(offset))
133 return block;
134 }
135 return this;
136}
137
140 sc->block = this;
141}
142
145}
146
149}
150
153}
154
156
159 if (function)
160 function->DumpSymbolContext(s);
161 s->Printf(", Block{0x%8.8" PRIx64 "}", GetID());
162}
163
165 if (!m_ranges.IsEmpty()) {
166 size_t num_ranges = m_ranges.GetSize();
167 for (size_t i = 0; i < num_ranges; ++i) {
168 const Range &range = m_ranges.GetEntryRef(i);
169 DumpAddressRange(s->AsRawOstream(), base_addr + range.GetRangeBase(),
170 base_addr + range.GetRangeEnd(), 4);
171 }
172 }
173}
174
175bool Block::Contains(addr_t range_offset) const {
176 return m_ranges.FindEntryThatContains(range_offset) != nullptr;
177}
178
179bool Block::Contains(const Block *block) const {
180 if (this == block)
181 return false; // This block doesn't contain itself...
182
183 // Walk the parent chain for "block" and see if any if them match this block
184 const Block *block_parent;
185 for (block_parent = block->GetParent(); block_parent != nullptr;
186 block_parent = block_parent->GetParent()) {
187 if (this == block_parent)
188 return true; // One of the parents of "block" is this object!
189 }
190 return false;
191}
192
193bool Block::Contains(const Range &range) const {
194 return m_ranges.FindEntryThatContains(range) != nullptr;
195}
196
199}
200
203 return this;
204 return GetInlinedParent();
205}
206
208 Block *parent_block = GetParent();
209 if (parent_block) {
210 if (parent_block->GetInlinedFunctionInfo())
211 return parent_block;
212 else
213 return parent_block->GetInlinedParent();
214 }
215 return nullptr;
216}
217
219 const Declaration &find_call_site) {
220 Block *inlined_block = GetContainingInlinedBlock();
221
222 while (inlined_block) {
223 const auto *function_info = inlined_block->GetInlinedFunctionInfo();
224
225 if (function_info &&
226 function_info->GetCallSite().FileAndLineEqual(find_call_site, true))
227 return inlined_block;
228 inlined_block = inlined_block->GetInlinedParent();
229 }
230 return nullptr;
231}
232
233bool Block::GetRangeContainingOffset(const addr_t offset, Range &range) {
234 const Range *range_ptr = m_ranges.FindEntryThatContains(offset);
235 if (range_ptr) {
236 range = *range_ptr;
237 return true;
238 }
239 range.Clear();
240 return false;
241}
242
244 AddressRange &range) {
246 if (function) {
247 const AddressRange &func_range = function->GetAddressRange();
248 if (addr.GetModule() == func_range.GetBaseAddress().GetModule()) {
249 const addr_t file_addr = addr.GetFileAddress();
250 const addr_t func_file_addr =
251 func_range.GetBaseAddress().GetFileAddress();
252 if (file_addr >= func_file_addr &&
253 file_addr < func_file_addr + func_range.GetByteSize()) {
254 addr_t offset = file_addr - func_file_addr;
255
256 const Range *range_ptr = m_ranges.FindEntryThatContains(offset);
257
258 if (range_ptr) {
259 range.GetBaseAddress() =
260 Address(func_file_addr + range_ptr->GetRangeBase(),
261 addr.GetModule()->GetSectionList());
262 range.SetByteSize(range_ptr->GetByteSize());
263 return true;
264 }
265 }
266 }
267 }
268 range.Clear();
269 return false;
270}
271
273 Target &target, AddressRange &range) {
274 Address load_address;
275 load_address.SetLoadAddress(load_addr, &target);
276 AddressRange containing_range;
277 return GetRangeContainingAddress(load_address, containing_range);
278}
279
282 if (function) {
283 const AddressRange &func_range = function->GetAddressRange();
284 if (addr.GetSection() == func_range.GetBaseAddress().GetSection()) {
285 const addr_t addr_offset = addr.GetOffset();
286 const addr_t func_offset = func_range.GetBaseAddress().GetOffset();
287 if (addr_offset >= func_offset &&
288 addr_offset < func_offset + func_range.GetByteSize()) {
289 addr_t offset = addr_offset - func_offset;
291 }
292 }
293 }
294 return UINT32_MAX;
295}
296
297bool Block::GetRangeAtIndex(uint32_t range_idx, AddressRange &range) {
298 if (range_idx < m_ranges.GetSize()) {
300 if (function) {
301 const Range &vm_range = m_ranges.GetEntryRef(range_idx);
302 range.GetBaseAddress() = function->GetAddressRange().GetBaseAddress();
303 range.GetBaseAddress().Slide(vm_range.GetRangeBase());
304 range.SetByteSize(vm_range.GetByteSize());
305 return true;
306 }
307 }
308 return false;
309}
310
312 AddressRanges ranges;
314 if (!function)
315 return ranges;
316 for (size_t i = 0, e = m_ranges.GetSize(); i < e; ++i) {
317 ranges.emplace_back();
318 auto &range = ranges.back();
319 const Range &vm_range = m_ranges.GetEntryRef(i);
320 range.GetBaseAddress() = function->GetAddressRange().GetBaseAddress();
321 range.GetBaseAddress().Slide(vm_range.GetRangeBase());
322 range.SetByteSize(vm_range.GetByteSize());
323 }
324 return ranges;
325}
326
328 if (m_ranges.IsEmpty())
329 return false;
330
332 if (function) {
333 addr = function->GetAddressRange().GetBaseAddress();
335 return true;
336 }
337 return false;
338}
339
341 m_ranges.Sort();
343}
344
345void Block::AddRange(const Range &range) {
346 Block *parent_block = GetParent();
347 if (parent_block && !parent_block->Contains(range)) {
349 if (log) {
352 const addr_t function_file_addr =
354 const addr_t block_start_addr = function_file_addr + range.GetRangeBase();
355 const addr_t block_end_addr = function_file_addr + range.GetRangeEnd();
356 Type *func_type = function->GetType();
357
358 const Declaration &func_decl = func_type->GetDeclaration();
359 if (func_decl.GetLine()) {
360 LLDB_LOGF(log,
361 "warning: %s:%u block {0x%8.8" PRIx64
362 "} has range[%u] [0x%" PRIx64 " - 0x%" PRIx64
363 ") which is not contained in parent block {0x%8.8" PRIx64
364 "} in function {0x%8.8" PRIx64 "} from %s",
365 func_decl.GetFile().GetPath().c_str(), func_decl.GetLine(),
366 GetID(), (uint32_t)m_ranges.GetSize(), block_start_addr,
367 block_end_addr, parent_block->GetID(), function->GetID(),
368 module_sp->GetFileSpec().GetPath().c_str());
369 } else {
370 LLDB_LOGF(log,
371 "warning: block {0x%8.8" PRIx64 "} has range[%u] [0x%" PRIx64
372 " - 0x%" PRIx64
373 ") which is not contained in parent block {0x%8.8" PRIx64
374 "} in function {0x%8.8" PRIx64 "} from %s",
375 GetID(), (uint32_t)m_ranges.GetSize(), block_start_addr,
376 block_end_addr, parent_block->GetID(), function->GetID(),
377 module_sp->GetFileSpec().GetPath().c_str());
378 }
379 }
380 parent_block->AddRange(range);
381 }
382 m_ranges.Append(range);
383}
384
385// Return the current number of bytes that this object occupies in memory
386size_t Block::MemorySize() const {
387 size_t mem_size = sizeof(Block) + m_ranges.GetSize() * sizeof(Range);
388 if (m_inlineInfoSP.get())
389 mem_size += m_inlineInfoSP->MemorySize();
390 if (m_variable_list_sp.get())
391 mem_size += m_variable_list_sp->MemorySize();
392 return mem_size;
393}
394
396 m_children.push_back(std::shared_ptr<Block>(new Block(uid, *this)));
397 return m_children.back();
398}
399
400void Block::SetInlinedFunctionInfo(const char *name, const char *mangled,
401 const Declaration *decl_ptr,
402 const Declaration *call_decl_ptr) {
403 m_inlineInfoSP = std::make_shared<InlineFunctionInfo>(name, mangled, decl_ptr,
404 call_decl_ptr);
405}
406
409 if (m_variable_list_sp.get() == nullptr && can_create) {
411 SymbolContext sc;
413 assert(sc.module_sp);
414 sc.module_sp->GetSymbolFile()->ParseVariablesForContext(sc);
415 }
416 }
417 return m_variable_list_sp;
418}
419
420uint32_t
421Block::AppendBlockVariables(bool can_create, bool get_child_block_variables,
422 bool stop_if_child_block_is_inlined_function,
423 const std::function<bool(Variable *)> &filter,
424 VariableList *variable_list) {
425 uint32_t num_variables_added = 0;
426 VariableList *block_var_list = GetBlockVariableList(can_create).get();
427 if (block_var_list) {
428 for (const VariableSP &var_sp : *block_var_list) {
429 if (filter(var_sp.get())) {
430 num_variables_added++;
431 variable_list->AddVariable(var_sp);
432 }
433 }
434 }
435
436 if (get_child_block_variables) {
437 collection::const_iterator pos, end = m_children.end();
438 for (pos = m_children.begin(); pos != end; ++pos) {
439 Block *child_block = pos->get();
440 if (!stop_if_child_block_is_inlined_function ||
441 child_block->GetInlinedFunctionInfo() == nullptr) {
442 num_variables_added += child_block->AppendBlockVariables(
443 can_create, get_child_block_variables,
444 stop_if_child_block_is_inlined_function, filter, variable_list);
445 }
446 }
447 }
448 return num_variables_added;
449}
450
451uint32_t Block::AppendVariables(bool can_create, bool get_parent_variables,
452 bool stop_if_block_is_inlined_function,
453 const std::function<bool(Variable *)> &filter,
454 VariableList *variable_list) {
455 uint32_t num_variables_added = 0;
456 VariableListSP variable_list_sp(GetBlockVariableList(can_create));
457
458 bool is_inlined_function = GetInlinedFunctionInfo() != nullptr;
459 if (variable_list_sp) {
460 for (size_t i = 0; i < variable_list_sp->GetSize(); ++i) {
461 VariableSP variable = variable_list_sp->GetVariableAtIndex(i);
462 if (filter(variable.get())) {
463 num_variables_added++;
464 variable_list->AddVariable(variable);
465 }
466 }
467 }
468
469 if (get_parent_variables) {
470 if (stop_if_block_is_inlined_function && is_inlined_function)
471 return num_variables_added;
472
473 Block *parent_block = GetParent();
474 if (parent_block)
475 num_variables_added += parent_block->AppendVariables(
476 can_create, get_parent_variables, stop_if_block_is_inlined_function,
477 filter, variable_list);
478 }
479 return num_variables_added;
480}
481
483 if (ModuleSP module_sp = CalculateSymbolContextModule())
484 return module_sp->GetSymbolFile();
485 return nullptr;
486}
487
489 if (SymbolFile *sym_file = GetSymbolFile())
490 return sym_file->GetDeclContextForUID(GetID());
491 return CompilerDeclContext();
492}
493
494void Block::SetBlockInfoHasBeenParsed(bool b, bool set_children) {
496 if (set_children) {
498 collection::const_iterator pos, end = m_children.end();
499 for (pos = m_children.begin(); pos != end; ++pos)
500 (*pos)->SetBlockInfoHasBeenParsed(b, true);
501 }
502}
503
504void Block::SetDidParseVariables(bool b, bool set_children) {
506 if (set_children) {
507 collection::const_iterator pos, end = m_children.end();
508 for (pos = m_children.begin(); pos != end; ++pos)
509 (*pos)->SetDidParseVariables(b, true);
510 }
511}
512
514 if (Block *parent_block = GetParent())
515 return parent_block->GetSiblingForChild(this);
516 return nullptr;
517}
518
519// A parent of child blocks can be asked to find a sibling block given
520// one of its child blocks
521Block *Block::GetSiblingForChild(const Block *child_block) const {
522 if (!m_children.empty()) {
523 collection::const_iterator pos, end = m_children.end();
524 for (pos = m_children.begin(); pos != end; ++pos) {
525 if (pos->get() == child_block) {
526 if (++pos != end)
527 return pos->get();
528 break;
529 }
530 }
531 }
532 return nullptr;
533}
#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:407
Block * GetContainingInlinedBlockWithCallSite(const Declaration &find_call_site)
Get the inlined block at the given call site that contains this block.
Definition: Block.cpp:218
void CalculateSymbolContext(SymbolContext *sc) override
Reconstruct the object's symbol context into sc.
Definition: Block.cpp:138
Block * FindInnermostBlockByOffset(const lldb::addr_t offset)
Definition: Block.cpp:128
lldb::ModuleSP CalculateSymbolContextModule() override
Definition: Block.cpp:143
Block * GetContainingInlinedBlock()
Get the inlined block that contains this block.
Definition: Block.cpp:201
void SetBlockInfoHasBeenParsed(bool b, bool set_children)
Definition: Block.cpp:494
bool GetRangeAtIndex(uint32_t range_idx, AddressRange &range)
Definition: Block.cpp:297
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:311
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:157
bool GetRangeContainingAddress(const Address &addr, AddressRange &range)
Definition: Block.cpp:243
lldb::BlockSP CreateChild(lldb::user_id_t uid)
Creates a block with the specified UID uid.
Definition: Block.cpp:395
Block * FindBlockByID(lldb::user_id_t block_id)
Definition: Block.cpp:114
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:513
bool Contains(lldb::addr_t range_offset) const
Check if an offset is in one of the block offset ranges.
Definition: Block.cpp:175
CompileUnit * CalculateSymbolContextCompileUnit() override
Definition: Block.cpp:147
Block * GetSiblingForChild(const Block *child_block) const
Definition: Block.cpp:521
Function * CalculateSymbolContextFunction() override
Definition: Block.cpp:151
bool GetRangeContainingLoadAddress(lldb::addr_t load_addr, Target &target, AddressRange &range)
Definition: Block.cpp:272
CompilerDeclContext GetDeclContext()
Definition: Block.cpp:488
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:197
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:451
bool GetStartAddress(Address &addr)
Definition: Block.cpp:327
SymbolFile * GetSymbolFile()
Get the symbol file which contains debug info for this block's symbol context module.
Definition: Block.cpp:482
void Dump(Stream *s, lldb::addr_t base_addr, int32_t depth, bool show_context) const
Dump the block contents.
Definition: Block.cpp:61
void SetDidParseVariables(bool b, bool set_children)
Definition: Block.cpp:504
bool GetRangeContainingOffset(const lldb::addr_t offset, Range &range)
Definition: Block.cpp:233
void AddRange(const Range &range)
Add a new offset range to this block.
Definition: Block.cpp:345
Block * CalculateSymbolContextBlock() override
Definition: Block.cpp:155
void DumpAddressRanges(Stream *s, lldb::addr_t base_addr)
Definition: Block.cpp:164
Block * GetInlinedParent()
Get the inlined parent block for this block.
Definition: Block.cpp:207
void FinalizeRanges()
Definition: Block.cpp:340
SymbolContextScope & m_parent_scope
Definition: Block.h:353
uint32_t GetRangeIndexContainingAddress(const Address &addr)
Definition: Block.cpp:280
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:400
size_t MemorySize() const
Get the memory cost of this object.
Definition: Block.cpp:386
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:421
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 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