开发者

Android Eclipse Debugging: Getting Intermediate Values

Is there any way to get the eclipse debugger to report the intermediate return values of th开发者_运维百科e functional subterms of a complex android expression without declaring variables for every subterm?

For example, in the following code I would like to know the return values of each function (getPaddingRight, getPaddingLeft etc.):

if (tview.getPaint().measureText(q_text.toString(<=tview.getWidth()-tview.getPaddingRight()-tview.getPaddingLeft()){
            //take actions
            }

Edit: if you mouse over the q_text or tview you get the properties for that object, but not the return value of the function. You can just look up the value for getWidth for example by looking at the mMeasuredWidth property of the tview object, but I'm wondering if there is a general solution for the return value of any function.


I finally found an easy way to do this:

  1. Go to eclipse debug view (Widow->Open Perspective->Debug)
  2. Click on the expressions tab (Top right mini-widow, 1 of 3 tabs Variables, Breakpoints, Expressions)
  3. Enter the value of your function or variable or whatever, click on it and the resulting expression will be displayed.

Note: If the tab "Expressions" is not in the upper right window then right click on one of the variabls in the "Variables" tab and click on the "Watch" menu entry and the "Expressions" tab will appear.

Using Helios Service Release 2

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜