Lines Matching full:block
1 //===-- Block.cpp ---------------------------------------------------------===//
9 #include "lldb/Symbol/Block.h"
24 Block::Block(Function &function, user_id_t function_uid)
25 : Block(function_uid, function) {}
27 Block::Block(lldb::user_id_t uid, SymbolContextScope &parent_scope)
31 Block::~Block() = default;
33 void Block::GetDescription(Stream *s, Function *function,
60 void Block::Dump(Stream *s, addr_t base_addr, int32_t depth,
63 Block *parent = GetParent();
72 *s << "Block" << static_cast<const UserID &>(*this);
73 const Block *parent_block = GetParent();
113 Block *Block::FindBlockByID(user_id_t block_id) {
117 Block *matching_block = nullptr;
127 Block *Block::FindInnermostBlockByOffset(const lldb::addr_t offset) {
131 if (Block *block = block_sp->FindInnermostBlockByOffset(offset))
132 return block;
137 void Block::CalculateSymbolContext(SymbolContext *sc) {
139 sc->block = this;
142 lldb::ModuleSP Block::CalculateSymbolContextModule() {
146 CompileUnit *Block::CalculateSymbolContextCompileUnit() {
150 Function *Block::CalculateSymbolContextFunction() {
154 Block *Block::CalculateSymbolContextBlock() { return this; }
156 void Block::DumpSymbolContext(Stream *s) {
160 s->Printf(", Block{0x%8.8" PRIx64 "}", GetID());
163 void Block::DumpAddressRanges(Stream *s, lldb::addr_t base_addr) {
174 bool Block::Contains(addr_t range_offset) const {
178 bool Block::Contains(const Block *block) const {
179 if (this == block)
180 return false; // This block doesn't contain itself...
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;
187 return true; // One of the parents of "block" is this object!
192 bool Block::Contains(const Range &range) const {
196 Block *Block::GetParent() const {
200 Block *Block::GetContainingInlinedBlock() {
206 Block *Block::GetInlinedParent() {
207 Block *parent_block = GetParent();
217 Block *Block::GetContainingInlinedBlockWithCallSite(
219 Block *inlined_block = GetContainingInlinedBlock();
232 bool Block::GetRangeContainingOffset(const addr_t offset, Range &range) {
242 bool Block::GetRangeContainingAddress(const Address &addr,
271 bool Block::GetRangeContainingLoadAddress(lldb::addr_t load_addr,
279 uint32_t Block::GetRangeIndexContainingAddress(const Address &addr) {
296 bool Block::GetRangeAtIndex(uint32_t range_idx, AddressRange &range) {
310 AddressRanges Block::GetRanges() {
326 bool Block::GetStartAddress(Address &addr) {
339 void Block::FinalizeRanges() {
344 void Block::AddRange(const Range &range) {
345 Block *parent_block = GetParent();
359 "warning: %s:%u block {0x%8.8" PRIx64
361 ") which is not contained in parent block {0x%8.8" PRIx64
369 "warning: block {0x%8.8" PRIx64 "} has range[%u] [0x%" PRIx64
371 ") which is not contained in parent block {0x%8.8" PRIx64
384 size_t Block::MemorySize() const {
385 size_t mem_size = sizeof(Block) + m_ranges.GetSize() * sizeof(Range);
393 BlockSP Block::CreateChild(user_id_t uid) {
394 m_children.push_back(std::shared_ptr<Block>(new Block(uid, *this)));
398 void Block::SetInlinedFunctionInfo(const char *name, const char *mangled,
405 VariableListSP Block::GetBlockVariableList(bool can_create) {
419 Block::AppendBlockVariables(bool can_create, bool get_child_block_variables,
437 Block *child_block = pos->get();
449 uint32_t Block::AppendVariables(bool can_create, bool get_parent_variables,
471 Block *parent_block = GetParent();
480 SymbolFile *Block::GetSymbolFile() {
486 CompilerDeclContext Block::GetDeclContext() {
492 void Block::SetBlockInfoHasBeenParsed(bool b, bool set_children) {
502 void Block::SetDidParseVariables(bool b, bool set_children) {
511 Block *Block::GetSibling() const {
512 if (Block *parent_block = GetParent())
517 // A parent of child blocks can be asked to find a sibling block given
519 Block *Block::GetSiblingForChild(const Block *child_block) const {