Break when address reading
-
I know how to break execution when the memory at the specified address changes. ------------------------------ Menu->Debug->Windows->Breakpoints: New: New Data Breakpoints ------------------------------ But, I want to break execution when the memory at the specified address reads. For example
int g_iNum = 123;
void Fun1()
{
int iTemp;iTemp = g_iNum; // Break execution at here, where is when the memory at the g_iNum's address being reads.
}
-
I know how to break execution when the memory at the specified address changes. ------------------------------ Menu->Debug->Windows->Breakpoints: New: New Data Breakpoints ------------------------------ But, I want to break execution when the memory at the specified address reads. For example
int g_iNum = 123;
void Fun1()
{
int iTemp;iTemp = g_iNum; // Break execution at here, where is when the memory at the g_iNum's address being reads.
}
Perhaps, something like Function Breakpoint?
-
I know how to break execution when the memory at the specified address changes. ------------------------------ Menu->Debug->Windows->Breakpoints: New: New Data Breakpoints ------------------------------ But, I want to break execution when the memory at the specified address reads. For example
int g_iNum = 123;
void Fun1()
{
int iTemp;iTemp = g_iNum; // Break execution at here, where is when the memory at the g_iNum's address being reads.
}
You have supplied no way to answer your question as you have not told us what system you are talking about. Hence I can only tell you it is called a watchpoint watchpoint - Wiktionary[^] This is what you are wanting isn't it ===> "A debugging mechanism whereby execution is suspended every time a specified memory location is modified; or, any of various similar such mechanisms." No way to answer you any deeper than that.
In vino veritas
-
I know how to break execution when the memory at the specified address changes. ------------------------------ Menu->Debug->Windows->Breakpoints: New: New Data Breakpoints ------------------------------ But, I want to break execution when the memory at the specified address reads. For example
int g_iNum = 123;
void Fun1()
{
int iTemp;iTemp = g_iNum; // Break execution at here, where is when the memory at the g_iNum's address being reads.
}
You might want to investigate Guard Pages: Creating Guard Pages | Microsoft Docs[^]
The difficult we do right away... ...the impossible takes slightly longer.
-
Perhaps, something like Function Breakpoint?
Use Windbg "ba r1 0000ffff" can break when address(0x0000ffff) reads. But I don't know how to find where of code.
-
You have supplied no way to answer your question as you have not told us what system you are talking about. Hence I can only tell you it is called a watchpoint watchpoint - Wiktionary[^] This is what you are wanting isn't it ===> "A debugging mechanism whereby execution is suspended every time a specified memory location is modified; or, any of various similar such mechanisms." No way to answer you any deeper than that.
In vino veritas
Windows10, Visual Studio, C++ ---------------------------- Use Windbg "ba r1 0000ffff" can break when address(0x0000ffff) reads. But I don't know how to localition the source code.
-
You might want to investigate Guard Pages: Creating Guard Pages | Microsoft Docs[^]
The difficult we do right away... ...the impossible takes slightly longer.
Use Windbg "ba r1 0000ffff" can break when address(0x0000ffff) reads. But I don't know how to open and location the source code.
-
I know how to break execution when the memory at the specified address changes. ------------------------------ Menu->Debug->Windows->Breakpoints: New: New Data Breakpoints ------------------------------ But, I want to break execution when the memory at the specified address reads. For example
int g_iNum = 123;
void Fun1()
{
int iTemp;iTemp = g_iNum; // Break execution at here, where is when the memory at the g_iNum's address being reads.
}
The first thing that came to mind is to search for
g_iNum
in the entire code base and put breakpoints where ever it is being accessed. ;P«_Superman_» _I love work. It gives me something to do between weekends.
_Microsoft MVP (Visual C++) (October 2009 - September 2013)