old-cross-binutils/gdb/testsuite/gdb.xml/extra-regs.xml
Daniel Jacobowitz f5dff77744 * gdbtypes.c (append_composite_type_field_raw): New.
(append_composite_type_field_aligned): Use the new function.
	* gdbtypes.h (append_composite_type_field_raw): Declare.
	* target-descriptions.c (struct tdesc_type_field): Add start and end.
	(struct tdesc_type_flag): New type.
	(struct tdesc_type): Add TDESC_TYPE_STRUCT and TDESC_TYPE_FLAGS to
	kind.  Add size to u.u.  Add u.f for flags.
	(tdesc_gdb_type): Handle TDESC_TYPE_STRUCT and TDESC_TYPE_FLAGS.
	(tdesc_free_type): Likewise.
	(tdesc_create_struct, tdesc_set_struct_size, tdesc_create_flags): New.
	(tdesc_add_field): Handle TDESC_TYPE_STRUCT.
	(tdesc_add_bitfield, tdesc_add_flag): New.
	* target-descriptions.h (tdesc_create_struct, tdesc_set_struct_size)
	(tdesc_create_flags, tdesc_add_bitfield, tdesc_add_flag): Declare.
	* xml-tdesc.c (struct tdesc_parsing_data): Rename current_union to
	current_type.  Add current_type_size and current_type_is_flags.
	(tdesc_start_union): Clear the new fields.
	(tdesc_start_struct, tdesc_start_flags): New.
	(tdesc_start_field): Handle struct fields, including bitfields.
	(field_attributes): Make type optional.  Add start and end.
	(union_children): Rename to struct_union_children.
	(union_attributes): Rename to struct_union_attributes.  Add optional
	size.
	(flags_attributes): New.
	(feature_children): Add struct and flags.
	* features/gdb-target.dtd: Add flags and struct to features.
	Make field type optional.  Add field start and end.

	doc/
	* gdb.texinfo (Types): Describe <struct> and <flags>.

	testsuite/
	* gdb.xml/extra-regs.xml: Add struct1, struct2, and flags
	types.  Add structreg, bitfields, and flags registers.
	* gdb.xml/tdesc-regs.exp: Test structreg and bitfields
	registers.
2010-03-01 17:19:23 +00:00

34 lines
1 KiB
XML

<target>
<xi:include href="core-regs.xml"/>
<feature name="extra">
<vector id="v4int8" type="int8" count="4"/>
<vector id="v2int16" type="int16" count="2"/>
<union id="vecint">
<field name="v4" type="v4int8"/>
<field name="v2" type="v2int16"/>
</union>
<struct id="struct1">
<field name="v4" type="v4int8"/>
<field name="v2" type="v2int16"/>
</struct>
<struct id="struct2" size="8">
<field name="f1" start="0" end="34"/>
<field name="f2" start="63" end="63"/>
</struct>
<flags id="flags" size="4">
<field name="X" start="0" end="0"/>
<field name="Y" start="2" end="2"/>
</flags>
<reg name="extrareg" bitsize="32"/>
<reg name="uintreg" bitsize="32" type="uint32"/>
<reg name="vecreg" bitsize="32" type="v4int8"/>
<reg name="unionreg" bitsize="32" type="vecint"/>
<reg name="structreg" bitsize="64" type="struct1"/>
<reg name="bitfields" bitsize="64" type="struct2"/>
<reg name="flags" bitsize="32" type="flags"/>
</feature>
</target>