public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [Ada] Make sure we pass the correct struct value to val_print & co.
@ 2011-01-24 20:36 Pedro Alves
  2011-01-24 21:28 ` Joel Brobecker
  0 siblings, 1 reply; 3+ messages in thread
From: Pedro Alves @ 2011-01-24 20:36 UTC (permalink / raw)
  To: gdb-patches; +Cc: Joel Brobecker

Another patch touching Ada bits.

This makes sure that we pass in the the correct struct value to
val_print & co, because val_print functions need to consult
the value for meta-data about the value contents, such the
value_bits_valid calls, and with later changes, a function
that checks whether contents at a given offset are "available".

This fixes a few cases in the Ada val_print routines I had
caught by inspection.

No regressions on gdb.ada/, FWIW.  Okay to apply?

-- 
Pedro Alves

2011-01-24  Pedro Alves  <pedro@codesourcery.com>

	* ada-valprint.c (val_print_packed_array_elements): Pass the
	correct struct value to val_print.
	(ada_val_print_1): Ditto.

---
 gdb/ada-valprint.c |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

Index: src/gdb/ada-valprint.c
===================================================================
--- src.orig/gdb/ada-valprint.c	2011-01-24 18:44:19.000000000 +0000
+++ src/gdb/ada-valprint.c	2011-01-24 20:13:07.677639998 +0000
@@ -211,7 +211,7 @@ val_print_packed_array_elements (struct
 	  opts.deref_ref = 0;
 	  val_print (elttype, value_contents_for_printing (v0),
 		     value_embedded_offset (v0), 0, stream,
-		     recurse + 1, val, &opts, current_language);
+		     recurse + 1, v0, &opts, current_language);
 	  annotate_elt_rep (i - i0);
 	  fprintf_filtered (stream, _(" <repeats %u times>"), i - i0);
 	  annotate_elt_rep_end ();
@@ -242,7 +242,7 @@ val_print_packed_array_elements (struct
 		}
 	      val_print (elttype, value_contents_for_printing (v0),
 			 value_embedded_offset (v0), 0, stream,
-			 recurse + 1, val, &opts, current_language);
+			 recurse + 1, v0, &opts, current_language);
 	      annotate_elt ();
 	    }
 	}
@@ -708,7 +708,7 @@ ada_val_print_1 (struct type *type, cons
 				value_contents_for_printing (val),
 				value_embedded_offset (val),
 				value_address (val), stream, recurse,
-				NULL, options);
+				val, options);
       value_free_to_mark (mark);
       return retn;
     }
@@ -770,7 +770,7 @@ ada_val_print_1 (struct type *type, cons
 	      return ada_val_print_1 (target_type,
 				      value_contents_for_printing (v),
 				      value_embedded_offset (v), 0,
- 				      stream, recurse + 1, NULL, options);
+ 				      stream, recurse + 1, v, options);
 	    }
 	  else
 	    return ada_val_print_1 (TYPE_TARGET_TYPE (type),
@@ -915,7 +915,7 @@ ada_val_print_1 (struct type *type, cons
                          value_contents_for_printing (deref_val),
                          value_embedded_offset (deref_val),
                          value_address (deref_val), stream, recurse + 1,
-			 original_value, options, current_language);
+			 deref_val, options, current_language);
             }
           else
             fputs_filtered ("(null)", stream);

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Ada] Make sure we pass the correct struct value to val_print & co.
  2011-01-24 20:36 [Ada] Make sure we pass the correct struct value to val_print & co Pedro Alves
@ 2011-01-24 21:28 ` Joel Brobecker
  2011-01-24 21:41   ` Pedro Alves
  0 siblings, 1 reply; 3+ messages in thread
From: Joel Brobecker @ 2011-01-24 21:28 UTC (permalink / raw)
  To: Pedro Alves; +Cc: gdb-patches

> No regressions on gdb.ada/, FWIW.  Okay to apply?

Sure. Thanks for doing that.

> 2011-01-24  Pedro Alves  <pedro@codesourcery.com>
> 
> 	* ada-valprint.c (val_print_packed_array_elements): Pass the
> 	correct struct value to val_print.
> 	(ada_val_print_1): Ditto.

Tested on x86_64-linux.

-- 
Joel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Ada] Make sure we pass the correct struct value to val_print & co.
  2011-01-24 21:28 ` Joel Brobecker
@ 2011-01-24 21:41   ` Pedro Alves
  0 siblings, 0 replies; 3+ messages in thread
From: Pedro Alves @ 2011-01-24 21:41 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: gdb-patches

On Monday 24 January 2011 21:07:56, Joel Brobecker wrote:
> > No regressions on gdb.ada/, FWIW.  Okay to apply?
> 
> Sure. Thanks for doing that.

Thanks, applied.

> 
> > 2011-01-24  Pedro Alves  <pedro@codesourcery.com>
> > 
> > 	* ada-valprint.c (val_print_packed_array_elements): Pass the
> > 	correct struct value to val_print.
> > 	(ada_val_print_1): Ditto.
> 
> Tested on x86_64-linux.

-- 
Pedro Alves

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-01-24 21:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-24 20:36 [Ada] Make sure we pass the correct struct value to val_print & co Pedro Alves
2011-01-24 21:28 ` Joel Brobecker
2011-01-24 21:41   ` Pedro Alves

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).