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?
roman ziak - 20 Jul 2004 18:54 GMT
> 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
Jan Bares - 21 Jul 2004 08:59 GMT
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
> 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?
Ronald Laeremans [MSFT] - 21 Jul 2004 21:28 GMT
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
> Hi,
>
[quoted text clipped - 10 lines]
> only
> two kinds of condition: "is true" and "has changed". How can I do?
lawrencelee - 22 Jul 2004 10:19 GMT
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????
> Actually the VS debugger's data breakpoints are done as hardware
> breakpoints. Their used to be emulated data breakpoints as well but we
[quoted text clipped - 17 lines]
> > only
> > two kinds of condition: "is true" and "has changed". How can I do?
Ronald Laeremans [MSFT] - 28 Jul 2004 00:35 GMT
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
> 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
[quoted text clipped - 26 lines]
>> > only
>> > two kinds of condition: "is true" and "has changed". How can I do?