From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10704 invoked by alias); 14 Dec 2010 17:13:41 -0000 Mailing-List: contact archer-commits-help@sourceware.org; run by ezmlm Sender: Precedence: bulk List-Post: List-Help: List-Subscribe: Received: (qmail 10660 invoked by uid 9674); 14 Dec 2010 17:13:39 -0000 Date: Tue, 14 Dec 2010 17:13:00 -0000 Message-ID: <20101214171338.10643.qmail@sourceware.org> From: jkratoch@sourceware.org To: archer-commits@sourceware.org Subject: [SCM] master: Merge remote branch 'gdb/master' X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: a3422d9d1cf66dbfd75f1139fe924aba4133afd9 X-Git-Newrev: 38cdd2f1951b882ce68ff310f85e234a2450ddce X-SW-Source: 2010-q4/txt/msg00127.txt.bz2 List-Id: The branch, master has been updated via 38cdd2f1951b882ce68ff310f85e234a2450ddce (commit) via a3568256dd143fe7badf11635b4607c26731325b (commit) via 9ece7f002e466d35387177497d5991e55ddd04d6 (commit) from a3422d9d1cf66dbfd75f1139fe924aba4133afd9 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email. - Log ----------------------------------------------------------------- commit 38cdd2f1951b882ce68ff310f85e234a2450ddce Merge: a3422d9 a356825 Author: Jan Kratochvil Date: Tue Dec 14 18:13:28 2010 +0100 Merge remote branch 'gdb/master' commit a3568256dd143fe7badf11635b4607c26731325b Author: H.J. Lu Date: Tue Dec 14 14:50:41 2010 +0000 Move gdb ChangeLog entry to gdb/ChangeLog. commit 9ece7f002e466d35387177497d5991e55ddd04d6 Author: kwerner Date: Tue Dec 14 10:23:40 2010 +0000 gdb: * valops.c (value_one): Use get_array_bounds to compute the number of array elements instead of dividing the length of the array by the length of the element types. * valarith.c (value_complement, value_neg): Likewise. ----------------------------------------------------------------------- Summary of changes: gdb/ChangeLog | 7 +++++++ gdb/valarith.c | 16 ++++++++++++---- gdb/valops.c | 8 ++++++-- 3 files changed, 25 insertions(+), 6 deletions(-) First 500 lines of diff: diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 379beb2..002f3d2 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,10 @@ +2010-12-14 Ken Werner + + * valops.c (value_one): Use get_array_bounds to compute the number + of array elements instead of dividing the length of the array by the + length of the element types. + * valarith.c (value_complement, value_neg): Likewise. + 2010-12-14 Joel Brobecker * irix5-nat.c: Replace fp_r, fp_regs and fp_scr by __fp_r, __fp_regs diff --git a/gdb/valarith.c b/gdb/valarith.c index 36e937d..6b212b2 100644 --- a/gdb/valarith.c +++ b/gdb/valarith.c @@ -1766,9 +1766,13 @@ value_neg (struct value *arg1) { struct value *tmp, *val = allocate_value (type); struct type *eltype = check_typedef (TYPE_TARGET_TYPE (type)); - int i, n = TYPE_LENGTH (type) / TYPE_LENGTH (eltype); + int i; + LONGEST low_bound, high_bound; - for (i = 0; i < n; i++) + if (!get_array_bounds (type, &low_bound, &high_bound)) + error (_("Could not determine the vector bounds")); + + for (i = 0; i < high_bound - low_bound + 1; i++) { tmp = value_neg (value_subscript (arg1, i)); memcpy (value_contents_writeable (val) + i * TYPE_LENGTH (eltype), @@ -1798,10 +1802,14 @@ value_complement (struct value *arg1) { struct value *tmp; struct type *eltype = check_typedef (TYPE_TARGET_TYPE (type)); - int i, n = TYPE_LENGTH (type) / TYPE_LENGTH (eltype); + int i; + LONGEST low_bound, high_bound; + + if (!get_array_bounds (type, &low_bound, &high_bound)) + error (_("Could not determine the vector bounds")); val = allocate_value (type); - for (i = 0; i < n; i++) + for (i = 0; i < high_bound - low_bound + 1; i++) { tmp = value_complement (value_subscript (arg1, i)); memcpy (value_contents_writeable (val) + i * TYPE_LENGTH (eltype), diff --git a/gdb/valops.c b/gdb/valops.c index dfadad8..7ea6315 100644 --- a/gdb/valops.c +++ b/gdb/valops.c @@ -877,11 +877,15 @@ value_one (struct type *type, enum lval_type lv) else if (TYPE_CODE (type1) == TYPE_CODE_ARRAY && TYPE_VECTOR (type1)) { struct type *eltype = check_typedef (TYPE_TARGET_TYPE (type1)); - int i, n = TYPE_LENGTH (type1) / TYPE_LENGTH (eltype); + int i; + LONGEST low_bound, high_bound; struct value *tmp; + if (!get_array_bounds (type1, &low_bound, &high_bound)) + error (_("Could not determine the vector bounds")); + val = allocate_value (type); - for (i = 0; i < n; i++) + for (i = 0; i < high_bound - low_bound + 1; i++) { tmp = value_one (eltype, lv); memcpy (value_contents_writeable (val) + i * TYPE_LENGTH (eltype), hooks/post-receive -- Repository for Project Archer.