public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] testsuite: introduce index in varobj child eval.
@ 2013-11-26 13:35 Keven Boell
  2013-11-26 16:16 ` Tom Tromey
  0 siblings, 1 reply; 6+ messages in thread
From: Keven Boell @ 2013-11-26 13:35 UTC (permalink / raw)
  To: gdb-patches

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

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

* Re: [PATCH] testsuite: introduce index in varobj child eval.
  2013-11-26 13:35 [PATCH] testsuite: introduce index in varobj child eval Keven Boell
@ 2013-11-26 16:16 ` Tom Tromey
  2013-11-27 13:49   ` Keven Boell
  0 siblings, 1 reply; 6+ messages in thread
From: Tom Tromey @ 2013-11-26 16:16 UTC (permalink / raw)
  To: Keven Boell; +Cc: gdb-patches

>>>>> "Keven" == Keven Boell <keven.boell@intel.com> writes:

Keven>  # Verifies that variable object VARNAME has NUMBER children,
Keven>  # where each one is named $VARNAME.<index-of-child> and has type TYPE.
Keven>  proc mi_list_array_varobj_children { varname number type testname } {
Keven> +     mi_list_array_varobj_children_with_index $varname $number 0 $type $testname
Keven> +}
Keven> +proc mi_list_array_varobj_children_with_index { varname number start_index type testname } {

The new proc should be separated from the previous one by a blank line.
It should have an introductory comment as well.

Also the first line of the new proc is too long.  I think it should be
split in the arglist somewhere.

Tom

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

* Re: [PATCH] testsuite: introduce index in varobj child eval.
  2013-11-26 16:16 ` Tom Tromey
@ 2013-11-27 13:49   ` Keven Boell
  2013-11-27 15:58     ` Tom Tromey
  0 siblings, 1 reply; 6+ messages in thread
From: Keven Boell @ 2013-11-27 13:49 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gdb-patches

Thanks for the feedback. I've attached the updated patch, which 
addresses your comments.

Keven


 From 7c6728c1f92f92b54310ca1d74e113e6300e2ba4 Mon Sep 17 00:00:00 2001
From: Keven Boell <keven.boell@intel.com>
Date: Thu, 21 Nov 2013 10:54:47 +0100
Subject: [PATCH] testsuite: introduce index in varobj child eval.

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 |   11 ++++++++++-
  1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/gdb/testsuite/lib/mi-support.exp 
b/gdb/testsuite/lib/mi-support.exp
index 0c3cdbe..cb7bf90 100644
--- a/gdb/testsuite/lib/mi-support.exp
+++ b/gdb/testsuite/lib/mi-support.exp
@@ -1487,9 +1487,18 @@ 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
+}
+
+# Same as mi_list_array_varobj_children, but allowing to pass a start index
+# for an array.
+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



On 26.11.2013 16:16, Tom Tromey wrote:
>>>>>> "Keven" == Keven Boell <keven.boell@intel.com> writes:
>
> Keven>  # Verifies that variable object VARNAME has NUMBER children,
> Keven>  # where each one is named $VARNAME.<index-of-child> and has type TYPE.
> Keven>  proc mi_list_array_varobj_children { varname number type testname } {
> Keven> +     mi_list_array_varobj_children_with_index $varname $number 0 $type $testname
> Keven> +}
> Keven> +proc mi_list_array_varobj_children_with_index { varname number start_index type testname } {
>
> The new proc should be separated from the previous one by a blank line.
> It should have an introductory comment as well.
>
> Also the first line of the new proc is too long.  I think it should be
> split in the arglist somewhere.
>
> Tom
>

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

* Re: [PATCH] testsuite: introduce index in varobj child eval.
  2013-11-27 13:49   ` Keven Boell
@ 2013-11-27 15:58     ` Tom Tromey
  2013-11-28 12:25       ` Keven Boell
  0 siblings, 1 reply; 6+ messages in thread
From: Tom Tromey @ 2013-11-27 15:58 UTC (permalink / raw)
  To: Keven Boell; +Cc: gdb-patches

>>>>> "Keven" == Keven Boell <keven.boell@linux.intel.com> writes:

Keven> 	* lib/mi-support.exp (mi_list_varobj_children_range): Add
Keven> 	call to mi_list_array_varobj_children_with_index.
Keven> 	(mi_list_array_varobj_children_with_index): New function.
Keven> 	Add parameter to specify array start.

Ok.

Keven> +    mi_list_array_varobj_children_with_index $varname $number 0 $type
Keven> $testname

Your patch got wrapped.

Tom

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

* Re: [PATCH] testsuite: introduce index in varobj child eval.
  2013-11-27 15:58     ` Tom Tromey
@ 2013-11-28 12:25       ` Keven Boell
  2013-12-03 20:24         ` Tom Tromey
  0 siblings, 1 reply; 6+ messages in thread
From: Keven Boell @ 2013-11-28 12:25 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gdb-patches

Looks like my mail client screwed it up. Please see the patch below.
Is it ok to check it in?

Thanks,
Keven

From 5e99f34f1fb0b10715f5558a9dea781d4a14e864 Mon Sep 17 00:00:00 2001
From: Keven Boell <keven.boell@intel.com>
Date: Thu, 21 Nov 2013 10:54:47 +0100
Subject: [PATCH] testsuite: introduce index in varobj child eval.

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.

Change-Id: Ib9e46843ca6302f16ef7cb24df25f9f8c1d11793

Signed-off-by: Keven Boell <keven.boell@intel.com>
---
 gdb/testsuite/lib/mi-support.exp |   11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/gdb/testsuite/lib/mi-support.exp b/gdb/testsuite/lib/mi-support.exp
index 0c3cdbe..cb7bf90 100644
--- a/gdb/testsuite/lib/mi-support.exp
+++ b/gdb/testsuite/lib/mi-support.exp
@@ -1487,9 +1487,18 @@ 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
+}
+
+# Same as mi_list_array_varobj_children, but allowing to pass a start index
+# for an array.
+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



On 27.11.2013 15:53, Tom Tromey wrote:
>>>>>> "Keven" == Keven Boell <keven.boell@linux.intel.com> writes:
> 
> Keven> 	* lib/mi-support.exp (mi_list_varobj_children_range): Add
> Keven> 	call to mi_list_array_varobj_children_with_index.
> Keven> 	(mi_list_array_varobj_children_with_index): New function.
> Keven> 	Add parameter to specify array start.
> 
> Ok.
> 
> Keven> +    mi_list_array_varobj_children_with_index $varname $number 0 $type
> Keven> $testname
> 
> Your patch got wrapped.
> 
> Tom
> 

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

* Re: [PATCH] testsuite: introduce index in varobj child eval.
  2013-11-28 12:25       ` Keven Boell
@ 2013-12-03 20:24         ` Tom Tromey
  0 siblings, 0 replies; 6+ messages in thread
From: Tom Tromey @ 2013-12-03 20:24 UTC (permalink / raw)
  To: Keven Boell; +Cc: gdb-patches

>>>>> "Keven" == Keven Boell <keven.boell@linux.intel.com> writes:

Keven> Looks like my mail client screwed it up. Please see the patch below.
Keven> Is it ok to check it in?

Yes, thanks.

Tom

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

end of thread, other threads:[~2013-12-03 20:24 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-26 13:35 [PATCH] testsuite: introduce index in varobj child eval Keven Boell
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

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