Debugging a Program With dbx

Set Watchpoint for Store to Array Member

To set a watchpoint on array[99]:


(dbx) stop access w &array[99]
(2) stop access w &array[99], 4
(dbx) run
Running: watch.x2
watchpoint array[99] (0x2ca88[4]) at line 22 in file "watch.c"	
   22	array[i] = i;