For Programmers: Free Programming Magazines  


Home > Archive > Visual Studio > May 2006 > How to set break on change of class object member in VC6









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author How to set break on change of class object member in VC6
Jan M

2006-05-25, 7:05 pm

Hi,

How do I get VC6 to break on change of a class object member.

It seems to work only on simple variables.

I've tried:

int * pVar; // Global

// When object instantiated:

pVar = &pObject->nVarToWatch;

// Break expression is '*pVar'

Debugger seems to not monitor *pVar until it breaks at another point, when
the following appears in the debug tab:

DBG: Break command failed within 3 seconds.
DBG: Potential deadlock. Soft broken.

Works ok if break expression is 'pVar' but fails when break expression is
'*pVar'.

Thanks,

Jan


Phil Cairns

2006-05-26, 4:07 am

Jan M wrote:
> Hi,
>
> How do I get VC6 to break on change of a class object member.
>
> It seems to work only on simple variables.
>
> I've tried:
>
> int * pVar; // Global
>
> // When object instantiated:
>
> pVar = &pObject->nVarToWatch;
>
> // Break expression is '*pVar'


On the odd occasion I've needed to do this, I find the address of the
object when it is constructed (say it's 0x00123456). Then in the
breakpoint, I say the thing to watch is ((MyClass*)0x00123456)->nVarToWatch.

Phil.
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com