user649198
user649198

Reputation:

How can I see the point when a condition stops being met in gdb?

A variable value changes to something unreasonable, but there is too many subroutines to manually find where the change happens. How can I use gdb to find the point when a condition (eg. "x<1") is no longer true?

Upvotes: 1

Views: 59

Answers (1)

user649198
user649198

Reputation:

Use a watchpoint.

You can use a watchpoint to stop execution whenever the value of an expression changes, without having to predict a particular place where this may happen. (This is sometimes called a data breakpoint.)

Upvotes: 1

Related Questions