How to set a memory breakpoint in vc7?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

My purpose is to know which code reads value from a certain address. So I want to set a memory breakpoint and when cpu reads from the address, the breakpoint will be hit. But in the "Data breakpoint" in vc7, there are only two kinds of condition: "is true" and "has changed". How can I do?
 
lawrencelee said:
My purpose is to know which code reads value from a certain address. So I want to set a memory breakpoint and when cpu reads from the address, the breakpoint will be hit. But in the "Data breakpoint" in vc7, there are only two kinds of condition: "is true" and "has changed". How can I do?

I would suggest to use no condition at all.

However, I did not know about data breakpoints and I have a question to
somebody who knows about how is this done on Intel processors.

Roman
 
Hi,

you need hardware breakpoints, but VC doesn't use them. With little effort
you can use them from ;you code, they impose no overhead on code execution.
See here http://www.morearty.com/code/breakpoint/.

Regards, Jan


lawrencelee said:
My purpose is to know which code reads value from a certain address. So I
want to set a memory breakpoint and when cpu reads from the address, the
breakpoint will be hit. But in the "Data breakpoint" in vc7, there are only
two kinds of condition: "is true" and "has changed". How can I do?
 
Actually the VS debugger's data breakpoints are done as hardware
breakpoints. Their used to be emulated data breakpoints as well but we
removed them altogether.

Ronald Laeremans
Visual C++ team
 
Yes, I need hardware breakpoint. In other debuger, like windbg, gdb, it's very easy to set a hardware breakpoint. It's strange why vc can't do it distinctly.

So how can I set a "read" hardware breakpoint????
 
The VS debugger only supports HW write breakpoints, not read breakpoints. I
entered a suggestion in the bug database that we support read breakpoints as
well.

Ronald
 
Back
Top