diff options
author | David Srbecky <dsrbecky@google.com> | 2015-06-20 05:01:22 +0100 |
---|---|---|
committer | David Srbecky <dsrbecky@google.com> | 2015-06-20 05:33:36 +0100 |
commit | 7257ece418469b284ae3cf1d9ba6617a62bdfc4f (patch) | |
tree | 27b07749f146bdeb2fb155e167caddd2c04229e9 /compiler | |
parent | 673b4302edf6d1604e69a1427eea5324016bbab2 (diff) | |
download | art-7257ece418469b284ae3cf1d9ba6617a62bdfc4f.zip art-7257ece418469b284ae3cf1d9ba6617a62bdfc4f.tar.gz art-7257ece418469b284ae3cf1d9ba6617a62bdfc4f.tar.bz2 |
Use signed encoding when using relative CFI addresses.
This is required for gdb to work.
libunwind works with either encoding.
(cherry picked from commit 17065880693d1b15ffeb60b9955a2d092839977f)
Bug: 21924613
Change-Id: I4e4f1cf9c65d48fa885a5993eeeed0253a3f2579
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/dwarf/headers.h | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/compiler/dwarf/headers.h b/compiler/dwarf/headers.h index ad315ee..ae57755 100644 --- a/compiler/dwarf/headers.h +++ b/compiler/dwarf/headers.h @@ -54,9 +54,19 @@ void WriteDebugFrameCIE(bool is64bit, writer.PushUleb128(return_address_register.num()); // ubyte in DWARF2. writer.PushUleb128(1); // z: Augmentation data size. if (is64bit) { - writer.PushUint8(address_type | DW_EH_PE_udata8); // R: Pointer encoding. + if (address_type == DW_EH_PE_pcrel) { + writer.PushUint8(DW_EH_PE_pcrel | DW_EH_PE_sdata8); // R: Pointer encoding. + } else { + DCHECK(address_type == DW_EH_PE_absptr); + writer.PushUint8(DW_EH_PE_absptr | DW_EH_PE_udata8); // R: Pointer encoding. + } } else { - writer.PushUint8(address_type | DW_EH_PE_udata4); // R: Pointer encoding. + if (address_type == DW_EH_PE_pcrel) { + writer.PushUint8(DW_EH_PE_pcrel | DW_EH_PE_sdata4); // R: Pointer encoding. + } else { + DCHECK(address_type == DW_EH_PE_absptr); + writer.PushUint8(DW_EH_PE_absptr | DW_EH_PE_udata4); // R: Pointer encoding. + } } writer.PushData(opcodes.data()); writer.Pad(is64bit ? 8 : 4); |