Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Andrew Burgess" <aburgess@broadcom.com>
To: gdb-patches@sourceware.org
Subject: [PATCH 09/12] DWARF value, mark unavailable in bits not bytes.
Date: Mon, 12 Aug 2013 12:30:00 -0000	[thread overview]
Message-ID: <5208D561.8050309@broadcom.com> (raw)
In-Reply-To: <5208D1DF.1090201@broadcom.com>

A later patch revealed that in the dwarf code we're marking
a value unavailable in bytes using a bit based offset and a
byte based size.

Here I switch to using just bits to do the job.

OK to apply?

Thanks,
Andrew

gdb/ChangeLog

2013-08-08  Andrew Burgess <aburgess@broadcom.com>

	* dwarf2loc.c (read_pieced_value): Mark optimized out and
	unavailable in bits not bytes.
	* value.c (mark_value_bits_unavailable): New function.
	(mark_value_bytes_unavailable): Use mark_value_bits_unavailable.
	* value.h (mark_value_bits_unavailable): New function.

diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c
index bae425a..553f720 100644
--- a/gdb/dwarf2loc.c
+++ b/gdb/dwarf2loc.c
@@ -1694,9 +1694,9 @@ read_pieced_value (struct value *v)
 		    memset (buffer, 0, this_size);
  		    if (optim)
-		      mark_value_bytes_optimized_out (v, offset, this_size);
+		      mark_value_bits_optimized_out (v, offset, this_size_bits);
 		    if (unavail)
-		      mark_value_bytes_unavailable (v, offset, this_size);
+		      mark_value_bits_unavailable (v, offset, this_size_bits);
 		  }
 	      }
 	    else
diff --git a/gdb/value.c b/gdb/value.c
index 19ba16c..c41e6e1 100644
--- a/gdb/value.c
+++ b/gdb/value.c
@@ -572,9 +572,17 @@ insert_into_bit_range_vector (VEC(range_s)
**vectorp, int offset, int length)
 void
 mark_value_bytes_unavailable (struct value *value, int offset, int length)
 {
+  mark_value_bits_unavailable (value, offset * TARGET_CHAR_BIT,
+			       length * TARGET_CHAR_BIT);
+}
+
+void
+mark_value_bits_unavailable (struct value *value, int offset, int length)
+{
   insert_into_bit_range_vector (&value->unavailable,
-				offset * TARGET_CHAR_BIT,
-				length * TARGET_CHAR_BIT);
+				offset,
+				length,
+				bit_range_unavailable);
 }
  void
diff --git a/gdb/value.h b/gdb/value.h
index 81c1cc5..8226a0d 100644
--- a/gdb/value.h
+++ b/gdb/value.h
@@ -449,6 +449,12 @@ extern int value_entirely_unavailable (struct value
*value);
 extern void mark_value_bytes_unavailable (struct value *value,
 					  int offset, int length);
 +/* Mark VALUE's content bits starting at OFFSET and extending for
+   LENGTH bits as unavailable.  */
+
+extern void mark_value_bits_unavailable (struct value *value,
+					 int offset, int length);
+
 /* Set contents of OPTIMIZEDP to nonzero if any part of VALUE is optimized
    out, otherwise set to zero.  Set contents of UNAVAILABLEP to nonzero if
    any part of VALUE is unavailable, otherwise set to zero.  */




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

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-12 12:15 [RFC 00/12] Merge value optimized_out and unavailable Andrew Burgess
2013-08-12 12:16 ` [PATCH 01/12] Introduce is_unavailable_error Andrew Burgess
2013-08-12 12:18 ` [PATCH 02/12]: Remove set_value_optimized_out Andrew Burgess
2013-08-12 12:20 ` [PATCH 03/12] Mark optimized out values as non-lazy Andrew Burgess
2013-11-26 16:38   ` Pedro Alves
2013-11-26 19:19     ` Andrew Burgess
2013-08-12 12:22 ` [PATCH 04/12] Introduce OPTIMIZED_OUT_ERROR Andrew Burgess
2013-08-12 12:24 ` [PATCH 05/12] Convert the unavailable to be bit based Andrew Burgess
2013-08-12 12:27 ` [PATCH 06/12] Delete value_bits_valid Andrew Burgess
2013-11-25 21:41   ` [PATCH] Print entirely unavailable struct/union values as a single <unavailable>. (Re: [PATCH 06/12] Delete value_bits_valid.) Pedro Alves
2013-11-26 10:13     ` Andrew Burgess
2013-11-28 20:14       ` Pedro Alves
2013-08-12 12:28 ` [PATCH 07/12] Generic print unavailable or optimized out function Andrew Burgess
2013-08-12 12:29 ` [PATCH 08/12] Replace some value_optimized_out with value_entirely_available Andrew Burgess
2013-11-27 17:52   ` [COMMITTED PATCH 0/2] "set debug frame 1" and not saved registers (was: Re: [PATCH 08/12] Replace some value_optimized_out with value_entirely_available) Pedro Alves
2013-11-27 18:14     ` [PATCH 1/2] Make "set debug frame 1" use the standard print routine for optimized out values Pedro Alves
2013-11-27 18:35     ` [PATCH 2/2] Make "set debug frame 1" output print <not saved> instead of <optimized out> Pedro Alves
2013-11-27 18:41       ` Pedro Alves
2013-11-27 18:53         ` [pushed] Fix type of not saved registers. (was: Re: [PATCH 2/2] Make "set debug frame 1" output print <not saved> instead of <optimized out>.) Pedro Alves
2013-08-12 12:30 ` Andrew Burgess [this message]
2013-08-12 12:31 ` [PATCH 10/12] Merge optimized_out into unavailable vector Andrew Burgess
2013-08-12 12:32 ` [PATCH 11/12] Add test mechanism for value " Andrew Burgess
2013-08-12 12:33 ` [PATCH 12/12] Remove old lval check valid functions Andrew Burgess
2013-08-29 17:21 ` PING: Re: [RFC 00/12] Merge value optimized_out and unavailable Andrew Burgess
2013-11-12  9:37   ` Andrew Burgess
2013-11-29 22:31 ` Pedro Alves
2013-12-04 14:54   ` Andrew Burgess

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=5208D561.8050309@broadcom.com \
    --to=aburgess@broadcom.com \
    --cc=gdb-patches@sourceware.org \
    /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