From 2a0bf2b491bc5facd2fb90bcc15742c828e63274 Mon Sep 17 00:00:00 2001 From: peter Date: Fri, 2 Nov 2007 21:20:16 +0000 Subject: [PATCH] * return previous line that contains the call when we have found the address * append / to directory if needed git-svn-id: trunk@9067 - --- rtl/inc/lnfodwrf.pp | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/rtl/inc/lnfodwrf.pp b/rtl/inc/lnfodwrf.pp index 8ae6687c0b..7782e206af 100644 --- a/rtl/inc/lnfodwrf.pp +++ b/rtl/inc/lnfodwrf.pp @@ -664,7 +664,8 @@ begin if (directory = '') then break; inc(i); end; - + if (directory<>'') and (directory[length(directory)]<>'/') then + directory:=directory+'/'; GetFullFilename := directory + filename; end; @@ -881,18 +882,17 @@ begin break; first_row := false; end; - found := (state.address >= addr); - { use the previous line/file information if the current address is larger - than the requested address } - if (found) and (state.address > addr) then begin - state.line := prev_line; - state.file_id := prev_file; - end; - - { save old state information } - prev_file := state.file_id; - prev_line := state.line; + { when we have found the address we need to return the previous + line because that contains the call instruction } + if (state.address >= addr) then + found:=true + else + begin + { save line information } + prev_file := state.file_id; + prev_line := state.line; + end; state.append_row := false; if (state.end_sequence) then begin @@ -904,8 +904,8 @@ begin end; if (found) then begin - line := state.line; - source := GetFullFilename(file_names, include_directories, state.file_id); + line := prev_line; + source := GetFullFilename(file_names, include_directories, prev_file); end; end;