473,320 Members | 2,071 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,320 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 1258
>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: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
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...

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.