@OP
Please post your code snippet so that I can test it.
In fact, I'm not fully understand what's OP's problem, what is the watch expression, and what's the exact value it should be? Please list them.
To have the code working there are several files that need to be working. If you want I can paste the basic structure of v to make you understand what it is about.
//v is a TMult element that represents a structure that can hold any type of element
typedef int(*TFComp)(const void *, const void *);
typedef struct
{ size_t d; /* element size */
TFComp fid; /* function that checks the equality of two elements */
TFComp ord; /* ordering function */
void *v, *s, *t; /* value vector adresses: v for beginning, s for end of used memory and t for available memory */
} TMult;
Regarding values, I think it's pretty clear. The vector v->v is listed (it's void with int values in it), the initialization of s1 is clear: it's v->v+j (j=0 and d=1, j, d are int numbers). And s2=v->v+j+d which is supposed to be s1+1. Now, s1 is correctly v->v, as it says there, its value is 1. However s2, although it holds the exact same memory address as v->v+j+d, instead of having the value 23 in it, it has a huge number stored.
So, what's your problem? Here is my test code and see the screen shot below:
code:
#include <stdio.h>
//v is a TMult element that represents a structure that can hold any type of element
typedef int(*TFComp)(const void *, const void *);
typedef struct
{ size_t d; /* element size */
TFComp fid; /* function that checks the equality of two elements */
TFComp ord; /* ordering function */
void *v, *s, *t; /* value vector adresses: v for beginning, s for end of used memory and t for available memory */
} TMult;
TMult a;
int main()
{
TMult *p = &a;
p->v = (void*)0x1;
p->s = (void*)0x2;
return 0;
}
screen shot:
(http://i683.photobucket.com/albums/vv194/ollydbg_cb/2012-03-06160142.png)
I can't see any thing wrong.
EDIT: would you mind to extend my example to show us the errors?