summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Jiakai Zhang <jiakaiz@google.com> 2024-09-16 13:49:03 +0100
committer Treehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com> 2024-09-16 15:48:28 +0000
commit4dad0f3614093667a140963535df5780fec7480b (patch)
treedab7b32e6864a660a02e9cf72d609e81834a94ba
parent3df5451580a6cc40047deb445ad75c75325b92b7 (diff)
Fix the offset discrepancy for --dump-method-and-offset-as-json.
Bug: 154812810 Test: oatdump --oat-file=/system/framework/oat/x86_64/services.odex \ --dump-method-and-offset-as-json Change-Id: Idd9a1b63279218d4d44aa42c66129c884e30fdf0
-rw-r--r--oatdump/oatdump.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/oatdump/oatdump.cc b/oatdump/oatdump.cc
index 1afd606f7d..150bdae416 100644
--- a/oatdump/oatdump.cc
+++ b/oatdump/oatdump.cc
@@ -721,8 +721,9 @@ class OatDumper {
std::string pretty_method = dex_file->PrettyMethod(dex_method_idx, true);
- os << StringPrintf(
- "{\"method\":\"%s\",\"offset\":\"0x%08x\"}\n", pretty_method.c_str(), code_offset);
+ os << StringPrintf("{\"method\":\"%s\",\"offset\":\"0x%08zx\"}\n",
+ pretty_method.c_str(),
+ AdjustOffset(code_offset));
}
}
}