When the based variable's basing pointer is pointer based...



.... you can't use debug to display it.

I have a data structure which is pointer based (the data is in the
heap):

d recordDS ds Based(ds@)
d parent@ *
d objLen 10i 0
d objDat 10i 0
d objSiz 10i 0
d objVar 1a


ds@ is a pointer based variable:

d ds@ s * Based(ds@@)

ds@@ contains a pointer to a position within a user space.
The user space contains pointers to linked list entries in the heap.
I use qsort to resequence the pointers within the user space, and
then I read the sorted linked list by incrementing through the user
space.

The program, amazingly enough, didn't work the first time, so
I threw it into debug, and executed:

eval recordDS

which got me an error message, that the data was not available.


I got around this by defining a debug data structure:

d debugDS s 1024a Based(debug@)



When I execute:

eval debug@ = ds@

then:

eval debugDS

the contents of recordDS are displayed.

Chris
--

.



Relevant Pages

  • Re: using virtual function in c
    ... Here, the machine will convert &ii (a word pointer) to a byte pointer, ... If there is only one "virtual function" for a given data structure, ...
    (comp.lang.c)
  • Re: Release version crashes - again
    ... DWORD *pointer = NULL; ... are not usually equal in retail, but they usually are in debug. ... but my code is crashing in the CONSTRUCTOR area (long ...
    (microsoft.public.windowsce.embedded.vc)
  • Re: Dealing with HANDLEs
    ... On every new process event this program creates a new Process object and ... pointer and assigns the pointer from the to it. ... This worked in debug. ... Strange, I thought if I pass a pointer, it's like by ref, I can change its ...
    (microsoft.public.win32.programmer.kernel)
  • Re: Using sparse to catch invalid RCU dereferences?
    ... So the address_space attribute says what the pointer points to rather ... Probably because I am not the greatest gcc expert around... ... Then we would know that when tree lock is held the data structure is ... section with respect to another RCU-protected data structure. ...
    (Linux-Kernel)
  • Marshaling
    ... Actually it returns pointer to it. ... a pointer to a pointer to a copy of the data structure. ... According to this the date returned from WTSEnumerateSessions function is a ... DWORD Reserved, ...
    (microsoft.public.dotnet.framework)