@@ -759,9 +759,8 @@ bool SymbolContext::GetAddressRangeFromHereToEndLine(uint32_t end_line,
759
759
}
760
760
761
761
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) {
765
764
error.SetErrorStringWithFormat (
766
765
" end line number %d is not contained within the current function." ,
767
766
end_line);
@@ -774,8 +773,8 @@ bool SymbolContext::GetAddressRangeFromHereToEndLine(uint32_t end_line,
774
773
return true ;
775
774
}
776
775
777
- const Symbol *
778
- SymbolContext::FindBestGlobalDataSymbol (ConstString name, Status &error) {
776
+ const Symbol *SymbolContext::FindBestGlobalDataSymbol (ConstString name,
777
+ Status &error) {
779
778
error.Clear ();
780
779
781
780
if (!target_sp) {
@@ -785,8 +784,9 @@ SymbolContext::FindBestGlobalDataSymbol(ConstString name, Status &error) {
785
784
Target &target = *target_sp;
786
785
Module *module = module_sp.get ();
787
786
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 * {
790
790
llvm::SmallVector<const Symbol *, 1 > external_symbols;
791
791
llvm::SmallVector<const Symbol *, 1 > internal_symbols;
792
792
const uint32_t matches = sc_list.GetSize ();
@@ -799,77 +799,77 @@ SymbolContext::FindBestGlobalDataSymbol(ConstString name, Status &error) {
799
799
800
800
if (sym_address.IsValid ()) {
801
801
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 =
836
830
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);
838
837
}
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);
847
838
}
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 ;
873
873
}
874
874
}
875
875
}
@@ -930,7 +930,6 @@ SymbolContext::FindBestGlobalDataSymbol(ConstString name, Status &error) {
930
930
return nullptr ; // no error; we just didn't find anything
931
931
}
932
932
933
-
934
933
//
935
934
// SymbolContextSpecifier
936
935
//
@@ -1293,6 +1292,8 @@ bool SymbolContextList::RemoveContextAtIndex(size_t idx) {
1293
1292
1294
1293
uint32_t SymbolContextList::GetSize () const { return m_symbol_contexts.size (); }
1295
1294
1295
+ bool SymbolContextList::IsEmpty () const { return m_symbol_contexts.empty (); }
1296
+
1296
1297
uint32_t SymbolContextList::NumLineEntriesWithLine (uint32_t line) const {
1297
1298
uint32_t match_count = 0 ;
1298
1299
const size_t size = m_symbol_contexts.size ();
0 commit comments