Note that there are some explanatory texts on larger screens.

plurals
  1. POEclipse: Debugging... then seems to stop in a while loop, without debugging the following codes, why?
    text
    copied!<p>my friends ,i have to admit that the question is a little long, but to make you more clear of the question, i pasted the codes here, its some android codes. you neednt look at it carefully, its only a reference. for some functions of the codes doesnt work, i began to debug( using Eclipse). everything is ok before the <code>while</code> loop (i have marked it in the code), when enter the while loop, something magic that happens:</p> <ol> <li>the first loop, after executing the code <code>while((msg = d.readLine()) != null)</code>, the value of <code>msg</code> variable is blank, maybe its not <code>null</code>, because you will soon enter the second loop right now.</li> <li>the second loop, after executing the code <code>while((msg = d.readLine()) != null)</code>, the value of <code>msg</code> variable is <code>touchasd not found</code>, yes, its what i really want</li> <li><p>the third loop, after executing the code <code>while((msg = d.readLine()) != null)</code>, the small arrow which indicates the current line of code disappeared! i cannot find it anywhere! and the <strong><em>step over</em></strong> button is grey! i even cannot click it to continue the debug! just as the debugging is over! but i have some codes below that dont execute at all ! nothing in <code>logcat</code>. it seems that eclipse think it is ok, without any error occurred. </p> <pre><code> try { Process p = Runtime.getRuntime().exec("su"); DataOutputStream outputStream = new DataOutputStream(p.getOutputStream()); TextView suCommandMessage = (TextView)findViewById(R.id.suCommandMessage); BufferedReader d = new BufferedReader(new InputStreamReader(p.getErrorStream())); outputStream.writeBytes("touchasd /m\n"); String sb = ""; String msg = ""; /////////////////////////////////////HERE///////////////////////////////////// while((msg = d.readLine()) != null) { sb = sb + msg; } /////////////////////////////////////HERE///////////////////////////////////// suCommandMessage.setText(sb); outputStream.writeBytes("exit \n"); p.waitFor(); } catch(IOException e) { new AlertDialog.Builder(this) .setTitle("Exception") .setMessage("IOException: " + e) .setPositiveButton("OK", null) .show(); } catch(InterruptedException e) { new AlertDialog.Builder(this) .setTitle("Exception") .setMessage("InterruptedException: " + e) .setPositiveButton("OK", null) .show(); } </code></pre> <p>}</p></li> </ol> <p><img src="https://i.stack.imgur.com/uwC6H.png" alt="i make a screenshot when i cannot continue the debugging"></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload