This is the mail archive of the
gdb-cvs@sourceware.org
mailing list for the GDB project.
src/gdb ChangeLog target-descriptions.c testsu ...
- From: wtedeschi at sourceware dot org
- To: gdb-cvs at sourceware dot org
- Date: Tue, 30 Apr 2013 12:33:52 +0000
- Subject: src/gdb ChangeLog target-descriptions.c testsu ...
CVSROOT: /cvs/src
Module name: src
Changes by: wtedeschi@sourceware.org 2013-04-30 12:33:52
Modified files:
gdb : ChangeLog target-descriptions.c
gdb/testsuite : ChangeLog
Added files:
gdb/testsuite/gdb.xml: maint_print_struct.exp
maint_print_struct.xml
Log message:
Fix display of structures/bitfields in register description.
Add support for displaying structures and bitfields for registers when
executing "maint print c-tdesc". This command is also used when
converting the xml target description file into c file.
Example of the behaviour is given below reporting a snipet of the xml file
and a snippet of the c code generated.
XML file contains:
...
<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>
...
Setting this xml file as target description file and
issuing the maintenance print c-tdesc the following output
is obtained:
feature = tdesc_create_feature (result, "extra");
field_type = tdesc_named_type (feature, "int8");
tdesc_create_vector (feature, "v4int8", field_type, 4);
field_type = tdesc_named_type (feature, "int16");
tdesc_create_vector (feature, "v2int16", field_type, 2);
type = tdesc_create_union (feature, "vecint");
field_type = tdesc_named_type (feature, "v4int8");
tdesc_add_field (type, "v4", field_type);
field_type = tdesc_named_type (feature, "v2int16");
tdesc_add_field (type, "v2", field_type);
C output is not supported type "struct1".
This is finally the issue.
2013-03-27 Walfred Tedeschi <walfred.tedeschi@intel.com>
* target-descriptions.c (maint_print_c_tdesc_cmd):
Add case to parse structures as register types and
bitfields.
testsuite/
* gdb.xml/maint_print_struct.exp: New file.
* gdb.xml/maint_print_struct.xml: New file.
Change-Id: I2e20b095d508319c80275e724a9452c7e2834067
Signed-off-by: Walfred Tedeschi <walfred.tedeschi@intel.com>
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/ChangeLog.diff?cvsroot=src&r1=1.15491&r2=1.15492
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/target-descriptions.c.diff?cvsroot=src&r1=1.46&r2=1.47
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/ChangeLog.diff?cvsroot=src&r1=1.3639&r2=1.3640
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/gdb.xml/maint_print_struct.exp.diff?cvsroot=src&r1=NONE&r2=1.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/gdb.xml/maint_print_struct.xml.diff?cvsroot=src&r1=NONE&r2=1.1