@@ -86,14 +86,13 @@ void DwflSymbolLookup::add_fun_loc(
8686 // line can be associated to parent
8787 const auto line_find = symbol_wrapper._line_map .find_closest (elf_pc);
8888 if (line_find.second ) {
89- line = line_find.first ->second .get_symbol_idx ();
89+ line = line_find.first ->second .get_value ();
9090 }
9191 }
92- func_locs.emplace_back (
93- FunLoc{._ip = process_pc,
94- ._lineno = line,
95- ._symbol_idx = parent_sym.second .get_symbol_idx (),
96- ._map_info_idx = -1 });
92+ func_locs.emplace_back (FunLoc{._ip = process_pc,
93+ ._lineno = line,
94+ ._symbol_idx = parent_sym.second .get_value (),
95+ ._map_info_idx = -1 });
9796}
9897
9998// Retrieve existing symbol or attempt to read from dwarf
@@ -117,14 +116,14 @@ void DwflSymbolLookup::get_or_insert(Dwfl *dwfl, const DDProfMod &ddprof_mod,
117116#ifdef DEBUG
118117 LG_DBG (" Match: %lx,%lx -> %s,%d" , find_res.first ->first ,
119118 find_res.first ->second .get_end (),
120- table[find_res.first ->second .get_symbol_idx ()]._symname .c_str (),
121- find_res.first ->second .get_symbol_idx ());
119+ table[find_res.first ->second .get_value ()]._symname .c_str (),
120+ find_res.first ->second .get_value ());
122121#endif
123122 // cache validation mechanism: force dwfl lookup to compare with matched
124123 // symbols
125124 if (_lookup_setting == K_CACHE_VALIDATE) {
126125 if (symbol_lookup_check (ddprof_mod._mod , process_pc,
127- table[find_res.first ->second .get_symbol_idx ()])) {
126+ table[find_res.first ->second .get_value ()])) {
128127 ++_stats._errors ;
129128 }
130129 }
@@ -160,7 +159,7 @@ static DDRes parse_lines(Dwarf_Die *cudie, const DDProfMod &mod,
160159 DwflSymbolLookup::SymbolWrapper &symbol_wrapper,
161160 SymbolTable &table, DieInformation &die_information) {
162161
163- DwflSymbolLookup:: LineMap &line_map = symbol_wrapper._line_map ;
162+ LineMap &line_map = symbol_wrapper._line_map ;
164163 DwflSymbolLookup::InlineMap &inline_map = symbol_wrapper._inline_map ;
165164 Dwarf_Lines *lines;
166165 size_t nlines;
@@ -184,7 +183,7 @@ static DDRes parse_lines(Dwarf_Die *cudie, const DDProfMod &mod,
184183 Dwarf_Addr previous_addr = 0 ;
185184 NestedSymbolMap::FindRes current_func{inline_map.end (), false };
186185 // store closest line per file (to avoid missmatches)
187- std::unordered_map<std::string, int > closest_lines;
186+ std::unordered_map<std::string, uint32_t > closest_lines;
188187 for (size_t line_index = start_index; line_index < nlines; ++line_index) {
189188 Dwarf_Line *line = dwarf_onesrcline (lines, line_index);
190189 Dwarf_Addr line_addr;
@@ -201,8 +200,7 @@ static DDRes parse_lines(Dwarf_Die *cudie, const DDProfMod &mod,
201200
202201 if (previous_addr && line_addr != previous_addr) {
203202 if (hint_line != line_map.end () &&
204- hint_line->second .get_symbol_idx () ==
205- closest_lines[ref_sym->_srcpath ]) {
203+ hint_line->second .get_value () == closest_lines[ref_sym->_srcpath ]) {
206204 // extend previous element
207205 hint_line->second .set_end (previous_addr);
208206 } else {
@@ -211,7 +209,7 @@ static DDRes parse_lines(Dwarf_Die *cudie, const DDProfMod &mod,
211209 hint_line,
212210 std::make_pair (
213211 previous_addr,
214- SymbolSpan {line_addr - 1 , closest_lines[ref_sym->_srcpath ]}));
212+ LineSpan {line_addr - 1 , closest_lines[ref_sym->_srcpath ]}));
215213 }
216214#ifdef DEBUG
217215 LG_DBG (" Associate %d (%lx->%lx) / %s to %s (vs %s)" ,
@@ -231,7 +229,7 @@ static DDRes parse_lines(Dwarf_Die *cudie, const DDProfMod &mod,
231229 }
232230 // keep line, if it matches the symbol
233231 // todo can be optimized to avoid conversion to string
234- closest_lines[std::string (current_file)] = lineno;
232+ closest_lines[std::string (current_file)] = static_cast < uint32_t >( lineno) ;
235233 previous_addr = line_addr;
236234 }
237235 return {};
@@ -242,7 +240,7 @@ DDRes DwflSymbolLookup::insert_inlining_info(
242240 ProcessAddress_t process_pc, const Dso &dso, SymbolWrapper &symbol_wrapper,
243241 SymbolMap::ValueType &parent_func) {
244242
245- SymbolIdx_t parent_sym_idx = parent_func.second .get_symbol_idx ();
243+ SymbolIdx_t parent_sym_idx = parent_func.second .get_value ();
246244 Dwarf_Addr bias;
247245 Dwarf_Die *cudie = dwfl_addrdie (dwfl, process_pc, &bias);
248246 if (!cudie) {
@@ -388,7 +386,7 @@ NestedSymbolMap::FindRes DwflSymbolLookup::get_inlined(
388386 } else {
389387 auto find_line = symbol_wrapper._line_map .find_closest (elf_pc);
390388 if (find_line.second ) {
391- line = find_line.first ->second .get_symbol_idx ();
389+ line = find_line.first ->second .get_value ();
392390 }
393391 }
394392 func_locs.emplace_back (
0 commit comments