From 8ef5e2f810a0363e5ee3217982d6faa629f33862 Mon Sep 17 00:00:00 2001 From: Danila Fedorin Date: Thu, 4 Apr 2019 20:37:40 -0700 Subject: [PATCH] Add the needed binary search to find line numbers. --- kern/kdebug.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/kern/kdebug.c b/kern/kdebug.c index b66ab45..cc59033 100644 --- a/kern/kdebug.c +++ b/kern/kdebug.c @@ -180,6 +180,12 @@ debuginfo_eip(uintptr_t addr, struct Eipdebuginfo *info) // Look at the STABS documentation and to find // which one. // 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