mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-23 04:42:32 +00:00
better line search algorithm (not perfect yet, though)
This commit is contained in:
parent
5c3892cbb2
commit
38d5c8c41a
1 changed files with 11 additions and 5 deletions
|
@ -324,8 +324,9 @@ PR_Get_Source_Line (progs_t *pr, unsigned int addr)
|
|||
unsigned int line;
|
||||
file_t *file;
|
||||
pr_auxfunction_t *func;
|
||||
|
||||
pr_lineno_t *lineno = PR_Find_Lineno (pr, addr);
|
||||
pr_lineno_t *lineno;
|
||||
|
||||
lineno = PR_Find_Lineno (pr, addr);
|
||||
if (!lineno || PR_Get_Lineno_Addr (pr, lineno) != addr)
|
||||
return 0;
|
||||
func = PR_Get_Lineno_Func (pr, lineno);
|
||||
|
@ -374,10 +375,15 @@ void
|
|||
PR_DumpState (progs_t *pr)
|
||||
{
|
||||
if (pr_debug->int_val && pr->debug) {
|
||||
int addr = pr->pr_xstatement;
|
||||
pr_lineno_t *lineno;
|
||||
int addr = pr->pr_xstatement;
|
||||
|
||||
lineno = PR_Find_Lineno (pr, addr);
|
||||
if (lineno
|
||||
&& PR_Get_Lineno_Func (pr, lineno)
|
||||
&& PR_Get_Source_File (pr, lineno))
|
||||
addr =PR_Get_Lineno_Addr (pr, lineno);
|
||||
|
||||
while (!PR_Get_Source_Line (pr, addr))
|
||||
addr--;
|
||||
while (addr != pr->pr_xstatement)
|
||||
PR_PrintStatement (pr, pr->pr_statements + addr++);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue