public inbox for archer-commits@sourceware.org
help / color / mirror / Atom feed
* [SCM]  archer-jankratochvil-vla: Re: Patch for pascal-dynamic arrays http://sourceware.org/ml/archer/2010-q2/msg00020.html without the int-char change.
@ 2010-05-15 21:09 jkratoch
  0 siblings, 0 replies; only message in thread
From: jkratoch @ 2010-05-15 21:09 UTC (permalink / raw)
  To: archer-commits

The branch, archer-jankratochvil-vla has been updated
       via  b468b41f5c4cf1a5a55fc33402ce4695ace3579c (commit)
       via  c500ea093b2c2d2d23650d197089428b34723c82 (commit)
      from  b9497b56c745769698b9557715f8a1cc84d61d9a (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email.

- Log -----------------------------------------------------------------
commit b468b41f5c4cf1a5a55fc33402ce4695ace3579c
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Sat May 15 23:09:16 2010 +0200

    Re: Patch for pascal-dynamic arrays
    http://sourceware.org/ml/archer/2010-q2/msg00020.html
    without the int-char change.

commit c500ea093b2c2d2d23650d197089428b34723c82
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Sat May 15 23:06:35 2010 +0200

    Revert "gdb/"
    
    This reverts commit b9497b56c745769698b9557715f8a1cc84d61d9a.

-----------------------------------------------------------------------

Summary of changes:
 gdb/valprint.c |   28 ++++++++++++----------------
 1 files changed, 12 insertions(+), 16 deletions(-)

First 500 lines of diff:
diff --git a/gdb/valprint.c b/gdb/valprint.c
index 23e6cef..67e5789 100644
--- a/gdb/valprint.c
+++ b/gdb/valprint.c
@@ -1131,7 +1131,13 @@ val_print_array_elements (struct type *type, const gdb_byte *valaddr,
       return;
     }
   if (address != saved_address)
-    valaddr = NULL;
+    {
+      size_t length = TYPE_LENGTH (type);
+
+      valaddr = xmalloc (length);
+      make_cleanup (xfree, (gdb_byte *) valaddr);
+      read_memory (address, (gdb_byte *) valaddr, length);
+    }
 
   /* Skip typedefs but do not resolve TYPE_DYNAMIC.  */
   elttype = saved_type;
@@ -1188,29 +1194,17 @@ val_print_array_elements (struct type *type, const gdb_byte *valaddr,
 
       rep1 = i + 1;
       reps = 1;
-      while (valaddr && (rep1 < len) &&
+      while ((rep1 < len) &&
 	     !memcmp (valaddr + i * eltlen, valaddr + rep1 * eltlen, eltlen))
 	{
 	  ++reps;
 	  ++rep1;
 	}
 
-      if (valaddr)
-	val_print (elttype, valaddr + i * eltlen, 0, address + i * eltlen,
-		   stream, recurse + 1, options, current_language);
-      else
-	{
-	  char *mem = xmalloc (eltlen);
-	  struct cleanup *back_to = make_cleanup (xfree, mem);
-
-	  read_memory (address + i * eltlen, mem, eltlen);
-	  val_print (elttype, mem, 0, address + i * eltlen, stream, recurse + 1,
-		     options, current_language);
-	  do_cleanups (back_to);
-	}
-
       if (reps > options->repeat_count_threshold)
 	{
+	  val_print (elttype, valaddr + i * eltlen, 0, address + i * eltlen,
+		     stream, recurse + 1, options, current_language);
 	  annotate_elt_rep (reps);
 	  fprintf_filtered (stream, " <repeats %u times>", reps);
 	  annotate_elt_rep_end ();
@@ -1220,6 +1214,8 @@ val_print_array_elements (struct type *type, const gdb_byte *valaddr,
 	}
       else
 	{
+	  val_print (elttype, valaddr + i * eltlen, 0, address + i * eltlen,
+		     stream, recurse + 1, options, current_language);
 	  annotate_elt ();
 	  things_printed++;
 	}


hooks/post-receive
--
Repository for Project Archer.


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-05-15 21:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-05-15 21:09 [SCM] archer-jankratochvil-vla: Re: Patch for pascal-dynamic arrays http://sourceware.org/ml/archer/2010-q2/msg00020.html without the int-char change jkratoch

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).