@@ -276,9 +276,6 @@ impl Symbolizer {
276
276
line_number : None ,
277
277
} ;
278
278
279
- // For return addresses in stack traces, we usually want to subtract 1
280
- // to get the actual call site rather than the return address
281
- // let lookup_address = if address > 0 { address - 1 } else { address };
282
279
let lookup_address = address;
283
280
284
281
// Try to find which library this address belongs to
@@ -295,7 +292,7 @@ impl Symbolizer {
295
292
if let Some ( lib_info) = self . libraries . get ( & pathname) {
296
293
// Adjust address relative to library base (file start, not executable segment)
297
294
if let Some ( adr) = self . file_base_addresses . get ( & pathname) {
298
- let relative_address = lookup_address - adr;
295
+ let relative_address = address - adr;
299
296
300
297
// Try with loader first if available
301
298
if let Some ( ref loader) = lib_info. loader {
@@ -312,7 +309,7 @@ impl Symbolizer {
312
309
}
313
310
314
311
// Fall back to symbol table lookup
315
- if let Some ( symbol) = find_symbol_for_address ( & lib_info. symbols , relative_address ) {
312
+ if let Some ( symbol) = find_symbol_for_address ( & lib_info. symbols , address ) {
316
313
result. function_name = Some ( symbol. name . clone ( ) ) ;
317
314
return result;
318
315
}
@@ -329,20 +326,19 @@ impl Symbolizer {
329
326
// Look for a mapping that contains this address but isn't a library
330
327
let main_relative_address = if let Some ( main_mapping) = self . find_library_for_address ( address) {
331
328
if let Some ( & main_exe_base) = self . file_base_addresses . get ( & main_mapping. pathname ) {
332
- lookup_address - main_exe_base
329
+ address - main_exe_base
333
330
} else {
334
- lookup_address
331
+ address
335
332
}
336
333
} else {
337
- lookup_address
334
+ address
338
335
} ;
339
336
340
337
if let Some ( symbolized) = self . try_symbolize_with_context ( & self . main_context , main_relative_address, address) {
341
338
return symbolized;
342
339
}
343
340
344
341
// Fall back to symbol table lookup for main executable
345
- //if let Some(symbol) = find_symbol_for_address(&self.symbols, main_relative_address) {
346
342
if let Some ( symbol) = find_symbol_for_address ( & self . symbols , address) {
347
343
result. function_name = Some ( symbol. name . clone ( ) ) ;
348
344
return result;
0 commit comments