diff options
author | David Srbecky <dsrbecky@google.com> | 2015-12-10 13:15:00 +0000 |
---|---|---|
committer | David Srbecky <dsrbecky@google.com> | 2015-12-15 15:11:50 +0000 |
commit | b06e28e5b9fbabe3e69b18f31bf353eaff5d0c1f (patch) | |
tree | 18ff419c6a3b80ecff3125f13b72a8851e848ab0 /dexlist | |
parent | f71b3ade9c99ce2fec2f5049ce9c5968721e1b81 (diff) | |
download | android_art-b06e28e5b9fbabe3e69b18f31bf353eaff5d0c1f.tar.gz android_art-b06e28e5b9fbabe3e69b18f31bf353eaff5d0c1f.tar.bz2 android_art-b06e28e5b9fbabe3e69b18f31bf353eaff5d0c1f.zip |
Refactor DexFile::DecodeDebugInfo.
Split the method into two - one for locals and one for positions.
All uses of the method request only one of the two and it makes the
code slightly cleaner. The position variant requires fewer parameters.
Expose additional line table information which was previously ignored
by the decode method (prologue, epilogue, source file).
Change-Id: Idf8ba98fa58ea0d2103932b5cc0af81365885107
Diffstat (limited to 'dexlist')
-rw-r--r-- | dexlist/dexlist.cc | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/dexlist/dexlist.cc b/dexlist/dexlist.cc index 1d0f75ea92..d20c16919a 100644 --- a/dexlist/dexlist.cc +++ b/dexlist/dexlist.cc @@ -80,10 +80,10 @@ static char* descriptorToDot(const char* str) { * first line in the method, which *should* correspond to the first * entry from the table. (Could also use "min" here.) */ -static bool positionsCb(void* context, u4 /*address*/, u4 lineNum) { +static bool positionsCb(void* context, const DexFile::PositionInfo& entry) { int* pFirstLine = reinterpret_cast<int *>(context); if (*pFirstLine == -1) { - *pFirstLine = lineNum; + *pFirstLine = entry.line_; } return 0; } @@ -92,7 +92,7 @@ static bool positionsCb(void* context, u4 /*address*/, u4 lineNum) { * Dumps a method. */ static void dumpMethod(const DexFile* pDexFile, - const char* fileName, u4 idx, u4 flags, + const char* fileName, u4 idx, u4 flags ATTRIBUTE_UNUSED, const DexFile::CodeItem* pCode, u4 codeOffset) { // Abstract and native methods don't get listed. if (pCode == nullptr || codeOffset == 0) { @@ -121,9 +121,7 @@ static void dumpMethod(const DexFile* pDexFile, // Find the first line. int firstLine = -1; - bool is_static = (flags & kAccStatic) != 0; - pDexFile->DecodeDebugInfo( - pCode, is_static, idx, positionsCb, nullptr, &firstLine); + pDexFile->DecodeDebugPositionInfo(pCode, positionsCb, &firstLine); // Method signature. const Signature signature = pDexFile->GetMethodSignature(pMethodId); |