OSDN Git Service

ART: Add GENERATE_CFI to the ZygoteHooks debug flags
authorAndreas Gampe <agampe@google.com>
Fri, 24 Apr 2015 23:33:43 +0000 (16:33 -0700)
committerAndreas Gampe <agampe@google.com>
Fri, 24 Apr 2015 23:34:30 +0000 (16:34 -0700)
Add code to understand the implications of the debug.gencfi system
property that forces generation of CFI data.

Change-Id: Ida66f8c1567634d05cfdbba1a982be3684e94369

runtime/native/dalvik_system_ZygoteHooks.cc

index af01a02..8524348 100644 (file)
@@ -65,6 +65,7 @@ static void EnableDebugFeatures(uint32_t debug_flags) {
     DEBUG_ENABLE_SAFEMODE           = 1 << 3,
     DEBUG_ENABLE_JNI_LOGGING        = 1 << 4,
     DEBUG_ENABLE_JIT                = 1 << 5,
+    DEBUG_GENERATE_CFI              = 1 << 6,
   };
 
   Runtime* const runtime = Runtime::Current();
@@ -111,6 +112,12 @@ static void EnableDebugFeatures(uint32_t debug_flags) {
   }
   runtime->GetJITOptions()->SetUseJIT(use_jit);
 
+  const bool generate_cfi = (debug_flags & DEBUG_GENERATE_CFI) != 0;
+  if (generate_cfi) {
+    runtime->AddCompilerOption("--include-cfi");
+    debug_flags &= ~DEBUG_GENERATE_CFI;
+  }
+
   // This is for backwards compatibility with Dalvik.
   debug_flags &= ~DEBUG_ENABLE_ASSERT;