diff options
Diffstat (limited to 'source/Breakpoint')
-rw-r--r-- | source/Breakpoint/Breakpoint.cpp | 11 | ||||
-rw-r--r-- | source/Breakpoint/BreakpointLocation.cpp | 43 | ||||
-rw-r--r-- | source/Breakpoint/BreakpointLocationList.cpp | 10 | ||||
-rw-r--r-- | source/Breakpoint/BreakpointResolverName.cpp | 6 |
4 files changed, 60 insertions, 10 deletions
diff --git a/source/Breakpoint/Breakpoint.cpp b/source/Breakpoint/Breakpoint.cpp index 32c0b1066f8ef..5ce064fc41a02 100644 --- a/source/Breakpoint/Breakpoint.cpp +++ b/source/Breakpoint/Breakpoint.cpp @@ -45,14 +45,19 @@ Breakpoint::GetEventIdentifier () //---------------------------------------------------------------------- // Breakpoint constructor //---------------------------------------------------------------------- -Breakpoint::Breakpoint(Target &target, SearchFilterSP &filter_sp, BreakpointResolverSP &resolver_sp, bool hardware) : +Breakpoint::Breakpoint(Target &target, + SearchFilterSP &filter_sp, + BreakpointResolverSP &resolver_sp, + bool hardware, + bool resolve_indirect_symbols) : m_being_created(true), m_hardware(hardware), m_target (target), m_filter_sp (filter_sp), m_resolver_sp (resolver_sp), m_options (), - m_locations (*this) + m_locations (*this), + m_resolve_indirect_symbols(resolve_indirect_symbols) { m_being_created = false; } @@ -87,7 +92,7 @@ Breakpoint::GetTarget () const BreakpointLocationSP Breakpoint::AddLocation (const Address &addr, bool *new_location) { - return m_locations.AddLocation (addr, new_location); + return m_locations.AddLocation (addr, m_resolve_indirect_symbols, new_location); } BreakpointLocationSP diff --git a/source/Breakpoint/BreakpointLocation.cpp b/source/Breakpoint/BreakpointLocation.cpp index 5009e862d84bb..2c75a11e97884 100644 --- a/source/Breakpoint/BreakpointLocation.cpp +++ b/source/Breakpoint/BreakpointLocation.cpp @@ -39,16 +39,29 @@ BreakpointLocation::BreakpointLocation Breakpoint &owner, const Address &addr, lldb::tid_t tid, - bool hardware + bool hardware, + bool check_for_resolver ) : StoppointLocation (loc_id, addr.GetOpcodeLoadAddress(&owner.GetTarget()), hardware), m_being_created(true), + m_should_resolve_indirect_functions (false), + m_is_reexported (false), + m_is_indirect (false), m_address (addr), m_owner (owner), m_options_ap (), m_bp_site_sp (), m_condition_mutex () { + if (check_for_resolver) + { + Symbol *symbol = m_address.CalculateSymbolContextSymbol(); + if (symbol && symbol->IsIndirect()) + { + SetShouldResolveIndirectFunctions (true); + } + } + SetThreadID (tid); m_being_created = false; } @@ -545,7 +558,10 @@ BreakpointLocation::GetDescription (Stream *s, lldb::DescriptionLevel level) if (level == lldb::eDescriptionLevelFull || level == eDescriptionLevelInitial) { - s->PutCString("where = "); + if (IsReExported()) + s->PutCString ("re-exported target = "); + else + s->PutCString("where = "); sc.DumpStopContext (s, m_owner.GetTarget().GetProcessSP().get(), m_address, false, true, false); } else @@ -584,7 +600,10 @@ BreakpointLocation::GetDescription (Stream *s, lldb::DescriptionLevel level) if (sc.symbol) { s->EOL(); - s->Indent("symbol = "); + if (IsReExported()) + s->Indent ("re-exported target = "); + else + s->Indent("symbol = "); s->PutCString(sc.symbol->GetMangled().GetName().AsCString("<unknown>")); } } @@ -612,6 +631,24 @@ BreakpointLocation::GetDescription (Stream *s, lldb::DescriptionLevel level) m_address.Dump(s, exe_scope, Address::DumpStyleLoadAddress, Address::DumpStyleFileAddress); else m_address.Dump(s, exe_scope, Address::DumpStyleLoadAddress, Address::DumpStyleModuleWithFileAddress); + + if (IsIndirect() && m_bp_site_sp) + { + Address resolved_address; + resolved_address.SetLoadAddress(m_bp_site_sp->GetLoadAddress(), target); + Symbol *resolved_symbol = resolved_address.CalculateSymbolContextSymbol(); + if (resolved_symbol) + { + if (level == eDescriptionLevelFull || level == eDescriptionLevelInitial) + s->Printf (", "); + else if (level == lldb::eDescriptionLevelVerbose) + { + s->EOL(); + s->Indent(); + } + s->Printf ("indirect target = %s", resolved_symbol->GetName().GetCString()); + } + } if (level == lldb::eDescriptionLevelVerbose) { diff --git a/source/Breakpoint/BreakpointLocationList.cpp b/source/Breakpoint/BreakpointLocationList.cpp index 18147deca3ec7..917c776e75d2b 100644 --- a/source/Breakpoint/BreakpointLocationList.cpp +++ b/source/Breakpoint/BreakpointLocationList.cpp @@ -19,8 +19,10 @@ #include "lldb/Core/ArchSpec.h" #include "lldb/Core/Module.h" #include "lldb/Core/Section.h" +#include "lldb/Target/SectionLoadList.h" #include "lldb/Target/Target.h" + using namespace lldb; using namespace lldb_private; @@ -39,12 +41,12 @@ BreakpointLocationList::~BreakpointLocationList() } BreakpointLocationSP -BreakpointLocationList::Create (const Address &addr) +BreakpointLocationList::Create (const Address &addr, bool resolve_indirect_symbols) { Mutex::Locker locker (m_mutex); // The location ID is just the size of the location list + 1 lldb::break_id_t bp_loc_id = ++m_next_id; - BreakpointLocationSP bp_loc_sp (new BreakpointLocation (bp_loc_id, m_owner, addr, LLDB_INVALID_THREAD_ID, m_owner.IsHardware())); + BreakpointLocationSP bp_loc_sp (new BreakpointLocation (bp_loc_id, m_owner, addr, LLDB_INVALID_THREAD_ID, m_owner.IsHardware(), resolve_indirect_symbols)); m_locations.push_back (bp_loc_sp); m_address_to_location[addr] = bp_loc_sp; return bp_loc_sp; @@ -245,7 +247,7 @@ BreakpointLocationList::GetDescription (Stream *s, lldb::DescriptionLevel level) } BreakpointLocationSP -BreakpointLocationList::AddLocation (const Address &addr, bool *new_location) +BreakpointLocationList::AddLocation (const Address &addr, bool resolve_indirect_symbols, bool *new_location) { Mutex::Locker locker (m_mutex); @@ -254,7 +256,7 @@ BreakpointLocationList::AddLocation (const Address &addr, bool *new_location) BreakpointLocationSP bp_loc_sp (FindByAddress(addr)); if (!bp_loc_sp) { - bp_loc_sp = Create (addr); + bp_loc_sp = Create (addr, resolve_indirect_symbols); if (bp_loc_sp) { bp_loc_sp->ResolveBreakpointSite(); diff --git a/source/Breakpoint/BreakpointResolverName.cpp b/source/Breakpoint/BreakpointResolverName.cpp index c82dd5ee050b6..cf5d89cb7a8be 100644 --- a/source/Breakpoint/BreakpointResolverName.cpp +++ b/source/Breakpoint/BreakpointResolverName.cpp @@ -272,6 +272,8 @@ BreakpointResolverName::SearchCallback { if (func_list.GetContextAtIndex(i, sc)) { + bool is_reexported = false; + if (sc.block && sc.block->GetInlinedFunctionInfo()) { if (!sc.block->GetStartAddress(break_addr)) @@ -293,7 +295,10 @@ BreakpointResolverName::SearchCallback { const Symbol *actual_symbol = sc.symbol->ResolveReExportedSymbol(m_breakpoint->GetTarget()); if (actual_symbol) + { + is_reexported = true; break_addr = actual_symbol->GetAddress(); + } } else { @@ -313,6 +318,7 @@ BreakpointResolverName::SearchCallback if (filter.AddressPasses(break_addr)) { BreakpointLocationSP bp_loc_sp (m_breakpoint->AddLocation(break_addr, &new_location)); + bp_loc_sp->SetIsReExported(is_reexported); if (bp_loc_sp && new_location && !m_breakpoint->IsInternal()) { if (log) |