Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix JDWP interception to work if debug names are missing. #2479

Merged
merged 1 commit into from
Dec 18, 2018

Conversation

pmuetschard
Copy link
Member

We currently lookup an argument to one of the breakpointed methods by name. However, if the debug info is stripped, the names returned by the JVM debugger are all the empty string. This change makes it possible to look for arguments by index as well. This depends on the fact that the Android debugger always labels the "this" argument with a name[0] and that the arguments are stored in successive slots in the DEX[1].

[0] libdexfile/dex/dex_file-inl.h:236
[1] libdexfile/dex/dex_file-inl.h:254+

We currently lookup an argument to one of the breakpointed methods by
name. However, if the debug info is stripped, the names returned by the
JVM debugger are all the empty string. This change makes it possible to
look for arguments by index as well. This depends on the fact that the
Android debugger always labels the "this" argument with a name[0] and that
the arguments are stored in successive slots in the DEX[1].

[0] https://android.googlesource.com/platform/art/+/39d8c873645df7c956bf306693d95212d1d51906/libdexfile/dex/dex_file-inl.h#236
[1] Same as [0], but lines 254+
@pmuetschard pmuetschard merged commit ac379ad into google:master Dec 18, 2018
@pmuetschard pmuetschard deleted the jdwp branch December 18, 2018 17:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants