mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-25 18:05:33 +02:00
The address may no line with the debug information.
This commit is contained in:
parent
8ceec2dbb8
commit
71be7c5a75
1 changed files with 10 additions and 2 deletions
|
@ -303,8 +303,16 @@ public class Elf {
|
|||
if ( line == null ) {
|
||||
if ( addr2line == null )
|
||||
addr2line = new Addr2line(file);
|
||||
line = addr2line.getLine(st_value + 19);
|
||||
func = addr2line.getFunction(st_value + 19);
|
||||
long value = st_value;
|
||||
// We try to get the nearest match
|
||||
// since the symbol may not quite align with debug info.
|
||||
for (int i = 0; i <= 20; i += 4, value += i) {
|
||||
line = addr2line.getLine(value);
|
||||
if (!line.startsWith("??")) {
|
||||
break; // bail out
|
||||
}
|
||||
}
|
||||
func = addr2line.getFunction(value);
|
||||
}
|
||||
return line;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue