Browse Source

* DWARF line info: only use the cached module if the base address also is the same; this can happen if the initial exception occurred at a random address outside the module, but the next stack address can be found inside the correct module

Sven/Sarah Barth 8 months ago
parent
commit
40f90b60eb
1 changed files with 5 additions and 1 deletions
  1. 5 1
      rtl/inc/lnfodwrf.pp

+ 5 - 1
rtl/inc/lnfodwrf.pp

@@ -239,6 +239,7 @@ type
 
 
 var
 var
   lastfilename: string;   { store last processed file }
   lastfilename: string;   { store last processed file }
+  lastbaseaddr: {$ifdef cpui8086}farpointer{$else}pointer{$endif};  { store last base address }
   lastopendwarf: Boolean; { store last result of processing a file }
   lastopendwarf: Boolean; { store last result of processing a file }
 
 
 {$ifdef cpui8086}
 {$ifdef cpui8086}
@@ -284,7 +285,7 @@ begin
     exit;
     exit;
 
 
   // If target filename same as previous, then re-use previous result
   // If target filename same as previous, then re-use previous result
-  if AllowReuseOfLineInfoData and (filename = lastfilename) then
+  if AllowReuseOfLineInfoData and (filename = lastfilename) and (baseaddr = lastbaseaddr) then
   begin
   begin
     {$ifdef DEBUG_LINEINFO}
     {$ifdef DEBUG_LINEINFO}
     writeln(stderr,'Reusing debug data');
     writeln(stderr,'Reusing debug data');
@@ -302,6 +303,9 @@ begin
   // Save newly processed filename
   // Save newly processed filename
   lastfilename := filename;
   lastfilename := filename;
 
 
+  // Save newly processed file's base address
+  lastbaseaddr := baseaddr;
+
   // Open exe file or debug link
   // Open exe file or debug link
   if not OpenExeFile(e,filename) then
   if not OpenExeFile(e,filename) then
     exit;
     exit;