0

I'm still working with the same script, I mentioned in this other StackOverflow post.
General idea:

  • open a dumpfile, using a script
  • view the memory addresses of all variables
  • try to get some information

This time the dt function seems to be failing on a CMap object:

dt <application_name>!CMap<int,int,CUIntArray * __ptr64,CUIntArray * __ptr64> m_nCount 000000eab8748430
Ambiguous matches found for <application_name>!CMap<int,int,CUIntArray * __ptr64,CUIntArray * __ptr64> (dumping largest sized):
<application_name>!CMap<int,int,CUIntArray * __ptr64,CUIntArray * __ptr64>::~CMap<int,int,CUIntArray * __ptr64,CUIntArray * __ptr64>
<application_name>!CMap<int,int,CUIntArray * __ptr64,CUIntArray * __ptr64>::CMap<int,int,CUIntArray * __ptr64,CUIntArray * __ptr64> {0x02b bytes}

In order to solve this, I tried to open the object in Visual Studio watch-window, but this seems to be failing, regardless of what I try:

(CMap<int,int,CUIntArray * __ptr64,CUIntArray * __ptr64>)0x000000eab8748430 => identifier "sCMap..." is undefined
(CMap)0x000000eab8748430 => identifier "CMap" is undefined
(<application_name>!CMap<int,int,CUIntArray * __ptr64,CUIntArray * __ptr64>)0x000000eab8748430 => identifier "<application_name>" is undefined
(mfc110u!CMap<int,int,CUIntArray * __ptr64,CUIntArray * __ptr64>)0x000000eab8748430 => identifier "mfc110u" is undefined
...

However this way of working seems to be working for other MFC classes, like CStringArray:

(CStringArray*)0x000000eab87c6d10 => this is giving good results

Does anybody know how I can show a CMap (or CArray) object in Visual Studio's watch-window, based on its memory address?

sergiol
  • 4,122
  • 4
  • 47
  • 81
Dominique
  • 16,450
  • 15
  • 56
  • 112

1 Answers1

0

It seems that the debugger has problems with the CMap definition, and by removing the __ptr64 entries from the type definition (mind the space at the beginning of __ptr64), I can see the content of the variable:

(CMap<int,int,CUIntArray *,CUIntArray *>*) 0x000000eab8748430

I believe there is a bug in the debugger :-)

Dominique
  • 16,450
  • 15
  • 56
  • 112
  • Thanks for sharing your solution here, you could mark it as the answer. Have a nice day:) – Jack Zhai Dec 07 '17 at 01:14
  • There's just one thing I haven't figured out yet: does the debugger have a problem with `__ptr64` in particular or with the fact that the type definition contains two things `CUIntArray` and `__ptr64`, that's still to be investigated, but I don't have other cases right now. – Dominique Dec 07 '17 at 07:47