From 27d41eac62a6a1aa803dfcfba2be61431e7b3d13 Mon Sep 17 00:00:00 2001 From: Yao Qi Date: Wed, 26 Jul 2017 14:55:31 +0100 Subject: Add "maint check xml-descriptions" to test builtin xml target descriptions Now, GDB is able to dynamically create i386-linux target descriptions from features, instead of using pre-generated target descriptions. These pre-generated target descriptions are no longer used by GDB (note that they are still used by GDBserver). This patch add a new maint command "maint check xml-descriptions" to test dynamically generated tdesc are identical to these generated from xml files. gdb: 2017-07-26 Yao Qi * cli/cli-cmds.c (maintenancechecklist): New variable. * gdbcmd.h (maintenancechecklist): Declare it. * i386-linux-tdep.c (_initialize_i386_linux_tdep) [GDB_SELF_TEST]: Call i386_linux_read_description with different masks. * maint.c (maintenance_check_command): New function. (_initialize_maint_cmds): Call add_prefix_cmd. * target-descriptions.c (tdesc_reg): override operator != and ==. (tdesc_type): Likewise. (tdesc_feature): Likewise. (target_desc): Likewise. [GDB_SELF_TEST] (selftests::record_xml_tdesc): New function. (maintenance_check_xml_descriptions): New function. (_initialize_target_descriptions) Add command "xml-descriptions". * target-descriptions.h (selftests::record_xml_tdesc): Declare. gdb/testsuite: 2017-07-26 Yao Qi * gdb.gdb/unittest.exp: Invoke command "maintenance check xml-descriptions". gdb/doc: 2017-07-26 Yao Qi * gdb.texinfo (Maintenance Commands): Document command "maint check xml-descriptions". --- gdb/gdbcmd.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'gdb/gdbcmd.h') diff --git a/gdb/gdbcmd.h b/gdb/gdbcmd.h index fbd0cb9..14c7f4e 100644 --- a/gdb/gdbcmd.h +++ b/gdb/gdbcmd.h @@ -95,6 +95,10 @@ extern struct cmd_list_element *maintenanceinfolist; extern struct cmd_list_element *maintenanceprintlist; +/* Chain containing all defined "maintenance check" subcommands. */ + +extern struct cmd_list_element *maintenancechecklist; + /* Chain containing all defined "maintenance set" subcommands. */ extern struct cmd_list_element *maintenance_set_cmdlist; -- cgit v1.1