Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Walfred Tedeschi <walfred.tedeschi@intel.com>
To: gdb-patches@sourceware.org, walfred.tedeschi@intel.com,
	       mircea.gherzan@intel.com
Subject: [PATCH v3 1/8] Fix conditions in creating a bitfield.
Date: Fri, 30 Aug 2013 09:58:00 -0000	[thread overview]
Message-ID: <1377856683-11267-2-git-send-email-walfred.tedeschi@intel.com> (raw)
In-Reply-To: <1377856683-11267-1-git-send-email-walfred.tedeschi@intel.com>

Bitfields are represented by intervals [start, begin]. It means that for an
interval comprised by only one  bit start and end will be equal.
The present condition does not always hold. On the other hand in target-description.c
(tdesc_gdb_type) bitfield is created when "f->type" is null. The routine
maint_print_maint_print_c_tdesc_cmd is modified to follow the same strategy.

2013-07-31  Walfred Tedeschi  <walfred.tedeschi@intel.com>

	* target-descriptions.c (maint_print_maint_print_c_tdesc_cmd):
	Modified logic of creating a bitfield to be in sync with
	tdesc_gdb_type.

testsuite/

	* maint_print_struct.xml (bitfield): Added bitfield having
	start and end equal 0.

---
 gdb/target-descriptions.c                    |    2 +-
 gdb/testsuite/gdb.xml/maint_print_struct.xml |    1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/gdb/target-descriptions.c b/gdb/target-descriptions.c
index 44ad401..1410c02 100644
--- a/gdb/target-descriptions.c
+++ b/gdb/target-descriptions.c
@@ -1762,7 +1762,7 @@ feature = tdesc_create_feature (result, \"%s\");\n",
 		  /* Going first for implicitly sized types, else part handles
 		     bitfields.  As reported on xml-tdesc.c implicitly sized types
 		     cannot contain a bitfield.  */
-		  if (f->start == 0 && f->end == 0)
+		  if (f->type != NULL)
 		    {
 		      printf_unfiltered
 			("  field_type = tdesc_named_type (feature, \"%s\");\n",
diff --git a/gdb/testsuite/gdb.xml/maint_print_struct.xml b/gdb/testsuite/gdb.xml/maint_print_struct.xml
index 5ef0683..deac300 100644
--- a/gdb/testsuite/gdb.xml/maint_print_struct.xml
+++ b/gdb/testsuite/gdb.xml/maint_print_struct.xml
@@ -15,6 +15,7 @@
   </struct>
 
   <struct id="bitfield" size="8">
+    <field name="field0" start="0" end="0"/>
     <field name="field1" start="24" end="63"/>
     <field name="field2" start="16" end="24"/>
   </struct>
-- 
1.7.10.4


  parent reply	other threads:[~2013-08-30  9:58 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-30  9:58 [PATCH v3 0/8] Intel(R) MPX registers Walfred Tedeschi
2013-08-30  9:58 ` [PATCH v3 4/8] MPX for amd64 Walfred Tedeschi
2013-08-30  9:58 ` [PATCH v3 5/8] Add MPX support to gdbserver Walfred Tedeschi
2013-08-30  9:58 ` Walfred Tedeschi [this message]
2013-08-30  9:58 ` [PATCH v3 8/8] Add MPX feature description to GDB manual Walfred Tedeschi
2013-08-30 12:06   ` Eli Zaretskii
2013-08-30  9:58 ` [PATCH v3 2/8] Add MPX registers XML files Walfred Tedeschi
2013-08-30  9:58 ` [PATCH v3 3/8] Add MPX support for i386 Walfred Tedeschi
2013-08-30  9:58 ` [PATCH v3 7/8] Add MPX registers tests Walfred Tedeschi
2013-08-30  9:58 ` [PATCH v3 6/8] Add pretty-printer for MPX bnd registers Walfred Tedeschi
2013-08-30 12:07 ` [PATCH v3 0/8] Intel(R) MPX registers Eli Zaretskii
2013-09-02 12:18   ` Tedeschi, Walfred

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1377856683-11267-2-git-send-email-walfred.tedeschi@intel.com \
    --to=walfred.tedeschi@intel.com \
    --cc=gdb-patches@sourceware.org \
    --cc=mircea.gherzan@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox