Browse Source

* StabOfs for OS2 changed, hopefully correct now

pierre 25 years ago
parent
commit
72c8dbfa43
1 changed files with 16 additions and 4 deletions
  1. 16 4
      rtl/inc/lineinfo.pp

+ 16 - 4
rtl/inc/lineinfo.pp

@@ -320,10 +320,19 @@ begin
   begin
   begin
    Seek (F, EmxHeader.AoutOfs);
    Seek (F, EmxHeader.AoutOfs);
    BlockRead (F, AoutHeader, SizeOf (TAoutHeader));
    BlockRead (F, AoutHeader, SizeOf (TAoutHeader));
-   StabOfs := (Succ (EmxHeader.AoutOfs div StartPageSize)) * StartPageSize
-                               + AoutHeader.TextSize + AoutHeader.DataSize + 4;
+
+   if AOutHeader.Magic=$10B then
+     StabOfs :=   StartPageSize
+   else
+     StabOfs :=EmxHeader.AoutOfs + SizeOf (TAoutHeader);
+   StabOfs :=   StabOfs
+                + AoutHeader.TextSize
+                + AoutHeader.DataSize
+                + AoutHeader.TextRelocSize
+                + AoutHeader.DataRelocSize;
 (* I don't really know, where this "+ 4" comes from, *)
 (* I don't really know, where this "+ 4" comes from, *)
 (* but it seems to be correct. :-) - TH              *)
 (* but it seems to be correct. :-) - TH              *)
+(* Maybe not PM                                      *)
    StabCnt := AoutHeader.SymbSize div SizeOf (TStab);
    StabCnt := AoutHeader.SymbSize div SizeOf (TStab);
    StabStrOfs := StabOfs + AoutHeader.SymbSize;
    StabStrOfs := StabOfs + AoutHeader.SymbSize;
    StabsFunctionRelative:=false;
    StabsFunctionRelative:=false;
@@ -629,7 +638,10 @@ finalization
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.10  2000-05-08 13:23:46  peter
+  Revision 1.11  2000-06-05 13:04:11  pierre
+   * StabOfs for OS2 changed, hopefully correct now
+
+  Revision 1.10  2000/05/08 13:23:46  peter
     * export function so ppl can use it in their own programs
     * export function so ppl can use it in their own programs
 
 
   Revision 1.9  2000/04/20 13:03:41  pierre
   Revision 1.9  2000/04/20 13:03:41  pierre
@@ -659,4 +671,4 @@ end.
   Revision 1.1  2000/02/06 17:19:22  peter
   Revision 1.1  2000/02/06 17:19:22  peter
     * lineinfo unit added which uses stabs to get lineinfo for backtraces
     * lineinfo unit added which uses stabs to get lineinfo for backtraces
 
 
-}
+}