debugger side.
In the end I got round the problem like this. Fortunately all our ADO
recordsets inherit from a common class. I put in a new CString value
recordset is updated or the cursor moves. This means I can see this
This works OK but I found another conumdrum along the way. When I try to
ReadDebuggeeMemoryEx fails. For example:
does not work.
MFC. I got it to work for COleDateTime, but underneath it's anyway just
2 doubles.
Thanks once again for your time. I really like ths feature and I'd like
standard structs.
cheers.
"Colin Peters" <cpeters@coldmail.com> wrote in message
news:4845a74c$1_2@news.bluewin.ch...
Hi David,
First, I like the video. I wish I'd had seen it a few days ago; I would
have saved several hours. But I got there in the end.
But my problem still stands. In the example on video, you copy from the
debugee a chunk of memory [sizeof(SysTime)] bytes long. Effectively you
copy the variable, and with your copy you do the formatting. But what if
the variable was a pointer. Copying the pointer value (rather than what it
points to) is useless, isn't it? I should point out that my ultimate goal
is to be able to use the debug output to show the first record in an ADO
recordset. The recordset is accessed through a COM interface, which is a
pointer, IIRC. At the moment all I see in the debugger is that the
interface pointer isn't NULL, and I have to keep inserting chunks of code
into the debugee then recompile each time I want to see the recordset
contents.
Thanks for your time.
Yes, I see what you mean. This is what the video did:
SYSTEMTIME SysTime;
DWORD nGot;
DWORDLONG qwRealAddress = pHelper->GetRealAddress(pHelper);
HRESULT hr = pHelper->ReadDebuggeeMemoryEx(pHelper, qwRealAddress,
sizeof(SysTime), &SysTime, &nGot);
if ( hr != S_OK || nGot != sizeof(SysTime) )
return E_FAIL;
This is what I'm proposing:
IRecordSet pRecordSet;
DWORD nGot;
DWORDLONG qwRealAddress = pHelper->GetRealAddress(pHelper);
HRESULT hr = pHelper->ReadDebuggeeMemoryEx(pHelper, qwRealAddress,
sizeof(IRecordSet), &pRecordSet, &nGot);
if ( hr != S_OK || nGot != sizeof(IRecordSet) )
return E_FAIL;
HRESULT hr = pHelper->ReadDebuggeeMemoryEx(pHelper, qwRealAddress,
sizeof(IRecordSet), &pRecordSet, &nGot);
if ( hr != S_OK || nGot != sizeof(IRecordSet) )
return E_FAIL;
So now pRecordSet is valid, but you can't call any methods of the interface
because the v-table does not point to valid code in the debugger process.
Were you planning to call the methods of pRecordSet to get the data to
display in the debugger? That won't work.
But reading a simple pointer to data (and not an interface) is different.
In that case, it sounds like you would first read the memory containing the
pointer value, then use that value to read (a second time) the value that is
pointed to.
I'm unclear which scenario fits what you want to do?
Thanks,
David