From 35e1e6ad4b50f1adbe9f93fe467766f042491896 Mon Sep 17 00:00:00 2001 From: Tong Shen Date: Wed, 30 Jul 2014 09:31:22 -0700 Subject: 1. Fix CFI for quick compiled code in x86 & x86_64; 2. Emit CFI in .eh_frame instead of .debug_frame. With CFI, we can correctly unwind past quick generated code. Now gdb should unwind to main() for both x86 & x86_64 host-side ART. Note that it does not work with relocation yet. Testing: 1. art/test/run-test --host --gdb [--64] --no-relocate 005 2. In gdb, run 'b art_quick_invoke_stub', then 'r', then 'c' a few times 3. In gdb, run 'bt'. You should see stack frames down to main() Change-Id: I5350d4097dc3d360a60cb17c94f1d02b99bc58bb --- compiler/compilers.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'compiler/compilers.cc') diff --git a/compiler/compilers.cc b/compiler/compilers.cc index bac1f12823..250924ad30 100644 --- a/compiler/compilers.cc +++ b/compiler/compilers.cc @@ -39,7 +39,7 @@ extern "C" art::CompiledMethod* ArtQuickJniCompileMethod(art::CompilerDriver* dr const art::DexFile& dex_file); // Hack for CFI CIE initialization -extern std::vector* X86CFIInitialization(); +extern std::vector* X86CFIInitialization(bool is_x86_64); void QuickCompiler::Init() const { ArtInitQuickCompilerContext(GetCompilerDriver()); @@ -129,10 +129,10 @@ Backend* QuickCompiler::GetCodeGenerator(CompilationUnit* cu, void* compilation_ std::vector* QuickCompiler::GetCallFrameInformationInitialization( const CompilerDriver& driver) const { if (driver.GetInstructionSet() == kX86) { - return X86CFIInitialization(); + return X86CFIInitialization(false); } if (driver.GetInstructionSet() == kX86_64) { - return X86CFIInitialization(); + return X86CFIInitialization(true); } return nullptr; } -- cgit v1.2.3-59-g8ed1b