views:

43

answers:

1

Hey guys,

I'm trying to get the source added to the 1.6 Android SDK in order to be able to step through and see what Android is doing, and I'm getting weird misalignments when Eclipse actually runs and I step through the debugger.

This is not a problem if I use the 2.2 SDK - then, say, Activity.onCreate() lands perfectly when the debugger enters Activity.java.

However, in the case of 1.6, it lands about 10 lines lower, and for other functions, it's even more off. I downloaded the source code from http://mobilebytes.wordpress.com/2010/06/30/classes-source-for-eclipse/#comment-915 and realize it may not match what the current SDK has.

OK sure, SDK says Pkg.Desc=Android SDK Platform 1.6_r2 and even though the source that I downloaded says the same, maybe something is off there and it doesn't match exactly. So I went and dug up the source for this in the git repo - it's exactly the same!

What am I doing wrong? Is Eclipse not reading the line numbers correctly? Did Google compile off a branch that was changed when it was merged into the public git repo?

Here, check this out - Eclipse thinks onCreate is on line 801 while it's in reality on line 790:

alt text

What am I doing wrong?

Thank you!

Edit: Hrm, so I see the lines actually align with the 2.2 SDK source code. Continuing to poke at it.

A: 

OK, I figured it out. The problem was that the emulator itself was 2.2, and so even though the project is using the 1.6 library SDK, at debug time it's using whatever version the emulator runs instead (2.2). Things make sense now!

Artem Russakovskii