Eclipse Debugger Skips Missing Important Code

I have a weird issue debugging an android app. To be precise, I copy here the exact code I'm running on:

// Get the puzzles from cache List<PuzzleDetails> newPuzzles = m_cachedPuzzles.getPuzzles(count); if(newPuzzles.size() > 0){ // Remove from cache m_cachedPuzzles.removePuzzles(newPuzzles); // LINE (A) // Add the new puzzles from cache immediately m_ownedPuzzles.addPuzzles(newPuzzles); Log.d("requests", "" + newPuzzles.size() + " moved from cache to user"); } int left = count - newPuzzles.size(); String deviceId = ResourcesPublisher.getInstance().getDeviceId(); // Don't let anyone else use these points for now ChallengePointsManagerImpl.getInstance().usePoints(left); Log.d("requests", "aquirePuzzles(" + left + ")"); // Get a list of requests for 'left' number of puzzles RequestList reqList = getRequestList(left); // TODO this is a bug, now if(reqList.size() > 1){ reqList = getRequestList(left); // LINE (B) } 

When I run this code, after following the line (A) m_cachedPuzzles.removePuzzles (newPuzzles); The debugger "jumps" to the last line (B) reqList = getRequestList (left);

A simple check shows that he really missed all the code between these code lines. For example, Log.d (...) has never been called or written.

Can someone give me a clue why this is happening ???

Thanks!

+7
source share
6 answers

Try right-clicking> refresh in the project, as it appears in the project explorer after compiling the code and before starting debugging.

+3
source

Perhaps an exception was thrown from row A, and the next step corresponds to closing this stack frame?

0
source
  mIsReaded = (mIsReaded)?false:true; //mIsReaded = !mIsReaded; saveReadFlag(); refreshUI(); Toast.makeText(getSherlockActivity(),... 

In my case, the commented code line causes a similar problem (two lines are skipped). To solve this problem, I just changed this line to the code published above (I mean mIsReaded = (mIsReaded)? False: true;) So different cases have different solutions. This is the result of code optimization by the compiler, so please edit something (inside) m_cachedPuzzles.removePuzzles (newPuzzles);

0
source

I had the same problem. The thing is, you are probably debugging code that is in your IDE, and not on the server. You need to deploy the code from the IDE (Eclypse, Netbeans, etc.) to the server. It worked for me! Good luck

0
source

Not directly related to Eclipse, but I had a similar problem using the Xamarin extension for Visual Studio, and my implementation might help. I was developing an application with a class library. when I made changes to the library, then I started emulating my application, the DLL does not always rebuild, so the debugger will go through the PDB, as it was before my last changes. After rebuilding the DLL, it would go fine.

In short, rebuild dependencies if any changes are made.

Hope you solve your problem. Have a good

0
source

TODO comment using multi-line comment

 /*// TODO this is a bug, now*/ 

and try again.

0
source

All Articles