diff options
author | Elliott Hughes <enh@google.com> | 2011-06-16 16:55:24 -0700 |
---|---|---|
committer | Elliott Hughes <enh@google.com> | 2011-06-16 17:27:22 -0700 |
commit | fe7f2b3920bf5d66eda262e643245b03df3e57c8 (patch) | |
tree | 723c9bf450e6b3cdfa804682131bf3be649f9a50 /vm/Misc.h | |
parent | e6c0ef210ee6c62cf4c63d50c04f451d5fa505f5 (diff) | |
download | android_dalvik-fe7f2b3920bf5d66eda262e643245b03df3e57c8.tar.gz android_dalvik-fe7f2b3920bf5d66eda262e643245b03df3e57c8.tar.bz2 android_dalvik-fe7f2b3920bf5d66eda262e643245b03df3e57c8.zip |
Improve reference table dumping.
1. Show the newest entry first; I always assume the top is the newest.
2. Use human-readable type names.
3. Improve the human-readable type name code to show _which_ Class (i.e.
java.lang.Class<java.lang.String> rather than just java.lang.Class).
4. Make it clear when we're reporting the number of elements in an array.
5. Show the first few characters of a string.
6. Show the length of a string if we truncate it.
(I've also removed some redundant casts and improved const-correctness.)
Example:
Last 10 entries in JNI local reference table:
16: 0x40f8ec70 java.lang.String "android.permissi... (41 chars)
15: 0x40f8d450 android.os.Parcel
14: 0x40f8eb90 java.lang.String "BlackSurface"
13: 0x408caca0 android.view.SurfaceSession
12: 0x40f8eb60 android.view.Surface
11: 0x406bc6f0 java.lang.Class<com.android.server.SystemServer>
10: 0x406c0278 java.lang.String "com/android/serv... (31 chars)
9: 0x4015d488 dalvik.system.PathClassLoader
8: 0x40148de8 java.lang.Class<java.lang.ClassLoader>
7: 0x406bc560 java.lang.String[]
JNI local reference table summary (17 entries):
6 of java.lang.Class<com.android.server.SystemServer> (5 unique instances)
5 of java.lang.String (5 unique instances)
1 of java.lang.String[]
1 of java.lang.String[] (2 elements)
1 of dalvik.system.PathClassLoader
1 of android.os.Parcel
1 of android.view.SurfaceSession
1 of android.view.Surface
Change-Id: I56494104cd0daada3ecc1e610f1c94df1e11c640
Diffstat (limited to 'vm/Misc.h')
-rw-r--r-- | vm/Misc.h | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -147,6 +147,14 @@ char* dvmDotToSlash(const char* str); */ std::string dvmHumanReadableDescriptor(const char* descriptor); +/** + * Returns a human-readable string form of the name of the class of + * the given object. So given a java.lang.String, the output would + * be "java.lang.String". Given an array of int, the output would be "int[]". + * Given String.class, the output would be "java.lang.Class<java.lang.String>". + */ +std::string dvmHumanReadableType(const Object* obj); + /* * Return a newly-allocated string for the "dot version" of the class * name for the given type descriptor. That is, The initial "L" and |