memory breakpoints/buffer overflows in the VC++ 2005 debugger

J

Jonathan Wilson

I have an app written in native C++ using Visual C++ 2005 (pro edition).
How can I set a memory breakpoint in the debugger for this app?
Or alternatively, is there another source level debugger I can use that
will let me set such breakpoints?

Note that moving to Visual Studio 2008 is not an option.
 
B

Bob Altman

Does VS 2008 have this feature?

Way back in my VAX/VMS days, the debugger had a feature called a "watch
point", which would break into the debugger when data at a specified memory
address was modified. The debugger did this by write protecting the page
containing the watch point, then handling the resultant access violations,
completing those that don't involve the watch point and breaking into the
debugger on those that do.

Bob
 
J

Jochen Kalmbach [MVP]

Hi Jonathan!
I have an app written in native C++ using Visual C++ 2005 (pro edition).
How can I set a memory breakpoint in the debugger for this app?
Or alternatively, is there another source level debugger I can use that
will let me set such breakpoints?

Start your project in the debugger. Set some breakpoint where the
variable is accessible.
Then in the menu:
Debug|New Breakpoint|New Data Breakpoint...

The specify either the address or the variable name.

Depending on the processor, normally 4 data breakpoints are natively
supported.

PS: Memory(Data)-Breakpoints are a avilable since several years in VS...


--
Greetings
Jochen

My blog about Win32 and .NET
http://blog.kalmbachnet.de/
 

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