@@ -759,9 +759,8 @@ bool SymbolContext::GetAddressRangeFromHereToEndLine(uint32_t end_line,
759759 }
760760
761761 Block *func_block = GetFunctionBlock ();
762- if (func_block &&
763- func_block->GetRangeIndexContainingAddress (
764- end_entry.range .GetBaseAddress ()) == UINT32_MAX) {
762+ if (func_block && func_block->GetRangeIndexContainingAddress (
763+ end_entry.range .GetBaseAddress ()) == UINT32_MAX) {
765764 error.SetErrorStringWithFormat (
766765 " end line number %d is not contained within the current function." ,
767766 end_line);
@@ -774,8 +773,8 @@ bool SymbolContext::GetAddressRangeFromHereToEndLine(uint32_t end_line,
774773 return true ;
775774}
776775
777- const Symbol *
778- SymbolContext::FindBestGlobalDataSymbol (ConstString name, Status &error) {
776+ const Symbol *SymbolContext::FindBestGlobalDataSymbol (ConstString name,
777+ Status &error) {
779778 error.Clear ();
780779
781780 if (!target_sp) {
@@ -785,8 +784,9 @@ SymbolContext::FindBestGlobalDataSymbol(ConstString name, Status &error) {
785784 Target &target = *target_sp;
786785 Module *module = module_sp.get ();
787786
788- auto ProcessMatches = [this , &name, &target, module ]
789- (SymbolContextList &sc_list, Status &error) -> const Symbol* {
787+ auto ProcessMatches = [this , &name, &target,
788+ module ](SymbolContextList &sc_list,
789+ Status &error) -> const Symbol * {
790790 llvm::SmallVector<const Symbol *, 1 > external_symbols;
791791 llvm::SmallVector<const Symbol *, 1 > internal_symbols;
792792 const uint32_t matches = sc_list.GetSize ();
@@ -799,77 +799,77 @@ SymbolContext::FindBestGlobalDataSymbol(ConstString name, Status &error) {
799799
800800 if (sym_address.IsValid ()) {
801801 switch (symbol->GetType ()) {
802- case eSymbolTypeData:
803- case eSymbolTypeRuntime:
804- case eSymbolTypeAbsolute:
805- case eSymbolTypeObjCClass:
806- case eSymbolTypeObjCMetaClass:
807- case eSymbolTypeObjCIVar:
808- if (symbol->GetDemangledNameIsSynthesized ()) {
809- // If the demangled name was synthesized, then don't use it for
810- // expressions. Only let the symbol match if the mangled named
811- // matches for these symbols.
812- if (symbol->GetMangled ().GetMangledName () != name)
813- break ;
814- }
815- if (symbol->IsExternal ()) {
816- external_symbols.push_back (symbol);
817- } else {
818- internal_symbols.push_back (symbol);
819- }
820- break ;
821- case eSymbolTypeReExported: {
822- ConstString reexport_name = symbol->GetReExportedSymbolName ();
823- if (reexport_name) {
824- ModuleSP reexport_module_sp;
825- ModuleSpec reexport_module_spec;
826- reexport_module_spec.GetPlatformFileSpec () =
827- symbol->GetReExportedSymbolSharedLibrary ();
828- if (reexport_module_spec.GetPlatformFileSpec ()) {
829- reexport_module_sp =
830- target.GetImages ().FindFirstModule (reexport_module_spec);
831- if (!reexport_module_sp) {
832- reexport_module_spec.GetPlatformFileSpec ()
833- .GetDirectory ()
834- .Clear ();
835- reexport_module_sp =
802+ case eSymbolTypeData:
803+ case eSymbolTypeRuntime:
804+ case eSymbolTypeAbsolute:
805+ case eSymbolTypeObjCClass:
806+ case eSymbolTypeObjCMetaClass:
807+ case eSymbolTypeObjCIVar:
808+ if (symbol->GetDemangledNameIsSynthesized ()) {
809+ // If the demangled name was synthesized, then don't use it for
810+ // expressions. Only let the symbol match if the mangled named
811+ // matches for these symbols.
812+ if (symbol->GetMangled ().GetMangledName () != name)
813+ break ;
814+ }
815+ if (symbol->IsExternal ()) {
816+ external_symbols.push_back (symbol);
817+ } else {
818+ internal_symbols.push_back (symbol);
819+ }
820+ break ;
821+ case eSymbolTypeReExported: {
822+ ConstString reexport_name = symbol->GetReExportedSymbolName ();
823+ if (reexport_name) {
824+ ModuleSP reexport_module_sp;
825+ ModuleSpec reexport_module_spec;
826+ reexport_module_spec.GetPlatformFileSpec () =
827+ symbol->GetReExportedSymbolSharedLibrary ();
828+ if (reexport_module_spec.GetPlatformFileSpec ()) {
829+ reexport_module_sp =
836830 target.GetImages ().FindFirstModule (reexport_module_spec);
837- }
831+ if (!reexport_module_sp) {
832+ reexport_module_spec.GetPlatformFileSpec ()
833+ .GetDirectory ()
834+ .Clear ();
835+ reexport_module_sp =
836+ target.GetImages ().FindFirstModule (reexport_module_spec);
838837 }
839- // Don't allow us to try and resolve a re-exported symbol if it
840- // is the same as the current symbol
841- if (name == symbol->GetReExportedSymbolName () &&
842- module == reexport_module_sp.get ())
843- return nullptr ;
844-
845- return FindBestGlobalDataSymbol (
846- symbol->GetReExportedSymbolName (), error);
847838 }
848- } break ;
849-
850- case eSymbolTypeCode: // We already lookup functions elsewhere
851- case eSymbolTypeVariable:
852- case eSymbolTypeLocal:
853- case eSymbolTypeParam:
854- case eSymbolTypeTrampoline:
855- case eSymbolTypeInvalid:
856- case eSymbolTypeException:
857- case eSymbolTypeSourceFile:
858- case eSymbolTypeHeaderFile:
859- case eSymbolTypeObjectFile:
860- case eSymbolTypeCommonBlock:
861- case eSymbolTypeBlock:
862- case eSymbolTypeVariableType:
863- case eSymbolTypeLineEntry:
864- case eSymbolTypeLineHeader:
865- case eSymbolTypeScopeBegin:
866- case eSymbolTypeScopeEnd:
867- case eSymbolTypeAdditional:
868- case eSymbolTypeCompiler:
869- case eSymbolTypeInstrumentation:
870- case eSymbolTypeUndefined:
871- case eSymbolTypeResolver:
872- break ;
839+ // Don't allow us to try and resolve a re-exported symbol if it
840+ // is the same as the current symbol
841+ if (name == symbol->GetReExportedSymbolName () &&
842+ module == reexport_module_sp.get ())
843+ return nullptr ;
844+
845+ return FindBestGlobalDataSymbol (symbol->GetReExportedSymbolName (),
846+ error);
847+ }
848+ } break ;
849+
850+ case eSymbolTypeCode: // We already lookup functions elsewhere
851+ case eSymbolTypeVariable:
852+ case eSymbolTypeLocal:
853+ case eSymbolTypeParam:
854+ case eSymbolTypeTrampoline:
855+ case eSymbolTypeInvalid:
856+ case eSymbolTypeException:
857+ case eSymbolTypeSourceFile:
858+ case eSymbolTypeHeaderFile:
859+ case eSymbolTypeObjectFile:
860+ case eSymbolTypeCommonBlock:
861+ case eSymbolTypeBlock:
862+ case eSymbolTypeVariableType:
863+ case eSymbolTypeLineEntry:
864+ case eSymbolTypeLineHeader:
865+ case eSymbolTypeScopeBegin:
866+ case eSymbolTypeScopeEnd:
867+ case eSymbolTypeAdditional:
868+ case eSymbolTypeCompiler:
869+ case eSymbolTypeInstrumentation:
870+ case eSymbolTypeUndefined:
871+ case eSymbolTypeResolver:
872+ break ;
873873 }
874874 }
875875 }
@@ -930,7 +930,6 @@ SymbolContext::FindBestGlobalDataSymbol(ConstString name, Status &error) {
930930 return nullptr ; // no error; we just didn't find anything
931931}
932932
933-
934933//
935934// SymbolContextSpecifier
936935//
@@ -1293,6 +1292,8 @@ bool SymbolContextList::RemoveContextAtIndex(size_t idx) {
12931292
12941293uint32_t SymbolContextList::GetSize () const { return m_symbol_contexts.size (); }
12951294
1295+ bool SymbolContextList::IsEmpty () const { return m_symbol_contexts.empty (); }
1296+
12961297uint32_t SymbolContextList::NumLineEntriesWithLine (uint32_t line) const {
12971298 uint32_t match_count = 0 ;
12981299 const size_t size = m_symbol_contexts.size ();
0 commit comments