diff options
author | Tong Shen <endlessroad@google.com> | 2014-08-05 01:54:19 -0700 |
---|---|---|
committer | Tong Shen <endlessroad@google.com> | 2014-08-05 11:11:33 -0700 |
commit | 547cdfd21ee21e4ab9ca8692d6ef47c62ee7ea52 (patch) | |
tree | 078d52b6025fc1e42b7343550b0dbbdad69eafac /compiler/elf_writer_quick.cc | |
parent | 8b62dc0f993d0445401655fc274e5225498fa81c (diff) | |
download | art-547cdfd21ee21e4ab9ca8692d6ef47c62ee7ea52.zip art-547cdfd21ee21e4ab9ca8692d6ef47c62ee7ea52.tar.gz art-547cdfd21ee21e4ab9ca8692d6ef47c62ee7ea52.tar.bz2 |
Emit CFI for x86 & x86_64 JNI compiler.
Now for host-side x86 & x86_64 ART, we are able to get complete stacktrace with even mixed C/C++ & Java stack frames.
Testing:
1. art/test/run-test --host --gdb [--64] --no-relocate 005
2. In gdb, run 'b art::Class_classForName' which is implementation of a Java native method, then 'r'
3. In gdb, run 'bt'. You should see stack frames down to main()
Change-Id: I2d17e9aa0f6d42d374b5362a15ea35a2fce96302
Diffstat (limited to 'compiler/elf_writer_quick.cc')
-rw-r--r-- | compiler/elf_writer_quick.cc | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/compiler/elf_writer_quick.cc b/compiler/elf_writer_quick.cc index 12e9401..bb5f7e0 100644 --- a/compiler/elf_writer_quick.cc +++ b/compiler/elf_writer_quick.cc @@ -46,13 +46,6 @@ static void UpdateWord(std::vector<uint8_t>* buf, int offset, int data) { (*buf)[offset+3] = data >> 24; } -static void PushWord(std::vector<uint8_t>* buf, int data) { - buf->push_back(data & 0xff); - buf->push_back((data >> 8) & 0xff); - buf->push_back((data >> 16) & 0xff); - buf->push_back((data >> 24) & 0xff); -} - static void PushHalf(std::vector<uint8_t>* buf, int data) { buf->push_back(data & 0xff); buf->push_back((data >> 8) & 0xff); @@ -842,24 +835,6 @@ void ElfWriterQuick::ReservePatchSpace(std::vector<uint8_t>* buffer, bool debug) } } -static void EncodeUnsignedLeb128(uint32_t data, std::vector<uint8_t>* dst) { - size_t encoded_size = UnsignedLeb128Size(data); - size_t cur_index = dst->size(); - dst->resize(dst->size() + encoded_size); - uint8_t* write_pos = &((*dst)[cur_index]); - uint8_t* write_pos_after = EncodeUnsignedLeb128(write_pos, data); - DCHECK_EQ(static_cast<size_t>(write_pos_after - write_pos), encoded_size); -} - -static void EncodeSignedLeb128(int32_t data, std::vector<uint8_t>* dst) { - size_t encoded_size = SignedLeb128Size(data); - size_t cur_index = dst->size(); - dst->resize(dst->size() + encoded_size); - uint8_t* write_pos = &((*dst)[cur_index]); - uint8_t* write_pos_after = EncodeSignedLeb128(write_pos, data); - DCHECK_EQ(static_cast<size_t>(write_pos_after - write_pos), encoded_size); -} - std::vector<uint8_t>* ConstructCIEFrameX86(bool is_x86_64) { std::vector<uint8_t>*cfi_info = new std::vector<uint8_t>; |