aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYao Qi <yao.qi@linaro.org>2016-12-02 09:37:30 +0000
committerYao Qi <yao.qi@linaro.org>2016-12-02 09:37:30 +0000
commit4d9a9006139d1ceea787cdda871dff8943e493f0 (patch)
treee52116c2358af3d557f2939ddac9cfdb7c6ac913 /configure
parentDon't handle timeout inside gdb_test_multiple (diff)
downloadbinutils-gdb-4d9a9006139d1ceea787cdda871dff8943e493f0.tar.gz
binutils-gdb-4d9a9006139d1ceea787cdda871dff8943e493f0.tar.bz2
binutils-gdb-4d9a9006139d1ceea787cdda871dff8943e493f0.zip
Add unit test to aarch64 prologue analyzer
We don't have an effective way to test prologue analyzer which is highly dependent on instruction patterns in prologue generated by compiler. GDB prologue analyzer may not handle the new sequences generated by new compiler, or may still handle some sequences that generated by very old compilers which are no longer used. The former is a functionality issue, while the latter is a maintenance issue. The input and output of prologue analyzer is quite clear, so it fits for unit test. The input is series of instructions, and the output are 1) where prologue end, 2) where registers are saved. In aarch64, they are represented in 'struct aarch64_prologue_cache'. This patch refactors aarch64_analyze_prologue so it can read instructions from either real target or test harness. In unit test aarch64_analyze_prologue_test, aarch64_analyze_prologue gets instructions we prepared in the test, as the input of prologue analyzer. Then, we checked various fields in 'struct aarch64_prologue_cache'. gdb: 2016-12-02 Yao Qi <yao.qi@linaro.org> Pedro Alves <palves@redhat.com> * aarch64-tdep.c: Include "selftest.h". (abstract_instruction_reader): New class. (instruction_reader): New class. (aarch64_analyze_prologue): Add new parameter reader. Call reader.read instead of read_memory_unsigned_integer. [GDB_SELF_TEST] (instruction_reader_test): New class. (aarch64_analyze_prologue_test): New function. (_initialize_aarch64_tdep) [GDB_SELF_TEST]: Register selftests::aarch64_analyze_prologue_test. * trad-frame.c (trad_frame_cache_zalloc): (trad_frame_alloc_saved_regs): Add a new function. * trad-frame.h (trad_frame_alloc_saved_regs): Declare.
Diffstat (limited to 'configure')
0 files changed, 0 insertions, 0 deletions