468,774 Members | 2,614 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,774 developers. It's quick & easy.

Memory Write Breakpoint in vc7

I need to put a breakpoint when a particular memory location is
written. To be more specific I want to know when 0 is written onto that
memory location. Is there a way to do it in vc7?

Regards,

Anil.

Nov 17 '05 #1
4 1155
>I need to put a breakpoint when a particular memory location is
written. To be more specific I want to know when 0 is written onto that
memory location. Is there a way to do it in vc7?


Anil,

Use the Data tab page of the New Breakpoint dialog.

Dave
Nov 17 '05 #2
Data tab page requires a variable in some context. There is a local
variable in some function but it is overwritten by someone else. I've
debugged and everytime that function is called variable has the same
address. Code is as follows:

int variable = a/b;
ASSERT(variable);
c = d / variable;

when assert break the application, I've checked that a/b result is 14,
however the variable has 0 inside. The address of the variable is
0x975f328. (everytime we enter that code segment the address is same).
And assert only stops occasionally.

So I want to put a breakpoint when that variable is overwritten by
another thread.

In the new Data tab page there are following items:

Variable:
Context:
Condition:

I've tried to write something like:

(* ((int *)(0x975f328))) == 0

in either condition or variable edit box but it refuses that it is not
proper.

What can I do about it?

Anil.

-David Lowndes'in mesaji: > >I need to put a breakpoint when a
particular memory location is
written. To be more specific I want to know when 0 is written onto that
memory location. Is there a way to do it in vc7?


Anil,

Use the Data tab page of the New Breakpoint dialog.

Dave


Nov 17 '05 #3
actually i've managed to put the breakpoint but since it is a local
variable address.. many places in the application use that memory quite
often. now i need to find a better way to find who actually wrote after
variable is defined and before its context finishes.

any suggestions?

-Anil Aksay'in mesaji: > Data tab page requires a variable in some
context. There is a local
variable in some function but it is overwritten by someone else. I've
debugged and everytime that function is called variable has the same
address. Code is as follows:

int variable = a/b;
ASSERT(variable);
c = d / variable;

when assert break the application, I've checked that a/b result is 14,
however the variable has 0 inside. The address of the variable is
0x975f328. (everytime we enter that code segment the address is same).
And assert only stops occasionally.

So I want to put a breakpoint when that variable is overwritten by
another thread.

In the new Data tab page there are following items:

Variable:
Context:
Condition:

I've tried to write something like:

(* ((int *)(0x975f328))) == 0

in either condition or variable edit box but it refuses that it is not
proper.

What can I do about it?

Anil.

-David Lowndes'in mesaji: > >I need to put a breakpoint when a
particular memory location is
written. To be more specific I want to know when 0 is written onto that
memory location. Is there a way to do it in vc7?


Anil,

Use the Data tab page of the New Breakpoint dialog.

Dave


Nov 17 '05 #4
>any suggestions?

If you're not already doing these, I'd ensure I had all the compiler
run-time checks enabled, compile at the highest warning level, and if
they don't show anything, try a product such as bounds checker or
purify.

Dave
--
MVP VC++ FAQ: http://www.mvps.org/vcfaq
Nov 17 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by blugus | last post: by
3 posts views Thread by Gavin Kreuiter | last post: by
5 posts views Thread by lawrencelee | last post: by
5 posts views Thread by questions? | last post: by
14 posts views Thread by Piotrek | last post: by
4 posts views Thread by O.B. | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.