summaryrefslogtreecommitdiff
path: root/tools/aapt2/Debug.cpp
diff options
context:
space:
mode:
author TreeHugger Robot <treehugger-gerrit@google.com> 2019-04-16 22:06:24 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2019-04-16 22:06:24 +0000
commitd8ec9971cb4c4f2301790239a7d9bc09d5e50ef1 (patch)
tree9d616736363c9357be089ddc170092570e2970f8 /tools/aapt2/Debug.cpp
parentcb86e128cf58b057a1db2adc3f56fa6c4e587e3b (diff)
parent0c0cedff00534dd9b14306b7c1cdc20ee20efb5e (diff)
Merge "Check value in dump before printing" into qt-dev
Diffstat (limited to 'tools/aapt2/Debug.cpp')
-rw-r--r--tools/aapt2/Debug.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/tools/aapt2/Debug.cpp b/tools/aapt2/Debug.cpp
index 98324850f3f5..3da22b4fb9fa 100644
--- a/tools/aapt2/Debug.cpp
+++ b/tools/aapt2/Debug.cpp
@@ -129,12 +129,20 @@ class ValueBodyPrinter : public ConstValueVisitor {
constexpr uint32_t kMask = android::ResTable_map::TYPE_ENUM | android::ResTable_map::TYPE_FLAGS;
if (attr->type_mask & kMask) {
for (const auto& symbol : attr->symbols) {
- printer_->Print(symbol.symbol.name.value().entry);
- if (symbol.symbol.id) {
- printer_->Print("(");
+ if (symbol.symbol.name) {
+ printer_->Print(symbol.symbol.name.value().entry);
+
+ if (symbol.symbol.id) {
+ printer_->Print("(");
+ printer_->Print(symbol.symbol.id.value().to_string());
+ printer_->Print(")");
+ }
+ } else if (symbol.symbol.id) {
printer_->Print(symbol.symbol.id.value().to_string());
- printer_->Print(")");
+ } else {
+ printer_->Print("???");
}
+
printer_->Println(StringPrintf("=0x%08x", symbol.value));
}
}