Data Breakpoints being ignored?
-
Hi, I am trying to figure out what code is changing a particular variable in debugging. So in the Locals Window in Debugging mode I rightclick the variable and set a Data Breakpoint at either Fixed Address or Address given by Expression and put in the variable name. And the new breakpoint appears as a gray dot at the bottom. But when I click the button to continue the other breakpoints will be cycled through but the data breakpoint will just sit there doing nothing apparently.
I am in Debug Build and the address of the variable remains the same as far as I see. And the variable value is clearly changing. Isn't there supposed to be some stoppage and indication that a data breakpoint has been tripped?
I'm using Qt Creator version 14.0.2 and running through Linux Mint.
-
Hi, I am trying to figure out what code is changing a particular variable in debugging. So in the Locals Window in Debugging mode I rightclick the variable and set a Data Breakpoint at either Fixed Address or Address given by Expression and put in the variable name. And the new breakpoint appears as a gray dot at the bottom. But when I click the button to continue the other breakpoints will be cycled through but the data breakpoint will just sit there doing nothing apparently.
I am in Debug Build and the address of the variable remains the same as far as I see. And the variable value is clearly changing. Isn't there supposed to be some stoppage and indication that a data breakpoint has been tripped?
I'm using Qt Creator version 14.0.2 and running through Linux Mint.
@A123
Your experience may vary from mine. But I have never found "data breakpoints" work reliably in the various debuggers I have used over the years! At best they may work better on a fixed memory address given as a constant number. For all I know doing it via "Expression" might mean you have to enter&VariableName
rather thanVariableName
?I imagine this is not done by Creator but by the underlying debugger? Have you tried placing the data breakpoint directly in gdb and running quite outside of Creator just to see whether this works?
-
@A123
Your experience may vary from mine. But I have never found "data breakpoints" work reliably in the various debuggers I have used over the years! At best they may work better on a fixed memory address given as a constant number. For all I know doing it via "Expression" might mean you have to enter&VariableName
rather thanVariableName
?I imagine this is not done by Creator but by the underlying debugger? Have you tried placing the data breakpoint directly in gdb and running quite outside of Creator just to see whether this works?
@JonB said in Data Breakpoints being ignored?:
But I have never found "data breakpoints" work reliably in the various debuggers I have used over the years!
They work really well with Visual Studio (at least the few times I have used them). At least in Visual Studio I don't just have to mention the address of the variable, but also its size in bytes. Maybe there is something similar for the debugger you are using. Depending on little endian/big endian you might not catch any change of a variable if you just observe a single byte at the specified address.
-
@JonB said in Data Breakpoints being ignored?:
But I have never found "data breakpoints" work reliably in the various debuggers I have used over the years!
They work really well with Visual Studio (at least the few times I have used them). At least in Visual Studio I don't just have to mention the address of the variable, but also its size in bytes. Maybe there is something similar for the debugger you are using. Depending on little endian/big endian you might not catch any change of a variable if you just observe a single byte at the specified address.
@SimonSchroeder If memory serves well, one thing that can play in this this is that the Visual Studio debugger is not exactly the same as cdb which might explain the difference in experience.
-
@SimonSchroeder If memory serves well, one thing that can play in this this is that the Visual Studio debugger is not exactly the same as cdb which might explain the difference in experience.
@SGaist No, its not. Also, the OP is asking for Linux anyway. I just assumed that this might be something that other debuggers do as well.