Watch, Follow, &
Connect with Us
Public Report
Report From: Kylix/Debugger/Stepping    [ Add a report in this area ]  
Report #:  3908   Status: Open
FileExists and "step over" / "trace into"
Project:  Kylix Build #:  4.186
Version:    3.0 Submitted By:   AMS AMS
Report Type:  Basic functionality failure Date Reported:  3/25/2003 2:35:25 AM
Severity:    Commonly encountered problem Last Updated: 3/20/2012 2:24:39 AM
Platform:    Kylix Pascal IDE Internal Tracking #:   158281
Resolution: None  Resolved in Build: : None
Duplicate of:  None
Voting and Rating
Overall Rating: (2 Total Ratings)
4.50 out of 5
Total Votes: None
Description
Hi,

I am using Kylix3 on Mandrake 9.0 (kernel 2.4.19 / glibc 2.2.5).
When I use the FileExists function (which calls in turn euidaccess) in an if statement, the debugger gets confused. If I use F8/F9 the behaviour is correct. Hitting F7 however executes the wrong code (the result of FileExists is wrong).

I suspect a misbehaviour of the function euidaccess. Something like not cleaning up the stack in a polite way.

when not debugging the behaviour is correct, however, if the stack is not cleaned up properly, this might lead to other problems later (program might crash seemingly without any reason).
Steps to Reproduce:
1. create a new project
2. put a button on a form
3. attach to the click event of the button the following code:

procedure TForm1.Button1Click (Sender: TObject);
var test : Boolean;
begin

test := FileExists ('/etc/hosts');
if test then writeln ('true')
else writeln('false');
end;


4. Set a breakpoint on the "test := FileExists ('/etc/hosts');" line
5. Try out the behaviour of F7, F8, F9


exp: the var test allways becomes true (or false in case you don't have a hosts file)
act : hitting F7 makes var test False      (or true in case you don't have a hosts file)
Workarounds
None
Attachment
None
Comments

Matthias Thoma at 3/26/2003 5:34:29 PM -
Can reproduce - although I am not convinced that euidaccess is responsible.

Server Response from: ETNACODE01