@@ -1971,8 +1971,6 @@ uint32_t SymbolFileDWARF::ResolveSymbolContext(
1971
1971
const SourceLocationSpec &src_location_spec,
1972
1972
SymbolContextItem resolve_scope, SymbolContextList &sc_list) {
1973
1973
std::lock_guard<std::recursive_mutex> guard (GetModuleMutex ());
1974
- const FileSpec &file_spec = src_location_spec.GetFileSpec ();
1975
- const uint32_t line = src_location_spec.GetLine ().getValueOr (0 );
1976
1974
const bool check_inlines = src_location_spec.GetCheckInlines ();
1977
1975
const uint32_t prev_size = sc_list.GetSize ();
1978
1976
if (resolve_scope & eSymbolContextCompUnit) {
@@ -1985,72 +1983,7 @@ uint32_t SymbolFileDWARF::ResolveSymbolContext(
1985
1983
bool file_spec_matches_cu_file_spec = FileSpec::Match (
1986
1984
src_location_spec.GetFileSpec (), dc_cu->GetPrimaryFile ());
1987
1985
if (check_inlines || file_spec_matches_cu_file_spec) {
1988
- SymbolContext sc (m_objfile_sp->GetModule ());
1989
- sc.comp_unit = dc_cu;
1990
- uint32_t file_idx = UINT32_MAX;
1991
-
1992
- // If we are looking for inline functions only and we don't find it
1993
- // in the support files, we are done.
1994
- if (check_inlines) {
1995
- file_idx =
1996
- sc.comp_unit ->GetSupportFiles ().FindFileIndex (1 , file_spec, true );
1997
- if (file_idx == UINT32_MAX)
1998
- continue ;
1999
- }
2000
-
2001
- if (line != 0 ) {
2002
- LineTable *line_table = sc.comp_unit ->GetLineTable ();
2003
-
2004
- if (line_table != nullptr && line != 0 ) {
2005
- // We will have already looked up the file index if we are
2006
- // searching for inline entries.
2007
- if (!check_inlines)
2008
- file_idx = sc.comp_unit ->GetSupportFiles ().FindFileIndex (
2009
- 1 , file_spec, true );
2010
-
2011
- if (file_idx != UINT32_MAX) {
2012
- uint32_t found_line;
2013
- uint16_t found_column;
2014
- uint32_t line_idx = line_table->FindLineEntryIndexByFileIndex (
2015
- 0 , file_idx, src_location_spec, &sc.line_entry );
2016
- found_line = sc.line_entry .line ;
2017
- found_column = sc.line_entry .column ;
2018
-
2019
- while (line_idx != UINT32_MAX) {
2020
- sc.function = nullptr ;
2021
- sc.block = nullptr ;
2022
- if (resolve_scope &
2023
- (eSymbolContextFunction | eSymbolContextBlock)) {
2024
- const lldb::addr_t file_vm_addr =
2025
- sc.line_entry .range .GetBaseAddress ().GetFileAddress ();
2026
- if (file_vm_addr != LLDB_INVALID_ADDRESS) {
2027
- ResolveFunctionAndBlock (
2028
- file_vm_addr, resolve_scope & eSymbolContextBlock, sc);
2029
- }
2030
- }
2031
-
2032
- SourceLocationSpec found_location_spec (
2033
- file_spec, found_line, found_column,
2034
- /* check_inlines=*/ false , /* exact=*/ true );
2035
- sc_list.Append (sc);
2036
- line_idx = line_table->FindLineEntryIndexByFileIndex (
2037
- line_idx + 1 , file_idx, found_location_spec,
2038
- &sc.line_entry );
2039
- }
2040
- }
2041
- } else if (file_spec_matches_cu_file_spec && !check_inlines) {
2042
- // only append the context if we aren't looking for inline call
2043
- // sites by file and line and if the file spec matches that of
2044
- // the compile unit
2045
- sc_list.Append (sc);
2046
- }
2047
- } else if (file_spec_matches_cu_file_spec && !check_inlines) {
2048
- // only append the context if we aren't looking for inline call
2049
- // sites by file and line and if the file spec matches that of
2050
- // the compile unit
2051
- sc_list.Append (sc);
2052
- }
2053
-
1986
+ dc_cu->ResolveSymbolContext (src_location_spec, resolve_scope, sc_list);
2054
1987
if (!check_inlines)
2055
1988
break ;
2056
1989
}
0 commit comments