Advertisement
Guest User

FPC issue #13518 patch for FPC 2.6

a guest
Mar 4th, 2012
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 3.42 KB | None | 0 0
  1. Index: rtl/inc/lineinfo.pp
  2. ===================================================================
  3. --- rtl/inc/lineinfo.pp (revision 20463)
  4. +++ rtl/inc/lineinfo.pp (working copy)
  5. @@ -59,7 +59,6 @@
  6.  {$WARNING This code is not thread-safe, and needs improvement }  
  7.  var
  8.    e          : TExeFile;
  9. -  staberr    : boolean;
  10.    stabcnt,              { amount of stabs }
  11.    stablen,
  12.    stabofs,              { absolute stab section offset in executable }
  13. @@ -80,8 +79,6 @@
  14.      baseaddr : pointer;
  15.  begin
  16.    OpenStabs:=false;
  17. -  if staberr then
  18. -    exit;
  19.  
  20.    GetModuleByAddr(addr,baseaddr,filename);
  21.  {$ifdef DEBUG_LINEINFO}
  22. @@ -111,7 +108,7 @@
  23.      end
  24.    else
  25.      begin
  26. -      staberr:=true;
  27. +      CloseExeFile(e);
  28.        exit;
  29.      end;
  30.  end;
  31. @@ -138,8 +135,6 @@
  32.    fillchar(func,high(func)+1,0);
  33.    fillchar(source,high(source)+1,0);
  34.    line:=0;
  35. -  if staberr then
  36. -    exit;
  37.    if not e.isopen then
  38.     begin
  39.       if not OpenStabs(pointer(addr)) then
  40. @@ -265,16 +260,14 @@
  41.    hs     : string[32];
  42.    line   : longint;
  43.    Store  : TBackTraceStrFunc;
  44. -  Success : boolean;
  45.  begin
  46.  {$ifdef DEBUG_LINEINFO}
  47.    writeln(stderr,'StabBackTraceStr called');
  48.  {$endif DEBUG_LINEINFO}
  49.    { reset to prevent infinite recursion if problems inside the code PM }
  50. -  Success:=false;
  51.    Store:=BackTraceStrFunc;
  52.    BackTraceStrFunc:=@SysBackTraceStr;
  53. -  Success:=GetLineInfo(ptruint(addr),func,source,line);
  54. +  GetLineInfo(ptruint(addr),func,source,line);
  55.  { create string }
  56.  {$ifdef netware}
  57.    { we need addr relative to code start on netware }
  58. @@ -296,8 +289,7 @@
  59.        end;
  60.       StabBackTraceStr:=StabBackTraceStr+' of '+source;
  61.     end;
  62. -  if Success then
  63. -    BackTraceStrFunc:=Store;
  64. +  BackTraceStrFunc:=Store;
  65.  end;
  66.  
  67.  
  68. Index: rtl/inc/lnfodwrf.pp
  69. ===================================================================
  70. --- rtl/inc/lnfodwrf.pp (revision 20463)
  71. +++ rtl/inc/lnfodwrf.pp (working copy)
  72. @@ -61,7 +61,6 @@
  73.    e : TExeFile;
  74.    EBuf: Array [0..EBUF_SIZE-1] of Byte;
  75.    EBufCnt, EBufPos: Integer;
  76. -  DwarfErr : boolean;
  77.    { the offset and size of the DWARF debug_line section in the file }
  78.    DwarfOffset : longint;
  79.    DwarfSize : longint;
  80. @@ -141,8 +140,6 @@
  81.  function Opendwarf(addr : pointer) : boolean;
  82.  begin
  83.    Opendwarf:=false;
  84. -  if dwarferr then
  85. -    exit;
  86.  
  87.    GetModuleByAddr(addr,baseaddr,filename);
  88.  {$ifdef DEBUG_LINEINFO}
  89. @@ -164,7 +161,7 @@
  90.      Opendwarf:=true
  91.    else
  92.      begin
  93. -      dwarferr:=true;
  94. +      CloseExeFile(e);
  95.        exit;
  96.      end;
  97.  end;
  98. @@ -727,8 +724,6 @@
  99.    source := '';
  100.    found := false;
  101.    GetLineInfo:=false;
  102. -  if DwarfErr then
  103. -    exit;
  104.    if not e.isopen then
  105.     begin
  106.       if not OpenDwarf(pointer(addr)) then
  107. @@ -758,13 +753,11 @@
  108.    hs     : string[32];
  109.    line   : longint;
  110.    Store  : TBackTraceStrFunc;
  111. -  Success : boolean;
  112.  begin
  113.    { reset to prevent infinite recursion if problems inside the code }
  114. -  Success:=false;
  115.    Store := BackTraceStrFunc;
  116.    BackTraceStrFunc := @SysBackTraceStr;
  117. -  Success:=GetLineInfo(ptruint(addr), func, source, line);
  118. +  GetLineInfo(ptruint(addr), func, source, line);
  119.    { create string }
  120.    DwarfBackTraceStr :='  $' + HexStr(ptruint(addr), sizeof(ptruint) * 2);
  121.    if func<>'' then
  122. @@ -779,8 +772,7 @@
  123.      end;
  124.      DwarfBackTraceStr := DwarfBackTraceStr + ' of ' + source;
  125.    end;
  126. -  if Success then
  127. -    BackTraceStrFunc := Store;
  128. +  BackTraceStrFunc := Store;
  129.  end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement