 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Jeremy Guest
|
Posted: Mon Oct 24, 2005 11:52 pm Post subject: inaccessable values when debugging |
|
|
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
|
Posted: Tue Oct 25, 2005 10:10 am Post subject: Re: inaccessable values when debugging |
|
|
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
|
Posted: Tue Oct 25, 2005 3:35 pm Post subject: Re: inaccessable values when debugging |
|
|
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
|
Posted: Tue Oct 25, 2005 4:34 pm Post subject: Re: inaccessable values when debugging |
|
|
| 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
|
Posted: Mon Oct 31, 2005 5:35 pm Post subject: Re: inaccessable values when debugging |
|
|
"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 |
|
 |
|
|
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
|
|