T
TBass
Ok, so I'm trying to understand why my debugger can't find the memory
address for the members of a structure.
typedef struct ADCLIST_el
{
struct ADCLIST_el *pPrev;
struct ADCLIST_el *pNext;
void *pData;
} ADCLIST_el;
int
adcList_Push( ADCLIST **ppHead, void *pData )
{
int ret;
ADCLIST *pNewNode;
ADCLIST *pTemp;
pNewNode = malloc( sizeof *pNewNode );
if ( pNewNode != NULL )
{
if ( *ppHead != NULL )
{
pTemp = *ppHead;
>>>> pTemp->pPrev = pNewNode;
}
...
(838.954): Access violation - code c0000005 (!!! second chance !!!)
The debugger returns this when I check the memory addresses of pTemp:
0:000> dt pTemp
Local var @ 0x12f990 Type ADCLIST_el*
0xbaadf00d
+0x000 pPrev : ????
+0x004 pNext : ????
+0x008 pData : ????
Memory read error baadf015
If pTemp is pointing to a valid ADCLIST structure, and pTemp has that
address, why don't its members have a memory address?
Outside of the debugger, the program runs fine without crashing, but
I'm assuming the debugger is telling me something I don't know. What
is it I'm not doing right for allocating the memory?
Thanks in advance,
TBJ
address for the members of a structure.
typedef struct ADCLIST_el
{
struct ADCLIST_el *pPrev;
struct ADCLIST_el *pNext;
void *pData;
} ADCLIST_el;
int
adcList_Push( ADCLIST **ppHead, void *pData )
{
int ret;
ADCLIST *pNewNode;
ADCLIST *pTemp;
pNewNode = malloc( sizeof *pNewNode );
if ( pNewNode != NULL )
{
if ( *ppHead != NULL )
{
pTemp = *ppHead;
>>>> pTemp->pPrev = pNewNode;
}
...
(838.954): Access violation - code c0000005 (!!! second chance !!!)
The debugger returns this when I check the memory addresses of pTemp:
0:000> dt pTemp
Local var @ 0x12f990 Type ADCLIST_el*
0xbaadf00d
+0x000 pPrev : ????
+0x004 pNext : ????
+0x008 pData : ????
Memory read error baadf015
If pTemp is pointing to a valid ADCLIST structure, and pTemp has that
address, why don't its members have a memory address?
Outside of the debugger, the program runs fine without crashing, but
I'm assuming the debugger is telling me something I don't know. What
is it I'm not doing right for allocating the memory?
Thanks in advance,
TBJ