473,383 Members | 1,866 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

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 1260
>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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: blugus | last post by:
Hi Guys, I've been try to use Dinkum STL library. It workes well first, but report memory leak in MFC Debug Mode. I use Dinkum Unabridged Library for VC++ V4.02, MSVC6, WIN2000 SERVER. I...
3
by: Gavin Kreuiter | last post by:
I am looking for some advice on how to debug a program when the debugger "print" command actually clears the corruption. This is not the usual non-initialised memory problem, because the program...
5
by: lawrencelee | last post by:
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"...
5
by: questions? | last post by:
I am new to C programming. I just wrote a quite long program for my project, but I have memory leak and the program keeps asking for more and more memory. What are the basic rules for checking...
14
by: Piotrek | last post by:
Hi all. I have a web app, in which I use frames. My main frameset consists of three inner frames. When some button is pressed in frame A, then content of frame B is reloaded. I am using such...
4
by: O.B. | last post by:
I've got this C# .NET 2005 application that has some unmanaged code. At random times, I get: An unhandled expection of type 'System.AccessViolationException' occurred in Unknown Module. ...
2
by: adypoly | last post by:
Hi guys... I am having a typical problem in using one of the native dll in C# I'll explain what am trying to do, I've a dll written in C language which i am trying to include in my C# project,...
2
by: Jonathan Wilson | last post by:
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...
2
by: Ed | last post by:
Hi, guys, In Visual Studio C++ 2008, I can add an item "*(int*)0x00385fa0" in Watch window to catch the value in that memory address. The value evaluation is OK. The question is how can I know...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.