diff options
Diffstat (limited to 'source/Breakpoint/BreakpointResolver.cpp')
-rw-r--r-- | source/Breakpoint/BreakpointResolver.cpp | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/source/Breakpoint/BreakpointResolver.cpp b/source/Breakpoint/BreakpointResolver.cpp index f02eadf86a7c..e757b388550f 100644 --- a/source/Breakpoint/BreakpointResolver.cpp +++ b/source/Breakpoint/BreakpointResolver.cpp @@ -32,8 +32,9 @@ using namespace lldb; //---------------------------------------------------------------------- // BreakpointResolver: //---------------------------------------------------------------------- -BreakpointResolver::BreakpointResolver (Breakpoint *bkpt, const unsigned char resolverTy) : +BreakpointResolver::BreakpointResolver (Breakpoint *bkpt, const unsigned char resolverTy, lldb::addr_t offset) : m_breakpoint (bkpt), + m_offset(offset), SubclassID (resolverTy) { } @@ -74,6 +75,7 @@ BreakpointResolver::SetSCMatchesByLine (SearchFilter &filter, SymbolContextList bool first_entry = true; FileSpec match_file_spec; + FileSpec match_original_file_spec; uint32_t closest_line_number = UINT32_MAX; // Pull out the first entry, and all the others that match its file spec, and stuff them in the tmp list. @@ -85,11 +87,13 @@ BreakpointResolver::SetSCMatchesByLine (SearchFilter &filter, SymbolContextList if (first_entry) { match_file_spec = sc.line_entry.file; + match_original_file_spec = sc.line_entry.original_file; matches = true; first_entry = false; } else - matches = (sc.line_entry.file == match_file_spec); + matches = ((sc.line_entry.file == match_file_spec) || + (sc.line_entry.original_file == match_original_file_spec)); if (matches) { @@ -176,7 +180,7 @@ BreakpointResolver::SetSCMatchesByLine (SearchFilter &filter, SymbolContextList } } - BreakpointLocationSP bp_loc_sp (m_breakpoint->AddLocation(line_start)); + BreakpointLocationSP bp_loc_sp (AddLocation(line_start)); if (log && bp_loc_sp && !m_breakpoint->IsInternal()) { StreamString s; @@ -202,3 +206,22 @@ BreakpointResolver::SetSCMatchesByLine (SearchFilter &filter, SymbolContextList } } } + +BreakpointLocationSP +BreakpointResolver::AddLocation(Address loc_addr, bool *new_location) +{ + loc_addr.Slide(m_offset); + return m_breakpoint->AddLocation(loc_addr, new_location); +} + + +void +BreakpointResolver::SetOffset (lldb::addr_t offset) +{ + // There may already be an offset, so we are actually adjusting location addresses by the difference. + // lldb::addr_t slide = offset - m_offset; + // FIXME: We should go fix up all the already set locations for the new slide. + + m_offset = offset; +} + |