debugging - Android Studio Debugger : Stop when an variable gets a specific value -
scenario : have variable , want find out , when variable gets example value 4. when happens debugger should stop @ line.
is possible android studio ?
if understand correctly you're wanting set called "watchpoint" in android studio, , here's link intellij documentation discusses them:
https://www.jetbrains.com/help/idea/2016.3/creating-field-watchpoints.html
in particular, want set break-point on member variable itself, right-click break-point , set watch on "field modification" , set condition when variable becomes specific value you're trying find.
so, in simple bit of code:
public class mainactivity extends appcompatactivity { int mwatchme = -10; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); (int i=0 ; i<20 ; i++) { mwatchme++; } } }
you set break-point on line: int mwatchme = -10;
.
set "condition" , "modification" fields:
the execution should break ever "mwatchme" set '0':
Comments
Post a Comment