summaryrefslogtreecommitdiffstats
path: root/dexdump
diff options
context:
space:
mode:
authorMathieu Chartier <mathieuc@google.com>2018-09-11 12:35:30 -0700
committerMathieu Chartier <mathieuc@google.com>2018-09-12 11:32:40 -0700
commit3e2e123239952c80e1b37431bf2efbbe07a41940 (patch)
tree153be0dafdbce55b5e5432cb10025b802a637402 /dexdump
parent68851b53e4152d3edaea977573af8bdc0bd23313 (diff)
downloadart-3e2e123239952c80e1b37431bf2efbbe07a41940.tar.gz
art-3e2e123239952c80e1b37431bf2efbbe07a41940.tar.bz2
art-3e2e123239952c80e1b37431bf2efbbe07a41940.zip
Refactor debug info position visiting
Move logic to CodeItemDebugInfoAccessor, makes it easier to modify the debug info format. Test: test-art-host Bug: 112311591 Bug: 77709234 Change-Id: Ice56a88951efa54dc07d88f2c228c01be4670e73
Diffstat (limited to 'dexdump')
-rw-r--r--dexdump/dexdump.cc13
1 files changed, 4 insertions, 9 deletions
diff --git a/dexdump/dexdump.cc b/dexdump/dexdump.cc
index e9b64028de..31bc6e39e8 100644
--- a/dexdump/dexdump.cc
+++ b/dexdump/dexdump.cc
@@ -751,14 +751,6 @@ static void dumpCatches(const DexFile* pDexFile, const DexFile::CodeItem* pCode)
}
/*
- * Callback for dumping each positions table entry.
- */
-static bool dumpPositionsCb(void* /*context*/, const DexFile::PositionInfo& entry) {
- fprintf(gOutFile, " 0x%04x line=%d\n", entry.address_, entry.line_);
- return false;
-}
-
-/*
* Callback for dumping locals table entry.
*/
static void dumpLocalsCb(void* /*context*/, const DexFile::LocalInfo& entry) {
@@ -1201,7 +1193,10 @@ static void dumpCode(const DexFile* pDexFile, u4 idx, u4 flags,
// Positions and locals table in the debug info.
bool is_static = (flags & kAccStatic) != 0;
fprintf(gOutFile, " positions : \n");
- pDexFile->DecodeDebugPositionInfo(accessor.DebugInfoOffset(), dumpPositionsCb, nullptr);
+ accessor.DecodeDebugPositionInfo([&](const DexFile::PositionInfo& entry) {
+ fprintf(gOutFile, " 0x%04x line=%d\n", entry.address_, entry.line_);
+ return false;
+ });
fprintf(gOutFile, " locals : \n");
accessor.DecodeDebugLocalInfo(is_static, idx, dumpLocalsCb, nullptr);
}