<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<font size="+1">Gentlemen,<br>
I'm a new poster to the mail list. I have a problem logging call
stack trace info following an exception.<br>
The following simple program generates a divide by zero error.<br>
<br>
PROGRAM Test;<br>
VAR i, j, k : Integer;<br>
PROCEDURE test1;<br>
BEGIN<br>
i := i - 1;<br>
k := j DIV i;<br>
END; {test}<br>
<br>
PROCEDURE test2;<br>
BEGIN<br>
test1;<br>
END; {taskProc}<br>
<br>
BEGIN<br>
i := 1; j := 1;<br>
test2;<br>
END.<br>
<br>
When compiled and run under Windows it generates the stack trace:<br>
Runtime error 200 at $00401404<br>
$00401404 TEST1, line 6 of test.pas<br>
$00401428 TEST2, line 11 of test.pas<br>
$00401451 main, line 16 of test.pas<br>
$004077D1<br>
<br>
Which is what you would expect. When compiled and run on an ARM
processor under Linux (Debian Jessie) it generates the stack
trace:<br>
Runtime error 200 at $000101AC<br>
$000101AC TEST2, line 11 of test.pas<br>
$000101E0 main, line 16 of test.pas<br>
$00010118<br>
<br>
Ie. it does not contain the reference to the actual line which
caused the problem. The first entry is to the return address of
the faulting procedure.<br>
<br>
The same compile options are used for both and include the -gl
option. FPC version is 2.6.4.<br>
<br>
Anyone have any idea why this happens or more usefully how the
Linux result can be fixed ?<br>
<br>
Thanks,<br>
Terry<br>
<br>
<br>
<br>
<br>
</font>
<br /><br />
<hr style='border:none; color:#909090; background-color:#B0B0B0; height: 1px; width: 99%;' />
<table style='border-collapse:collapse;border:none;'>
<tr>
<td style='border:none;padding:0px 15px 0px 8px'>
<a href="https://www.avast.com/antivirus">
<img border=0 src="http://static.avast.com/emails/avast-mail-stamp.png" alt="Avast logo" />
</a>
</td>
<td>
<p style='color:#3d4d5a; font-family:"Calibri","Verdana","Arial","Helvetica"; font-size:12pt;'>
This email has been checked for viruses by Avast antivirus software.
<br><a href="https://www.avast.com/antivirus">www.avast.com</a>
</p>
</td>
</tr>
</table>
<br />
</body>
</html>