From: Keven Boell <keven.boell@intel.com>
To: gdb-patches@sourceware.org
Subject: [PATCH] testsuite: introduce index in varobj child eval.
Date: Tue, 26 Nov 2013 13:35:00 -0000 [thread overview]
Message-ID: <1385467825-5236-1-git-send-email-keven.boell@intel.com> (raw)
In some languages, e.g. fortran, arrays start with index 1
instead 0. This patch changes the MI library to support testing
varobj children of fortran arrays.
2013-11-21 Keven Boell <keven.boell@intel.com>
testsuite/
* lib/mi-support.exp (mi_list_varobj_children_range): Add
call to mi_list_array_varobj_children_with_index.
(mi_list_array_varobj_children_with_index): New function.
Add parameter to specify array start.
Signed-off-by: Keven Boell <keven.boell@intel.com>
---
gdb/testsuite/lib/mi-support.exp | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/gdb/testsuite/lib/mi-support.exp b/gdb/testsuite/lib/mi-support.exp
index 0c3cdbe..a1fdb4a 100644
--- a/gdb/testsuite/lib/mi-support.exp
+++ b/gdb/testsuite/lib/mi-support.exp
@@ -1487,9 +1487,14 @@ proc mi_list_varobj_children_range {varname from to numchildren children testnam
# Verifies that variable object VARNAME has NUMBER children,
# where each one is named $VARNAME.<index-of-child> and has type TYPE.
proc mi_list_array_varobj_children { varname number type testname } {
+ mi_list_array_varobj_children_with_index $varname $number 0 $type $testname
+}
+proc mi_list_array_varobj_children_with_index { varname number start_index type testname } {
set t {}
+ set index $start_index
for {set i 0} {$i < $number} {incr i} {
- lappend t [list $varname.$i $i 0 $type]
+ lappend t [list $varname.$index $index 0 $type]
+ incr index
}
mi_list_varobj_children $varname $t $testname
}
--
1.7.9.5
next reply other threads:[~2013-11-26 12:10 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-26 13:35 Keven Boell [this message]
2013-11-26 16:16 ` Tom Tromey
2013-11-27 13:49 ` Keven Boell
2013-11-27 15:58 ` Tom Tromey
2013-11-28 12:25 ` Keven Boell
2013-12-03 20:24 ` Tom Tromey
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=1385467825-5236-1-git-send-email-keven.boell@intel.com \
--to=keven.boell@intel.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