old-cross-binutils/gdb/features/gdb-target.dtd
Doug Evans 8151645076 Extend flags to support multibit and enum bitfields.
gdb/ChangeLog:

	Extend flags to support multibit and enum bitfields.
	NEWS: Document new features.
	* c-typeprint.c (c_type_print_varspec_prefix): Handle TYPE_CODE_FLAGS.
	(c_type_print_varspec_suffix, c_type_print_base): Ditto.
	* gdbtypes.c (arch_flags_type): Don't assume all fields are one bit.
	(append_flags_type_field): New function.
	(append_flags_type_flag): Call it.
	* gdbtypes.h (append_flags_type_field): Declare.
	* target-descriptions.c (struct tdesc_type_flag): Delete.
	(enum tdesc_type_kind) <TDESC_TYPE_BOOL>: New enum value.
	(enum tdesc_type_kind) <TDESC_TYPE_ENUM>: Ditto.
	(struct tdesc_type) <u.f>: Delete.
	(tdesc_predefined_types): Add "bool".
	(tdesc_predefined_type): New function.
	(tdesc_gdb_type): Handle TDESC_TYPE_BOOL, TDESC_TYPE_ENUM.
	Update TDESC_TYPE_FLAGS support.
	(tdesc_free_type): Handle TDESC_TYPE_ENUM.  Update TDESC_TYPE_FLAGS.
	(tdesc_create_flags): Update.
	(tdesc_create_enum): New function.
	(tdesc_add_field): Initialize start,end to -1.
	(tdesc_add_typed_bitfield): New function.
	(tdesc_add_bitfield): Call it.
	(tdesc_add_flag): Allow TDESC_TYPE_STRUCT.  Update.
	(tdesc_add_enum_value): New function.
	(maint_print_c_tdesc_cmd): Fold TDESC_TYPE_FLAGS support into
	TDESC_TYPE_STRUCT.  Handle TDESC_TYPE_ENUM.
	* target-descriptions.h (tdesc_create_enum): Declare.
	(tdesc_add_typed_bitfield, tdesc_add_enum_value): Declare.
	* valprint.c (generic_val_print_enum_1): New function.
	(generic_val_print_enum): Call it.
	(val_print_type_code_flags): Make static.  Handle multibit bitfields
	and enum bitfields.
	* valprint.h (val_print_type_code_flags): Delete.
	* xml-tdesc.c (struct tdesc_parsing_data) <current_type_is_flags>:
	Delete.  All uses removed.
	(tdesc_start_enum): New function.
	(tdesc_start_field): Handle multibit and enum bitfields.
	(tdesc_start_enum_value): New function.
	(enum_value_attributes, enum_children, enum_attributes): New static
	globals.
	(feature_children): Add "enum".
	* features/gdb-target.dtd (enum, evalue): New elements.

gdb/doc/ChangeLog:

	* gdb.texinfo (Target Descriptions): New menu item "Enum Target Types".
	(Target Description Format): Mention enum types.  Update docs on
	flags types.
	(Predefined Target Types): Add "bool".
	(Enum Target Types): New node.

gdb/testsuite/ChangeLog:

	* gdb.xml/extra-regs.xml: Add enum, mixed_flags values.
	* gdb.xml/tdesc-regs.exp (load_description): New arg xml_file.
	All callers updated.  Add tests for enums, mixed flags register.
2016-03-15 14:37:29 -07:00

75 lines
1.7 KiB
DTD

<!-- Copyright (C) 2007-2016 Free Software Foundation, Inc.
Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright
notice and this notice are preserved. -->
<!-- The root element of a GDB target description is <target>. -->
<!-- The osabi and compatible elements were added post GDB 6.8. The version
wasn't bumped, since older GDBs silently ignore unknown elements. -->
<!ELEMENT target (architecture?, osabi?, compatible*, feature*)>
<!ATTLIST target
version CDATA #FIXED "1.0">
<!ELEMENT architecture (#PCDATA)>
<!ELEMENT osabi (#PCDATA)>
<!ELEMENT compatible (#PCDATA)>
<!ELEMENT feature
((vector | flags | struct | union )*, reg*)>
<!ATTLIST feature
name ID #REQUIRED>
<!ELEMENT reg (description*)>
<!ATTLIST reg
name CDATA #REQUIRED
bitsize CDATA #REQUIRED
regnum CDATA #IMPLIED
save-restore (yes | no) 'yes'
type CDATA 'int'
group CDATA #IMPLIED
>
<!ELEMENT vector EMPTY>
<!ATTLIST vector
id CDATA #REQUIRED
type CDATA #REQUIRED
count CDATA #REQUIRED>
<!ELEMENT flags (field+)>
<!ATTLIST flags
id CDATA #REQUIRED
size CDATA #REQUIRED>
<!ELEMENT enum (evalue+)>
<!ATTLIST enum
id CDATA #REQUIRED
size CDATA #REQUIRED>
<!ELEMENT struct (field+)>
<!ATTLIST struct
id CDATA #REQUIRED
size CDATA #IMPLIED>
<!ELEMENT union (field+)>
<!ATTLIST union
id CDATA #REQUIRED>
<!ELEMENT field EMPTY>
<!ATTLIST field
name CDATA #REQUIRED
type CDATA #IMPLIED
start CDATA #IMPLIED
end CDATA #IMPLIED>
<!ELEMENT evalue EMPTY>
<!ATTLIST evalue
name CDATA #REQUIRED
value CDATA #REQUIRED>
<!ENTITY % xinclude SYSTEM "xinclude.dtd">
%xinclude;