Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

setting a breakpoint when variable reaches specific value

Tags:

gdb

Is there anyway to set a breakpoint when a variable reaches a specific value in GDB? For example, a variable take these values: 1 4 8 10 3 2 9 13 11 and I want to set a breakpoint when this variable reaches 9.

like image 497
mahmood Avatar asked Sep 02 '11 15:09

mahmood


1 Answers

Yes, set breakpoint with condition.

break ... if value==9
like image 111
ks1322 Avatar answered Sep 28 '22 02:09

ks1322