This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH 0/9 v2] Unit test to gdbarch methods register_to_value and value_to_register
- From: Yao Qi <qiyaoltc at gmail dot com>
- To: gdb-patches at sourceware dot org
- Date: Wed, 10 May 2017 14:10:04 +0100
- Subject: [PATCH 0/9 v2] Unit test to gdbarch methods register_to_value and value_to_register
- Authentication-results: sourceware.org; auth=none
Alan recently has some patches removing/replacing MAX_REGISTER_SIZE, and
they touch some target dependent code that we can't test, which makes
me a little nervous. This patch set adds a unit test to gdbarch methods
register_to_value and value_to_register (in patch #9).
Patches #3 - #6 are to restrict $ARCH_convert_register_p for some cases
only exists in the unit test. Patch #7 fixes a bug found by the unit
test. Patch #8 is a code refactor, to pave the way for patch #9.
Patch #1 and #2 are not changed since V1.
It is the V2 of this patch set, V1 can be found
https://sourceware.org/ml/gdb-patches/2017-04/msg00393.html
There are some changes compared with V1,
- Add some asserts,
- Sub-class regcache and override some methods for unit test,
Regression tested on x86_64-linux and ppc64-linux.
*** BLURB HERE ***
Yao Qi (9):
Clear GDB internal state after each unit test
Use XCNEW gdbarch_tdep
Restrict m68k_convert_register_p
Restrict ia64_convert_register_p
Restrict alpha_convert_register_p
Restrict i387_convert_register_p
Get register contents by register_size instead of TYPE_LENGTH
Move current_regcache to regcache::current_regcache
Add unit test to gdbarch methods register_to_value and
value_to_register
gdb/Makefile.in | 2 +
gdb/alpha-tdep.c | 29 +++------
gdb/avr-tdep.c | 2 +-
gdb/bfin-tdep.c | 2 +-
gdb/cris-tdep.c | 2 +-
gdb/frame.c | 17 ++++++
gdb/frame.h | 8 +++
gdb/ft32-tdep.c | 2 +-
gdb/gdbarch-selftests.c | 159 ++++++++++++++++++++++++++++++++++++++++++++++++
gdb/i387-tdep.c | 8 ++-
gdb/ia64-tdep.c | 1 +
gdb/lm32-tdep.c | 2 +-
gdb/m32r-tdep.c | 2 +-
gdb/m68hc11-tdep.c | 2 +-
gdb/m68k-tdep.c | 20 +++---
gdb/mep-tdep.c | 2 +-
gdb/microblaze-tdep.c | 2 +-
gdb/mips-tdep.c | 2 +-
gdb/mn10300-tdep.c | 2 +-
gdb/moxie-tdep.c | 2 +-
gdb/msp430-tdep.c | 2 +-
gdb/regcache.c | 51 +++++++++-------
gdb/regcache.h | 21 ++++++-
gdb/selftest-arch.c | 4 ++
gdb/selftest.c | 4 ++
gdb/sh64-tdep.c | 2 +-
gdb/v850-tdep.c | 2 +-
27 files changed, 280 insertions(+), 74 deletions(-)
create mode 100644 gdb/gdbarch-selftests.c
--
1.9.1