How to set a memory breakpoint in vc7?

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?
 
R

roman ziak

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
 
J

Jan Bares

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?
 
R

Ronald Laeremans [MSFT]

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
 
G

Guest

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????
 
R

Ronald Laeremans [MSFT]

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top