Add the needed binary search to find line numbers.
This commit is contained in:
parent
b0880daaa3
commit
8ef5e2f810
|
@ -180,6 +180,12 @@ debuginfo_eip(uintptr_t addr, struct Eipdebuginfo *info)
|
||||||
// Look at the STABS documentation and <inc/stab.h> to find
|
// Look at the STABS documentation and <inc/stab.h> to find
|
||||||
// which one.
|
// which one.
|
||||||
// Your code here.
|
// Your code here.
|
||||||
|
stab_binsearch(stabs, &lline, &rline, N_SLINE, addr);
|
||||||
|
if(lline <= rline) {
|
||||||
|
info->eip_line = stabs[lline].n_desc;
|
||||||
|
} else {
|
||||||
|
info->eip_line = -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Search backwards from the line number for the relevant filename
|
// Search backwards from the line number for the relevant filename
|
||||||
|
|
Loading…
Reference in New Issue
Block a user