Just want to check I am not going mad. Im trying to check the data returned from a call to IOCTL(IOCTL_OBJ_NVOBJ)
this contains a pointer to a pointer uint8_t **objPtr;
In the debugger objPtr appears to contain 0 but *objPtr looks like it has valid data.
So to try and confirm that I understand the double pointer I wrote the following code which doesn't work.1
1/ void SaveLinkTable(void)
2/ {
3/ smplStatus_t status;
4/ uint8_t *objPtr;
5/
6/ status = SMPL_Ioctl( IOCTL_OBJ_NVOBJ, IOCTL_ACT_GET, &LinkTable);
7/
8/ objPtr = *LinkTable.objPtr;
9/
10/ objPtr++;
11/ objPtr--;
12/ if( status == SMPL_SUCCESS)
13/ {
14/ if(objPtr != NULL)
15/ {
16/ writeFlash();
17/ }
18/ }
19/ }
Now line 6 works but status is invalid in the debugger at this point.
I CANNOT put a breakpoint on lines 8 or 10 or 11 or 12 because the debugger thinks they don't exist. The dissasembler doesn't show the C source.
When you run the code it jumps straight from line 6 to line14.
Can anyone shed some light on what is happening here.
PS lines 10 and 11 are only for debug puposes.