Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

watch a class object at memory address on Visual Studio

I am debugging a user dump file and there is this class member function at the top of the the stack trace

  • the stack trace is something like this -

msvcr80.dll!__invalid_parameter_noinfo() + 0xc bytes - 1st FRAME msvcr80.dll!__invalid_parameter_noinfo() + 0xc bytes - 2nd FRAME
myDLL!myClass::myClassMemFunc(int val = 90) - 3rd FRAME

Now, when I jump to the 3rd frame - the "this" pointer value is invalid (the "this" value is retrieved from the ECX register - but the ECX register value got changed in the first two function of the above stack trace - ) - so I am not able to see the actual member variables of my class object -

But I know the address of my class object though - which is 0x0012ECE0

when I am trying to watch that memory address with - (myClass*)(0x0012ECE0)

I get a CXX0019: Error: bad type cast

even (myClass)(0x0012ECE0) generates the same error.

am I doing anything wrong here? - whats the right way to retrieve the class object value?

like image 930
naiveCoder Avatar asked May 18 '09 09:05

naiveCoder


1 Answers

just a blind guess: try (myDLL!myClass*)(0x0012ECE0)

another question, how can you be sure it is your object's address?

as a side note, try the windbg - it is way simpler to look for objects around your memory/stack.

like image 98
deemok Avatar answered Oct 12 '22 04:10

deemok