Skip to content

Commit 594fb63

Browse files
committed
Add a full parameter to Declaration::Equals since different code
paths need different behaviors.
1 parent 03764f2 commit 594fb63

File tree

5 files changed

+11
-6
lines changed

5 files changed

+11
-6
lines changed

lldb/include/lldb/Core/Declaration.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,15 @@ class Declaration {
8383
///
8484
/// \param[in] declaration
8585
/// The const Declaration object to compare with.
86+
///
87+
/// \param[in] full
88+
/// Same meaning as Full in FileSpec::Equal. True means an empty
89+
/// directory is not equal to a specified one, false means it is equal.
8690
///
8791
/// \return
8892
/// Returns \b true if \b declaration is at the same file and
8993
/// line, \b false otherwise.
90-
bool FileAndLineEqual(const Declaration &declaration) const;
94+
bool FileAndLineEqual(const Declaration &declaration, bool full) const;
9195

9296
/// Dump a description of this object to a Stream.
9397
///

lldb/source/Breakpoint/BreakpointSite.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ std::optional<uint32_t> BreakpointSite::GetSuggestedStackFrameIndex() {
9898
if (result)
9999
result = std::max(*loc_frame_index, *result);
100100
else
101-
result = this_result;
101+
result = loc_frame_index;
102102
}
103103
}
104104
return result;

lldb/source/Core/Declaration.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,9 @@ int Declaration::Compare(const Declaration &a, const Declaration &b) {
7070
return 0;
7171
}
7272

73-
bool Declaration::FileAndLineEqual(const Declaration &declaration) const {
74-
int file_compare = FileSpec::Compare(this->m_file, declaration.m_file, false);
73+
bool Declaration::FileAndLineEqual(const Declaration &declaration, bool full)
74+
const {
75+
int file_compare = FileSpec::Compare(this->m_file, declaration.m_file, full);
7576
return file_compare == 0 && this->m_line == declaration.m_line;
7677
}
7778

lldb/source/Symbol/Block.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ Block *Block::GetContainingInlinedBlockWithCallSite(
230230
const auto *function_info = inlined_block->GetInlinedFunctionInfo();
231231

232232
if (function_info &&
233-
function_info->GetCallSite().FileAndLineEqual(find_call_site))
233+
function_info->GetCallSite().FileAndLineEqual(find_call_site, true))
234234
return inlined_block;
235235
inlined_block = inlined_block->GetInlinedParent();
236236
}

lldb/source/Symbol/CompileUnit.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ void CompileUnit::ResolveSymbolContext(
360360
// it.
361361
Declaration found_decl = inline_info->GetCallSite();
362362
uint32_t sought_column = sought_decl.GetColumn();
363-
if (found_decl.FileAndLineEqual(sought_decl) &&
363+
if (found_decl.FileAndLineEqual(sought_decl, false) &&
364364
(sought_column == LLDB_INVALID_COLUMN_NUMBER ||
365365
sought_column == found_decl.GetColumn())) {
366366
// If we found a call site, it belongs not in this inlined block,

0 commit comments

Comments
 (0)