BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

inaccessable values when debugging

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi OO design
View previous topic :: View next topic  
Author Message
Jeremy
Guest





PostPosted: Mon Oct 24, 2005 11:52 pm    Post subject: inaccessable values when debugging Reply with quote



I've just done some refactoring -- mainly combining ancestors into
descendants where the ancestor was never descended elsewhere -- and now I'm
seeing "inaccessable value" all over the place while stepping through with
the debugger. It makes me think I've hidden some stuff that needs to be
visible, and revealed some stuff that should be hidden. Or anyway, somehow
allowed my code to see unassigned or uninstantiated properties.

Does this make sense? Any suggestions on where to look?

Jeremy


Back to top
Jim Cooper
Guest





PostPosted: Tue Oct 25, 2005 10:10 am    Post subject: Re: inaccessable values when debugging Reply with quote




Have you got a specific example?

Cheers,
Jim Cooper

__________________________________________

Jim Cooper [email]jcooper (AT) tabdee (DOT) ltd.uk[/email]
Tabdee Ltd http://www.tabdee.ltd.uk

TurboSync - Connecting Delphi to your Palm
__________________________________________
Back to top
Jeremy
Guest





PostPosted: Tue Oct 25, 2005 3:35 pm    Post subject: Re: inaccessable values when debugging Reply with quote



Jim, I think it was a case like this:

type mytype=class(tobject)
private
ffred: string;
public
property fred: string ...
function dosomething(fred: string): boolean;
end;

The function parameter was spelled the same as a property. Didn't cause a
problem til I merged my classes and function and property landed together,
as it were.

However, at the time of fixing this, I also qualified a number of formerly
unqualified field references, ie self.ffred instead of ffred.

Jeremy



Back to top
Jim Cooper
Guest





PostPosted: Tue Oct 25, 2005 4:34 pm    Post subject: Re: inaccessable values when debugging Reply with quote


Quote:
The function parameter was spelled the same as a property.

Maybe the debugger then gets confused? I have also occasionally seen that sort
of thing happen when the optimiser has kicked in and removed any reference to a
variable in the compiled code.

Quote:
However, at the time of fixing this, I also qualified a number of formerly
unqualified field references, ie self.ffred instead of ffred.

Definitely a good idea wherever there could be confusion as to which is meant
(confusing to programmers, the compiler will be just fine <g>). Although
personally I would rename the parameter.

Cheers,
Jim Cooper

__________________________________________

Jim Cooper [email]jcooper (AT) tabdee (DOT) ltd.uk[/email]
Tabdee Ltd http://www.tabdee.ltd.uk

TurboSync - Connecting Delphi to your Palm
__________________________________________

Back to top
Mark Lauter
Guest





PostPosted: Mon Oct 31, 2005 5:35 pm    Post subject: Re: inaccessable values when debugging Reply with quote

"Jeremy" <jeremy> wrote

Quote:
I've just done some refactoring -- mainly combining ancestors into
descendants where the ancestor was never descended elsewhere -- and now
I'm seeing "inaccessable value" all over the place while stepping through
with the debugger. It makes me think I've hidden some stuff that needs to
be visible, and revealed some stuff that should be hidden. Or anyway,
somehow allowed my code to see unassigned or uninstantiated properties.

Does this make sense? Any suggestions on where to look?

If "optimization" is turned on the linker will remove stuff that get's
optimized out. If you turn optimization off most of the "innaccessible
values" should become accessible. Remember to turn optimization back on
before your final production build.

HTH

Mark



Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi OO design All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.