diff options
| author | Greg Clayton <gclayton@apple.com> | 2010-09-02 21:44:10 +0000 |
|---|---|---|
| committer | Greg Clayton <gclayton@apple.com> | 2010-09-02 21:44:10 +0000 |
| commit | 6dadd508e7906cf994ee96806f4ec3f80a9c8a41 (patch) | |
| tree | 4df4e34c3d6590a936f140d03be3039980d30c38 /lldb/source/Symbol/Block.cpp | |
| parent | fd81cea70cd6c893bb590c9b288875d1d29b8401 (diff) | |
| download | bcm5719-llvm-6dadd508e7906cf994ee96806f4ec3f80a9c8a41.tar.gz bcm5719-llvm-6dadd508e7906cf994ee96806f4ec3f80a9c8a41.zip | |
Added a new bool parameter to many of the DumpStopContext() methods that
might dump file paths that allows the dumping of full paths or just the
basenames. Switched the stack frame dumping code to use just the basenames for
the files instead of the full path.
Modified the StackID class to no rely on needing the start PC for the current
function/symbol since we can use the SymbolContextScope to uniquely identify
that, unless there is no symbol context scope. In that case we can rely upon
the current PC value. This saves the StackID from having to calculate the
start PC when the StackFrame::GetStackID() accessor is called.
Also improved the StackID less than operator to correctly handle inlined stack
frames in the same stack.
llvm-svn: 112867
Diffstat (limited to 'lldb/source/Symbol/Block.cpp')
| -rw-r--r-- | lldb/source/Symbol/Block.cpp | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/lldb/source/Symbol/Block.cpp b/lldb/source/Symbol/Block.cpp index c0b9ac667e0..67b44901744 100644 --- a/lldb/source/Symbol/Block.cpp +++ b/lldb/source/Symbol/Block.cpp @@ -145,7 +145,7 @@ Block::CalculateSymbolContext (SymbolContext* sc) } void -Block::DumpStopContext (Stream *s, const SymbolContext *sc) +Block::DumpStopContext (Stream *s, const SymbolContext *sc, bool show_fullpaths) { Block* parent_block = GetParent(); @@ -170,7 +170,7 @@ Block::DumpStopContext (Stream *s, const SymbolContext *sc) if (call_site.IsValid()) { s->PutCString(" at "); - call_site.DumpStopContext (s); + call_site.DumpStopContext (s, show_fullpaths); } } } @@ -182,11 +182,11 @@ Block::DumpStopContext (Stream *s, const SymbolContext *sc) if (sc->line_entry.IsValid()) { s->PutCString(" at "); - sc->line_entry.DumpStopContext (s); + sc->line_entry.DumpStopContext (s, show_fullpaths); } } if (parent_block) - parent_block->Block::DumpStopContext (s, NULL); + parent_block->Block::DumpStopContext (s, NULL, show_fullpaths); } @@ -207,6 +207,24 @@ Block::Contains (addr_t range_offset) const } bool +Block::Contains (const Block *block) const +{ + // Block objects can't contain themselves... + if (this == block) + return false; + + const Block *block_parent; + for (block_parent = block->GetParent(); + block_parent != NULL; + block_parent = block_parent->GetParent()) + { + if (block_parent == block) + return true; + } + return false; +} + +bool Block::Contains (const VMRange& range) const { return VMRange::ContainsRange(m_ranges, range); |

