www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.debugger - Are there any debugger functions?

reply frame <frame86 live.com> writes:
If a pointer has an invalid target a debugger in VS shows the 
error

`D0001: Error: Expression couldn't be evaluated`

when I try to access it.

Is there a debugger function to trigger this access which can be 
used inside an invariant?
I can assert it by checking if the pointer address is far to low, 
but this doesn't always work.
Jan 06 2022
parent reply Rainer Schuetze <r.sagitario gmx.de> writes:
On 06/01/2022 19:04, frame wrote:
 If a pointer has an invalid target a debugger in VS shows the error
 
 `D0001: Error: Expression couldn't be evaluated`
 
 when I try to access it.
 
 Is there a debugger function to trigger this access which can be used 
 inside an invariant?
 I can assert it by checking if the pointer address is far to low, but 
 this doesn't always work.
Are you looking for something like IsBadReadPtr? See https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-isbadreadptr
Jan 15 2022
parent frame <frame86 live.com> writes:
On Saturday, 15 January 2022 at 09:11:53 UTC, Rainer Schuetze 
wrote:

 Are you looking for something like IsBadReadPtr? See 
 https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-isbadreadptr
Worth a try, thanks
Jan 24 2022