Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Inaccessible value



Permlink Replies: 12 - Last Post: Jun 16, 2017 5:39 AM Last Post By: Roy Lambert
Roy Lambert

Posts: 1,063
Registered: 8/7/01
Inaccessible value
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 13, 2017 4:11 AM
D2006

I'm trying to loop through a string

while Cntr <= Characters do begin
case Inbound[Cntr] of
...
...

First loop (ie Cntr = 1) I can read the value of Inbound in the debugger. Second loop (Cntr = 2) I get nothing on the tooltip and Inaccessible value if I use F7 to bring up the dialog.

I've tried unchecking optimisation, the only debugger option that isn't checked is Use Debug DCUs

I'm assuming that since this behaviour has only started in the last couple of weeks its something I've done, but I don't know what.

Its making debugging almost impossible.

Googling shows other people with the problem but nothing that fixes it for all.

Any suggestions

Roy Lambert

Rudy Velthuis (...


Posts: 7,731
Registered: 9/22/99
Re: Inaccessible value
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 13, 2017 6:53 AM   in response to: Roy Lambert in response to: Roy Lambert
Roy Lambert wrote:

D2006

I'm trying to loop through a string

while Cntr <= Characters do begin
case Inbound[Cntr] of
...
...

First loop (ie Cntr = 1) I can read the value of Inbound in the
debugger. Second loop (Cntr = 2) I get nothing on the tooltip and
Inaccessible value if I use F7 to bring up the dialog.

Could it be that the value is optimized into a register and therefore
not accessible as a variable anymore?

What is Inbound exactly? Array? TList? something else?
--
Rudy Velthuis http://www.rvelthuis.de

"He has no enemies, but is intensely disliked by his friends."
-- Oscar Wilde
Roy Lambert

Posts: 1,063
Registered: 8/7/01
Re: Inaccessible value
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 13, 2017 8:36 AM   in response to: Rudy Velthuis (... in response to: Rudy Velthuis (...
Rudy

Inbound is a string - its actually the decoded message portion of an email so may be anywhere from nothing to a lot of characters.

This is just one instance of the problem but its getting very frustrating.

Roy Lambert

Rudy Velthuis (...


Posts: 7,731
Registered: 9/22/99
Re: Inaccessible value
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 15, 2017 10:30 AM   in response to: Roy Lambert in response to: Roy Lambert
Roy Lambert wrote:

Rudy

Inbound is a string - its actually the decoded message portion of an
email so may be anywhere from nothing to a lot of characters.

This is just one instance of the problem but its getting very
frustrating.

Roy Lambert


Is that in debug mode, i.e. with optimizations off?

--
Rudy Velthuis http://www.rvelthuis.de

"I've always wanted to be somebody, but I should have been
more specific." -- George Carlin
Roy Lambert

Posts: 1,063
Registered: 8/7/01
Re: Inaccessible value
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 15, 2017 12:36 PM   in response to: Rudy Velthuis (... in response to: Rudy Velthuis (...
Rudy

Is that in debug mode, i.e. with optimizations off?

optimizations off or on makes no difference

It may be reaching the time for a wipe and reinstall

Roy Lambert
Rudy Velthuis (...


Posts: 7,731
Registered: 9/22/99
Re: Inaccessible value
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 16, 2017 3:54 AM   in response to: Roy Lambert in response to: Roy Lambert
Roy Lambert wrote:

Rudy

Is that in debug mode, i.e. with optimizations off?

optimizations off or on makes no difference

It may be reaching the time for a wipe and reinstall

Roy Lambert

Indeed. Although, I do get the issue too, but generally, then it is
because something (a variable) was optimized away.

--
Rudy Velthuis http://www.rvelthuis.de

"Mr. Wagner has beautiful moments but bad quarters of an hour."
- Gioacchino Rossini (1792-1868)
Roy Lambert

Posts: 1,063
Registered: 8/7/01
Re: Inaccessible value
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 16, 2017 5:39 AM   in response to: Rudy Velthuis (... in response to: Rudy Velthuis (...
Rudy

Indeed. Although, I do get the issue too, but generally, then it is
because something (a variable) was optimized away.

I've often had "cannot access variable due to optimisation" (can't remeber the exact words) but it hasalways told me its due to optimisation. This just tells me its not accessible.

Roy
Alex Belo

Posts: 626
Registered: 10/8/06
Re: Inaccessible value
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 13, 2017 9:39 AM   in response to: Roy Lambert in response to: Roy Lambert
Roy Lambert wrote:

I'm assuming that since this behaviour has only started in the last
couple of weeks its something I've done, but I don't know what.

There are QP reports on new debugger-related issue in Win10

Windows update KB3150513 crashes debugger
https://quality.embarcadero.com/browse/RSP-18182
Non-functional debugger after updating to Windows 10 Creators
https://quality.embarcadero.com/browse/RSP-17972

but I have no idea if it affects debugger of D2006.

--
Alex
Roy Lambert

Posts: 1,063
Registered: 8/7/01
Re: Inaccessible value
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 13, 2017 11:10 PM   in response to: Alex Belo in response to: Alex Belo
Alex

I should have said - W7 its a stable environment I stop Windows Update - the only things that are updated without my supervision are anti virus / anti malware packages.

Looking on the web its been reported at least as far back as D7 but no one seems to have found the root cause / a cover all solution.

Roy Lambert

Roy Lambert

Posts: 1,063
Registered: 8/7/01
Re: Inaccessible value
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 15, 2017 8:29 AM   in response to: Roy Lambert in response to: Roy Lambert
The next "fun" bit is in this loop

procedure TemImages.LoadFromStream(ms: TStream);
var
Mem: TMemoryStream;
Images, Size, Cntr: integer;
ID: string;
begin
Clear;
ms.Seek(0, soFromBeginning);
ms.read(Images, sizeof(Images));
for Cntr := 0 to Images - 1 do begin
ID := ReadImageName(ms);
ms.read(Size, sizeof(Size));
try
if Size <> 0 then begin
Mem := TMemoryStream.create;
Mem.CopyFrom(ms, Size);
ImageList.AddObject(ID, Mem);
end else begin
ImageList.AddObject(ID, nil);
end;
except
if Assigned(Mem) then Mem.Free;
break;
end;
end;
end;

Images is 19 but trying to see the value of Cntr it ALWAYS shows as 0

Roy Lambert

Rudy Velthuis (...


Posts: 7,731
Registered: 9/22/99
Re: Inaccessible value
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 15, 2017 10:59 AM   in response to: Roy Lambert in response to: Roy Lambert
Roy Lambert wrote:

The next "fun" bit is in this loop

procedure TemImages.LoadFromStream(ms: TStream);
var
Mem: TMemoryStream;
Images, Size, Cntr: integer;
ID: string;
begin
Clear;
ms.Seek(0, soFromBeginning);
ms.read(Images, sizeof(Images));
for Cntr := 0 to Images - 1 do begin
ID := ReadImageName(ms);
ms.read(Size, sizeof(Size));
try
if Size <> 0 then begin
Mem := TMemoryStream.create;
Mem.CopyFrom(ms, Size);
ImageList.AddObject(ID, Mem);
end else begin
ImageList.AddObject(ID, nil);
end;
except
if Assigned(Mem) then Mem.Free;
break;
end;
end;
end;

Images is 19 but trying to see the value of Cntr it ALWAYS shows as 0

Roy Lambert


Which target is that? Win32, Win64, one of the other?

--
Rudy Velthuis http://www.rvelthuis.de

"If a man does his best, what else is there?"
-- General George S. Patton (1885-1945)
Roy Lambert

Posts: 1,063
Registered: 8/7/01
Re: Inaccessible value
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 15, 2017 12:32 PM   in response to: Rudy Velthuis (... in response to: Rudy Velthuis (...
Rudy

Which target is that? Win32, Win64, one of the other?

D2006 on W7x64

Roy Lambert

Rudy Velthuis (...


Posts: 7,731
Registered: 9/22/99
Re: Inaccessible value
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 16, 2017 3:54 AM   in response to: Roy Lambert in response to: Roy Lambert
Roy Lambert wrote:

Rudy

Which target is that? Win32, Win64, one of the other?

D2006 on W7x64

Ah, OK. 32 bit only. <g>

--
Rudy Velthuis http://www.rvelthuis.de

"... Somehow we find it hard to sell our values, namely that
the rich should plunder the poor."
-- John Foster Dulles
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02