aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/testsuite')
-rw-r--r--gdb/testsuite/ChangeLog4
-rw-r--r--gdb/testsuite/gdb.ada/mi_var_array.exp52
-rw-r--r--gdb/testsuite/gdb.ada/mi_var_array/bar.adb29
-rw-r--r--gdb/testsuite/gdb.ada/mi_var_array/pck.adb21
-rw-r--r--gdb/testsuite/gdb.ada/mi_var_array/pck.ads19
5 files changed, 125 insertions, 0 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index e8c80da..beb77ea 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2015-01-29 Joel Brobecker <brobecker@adacore.com>
+
+ * gdb.ada/mi_var_array: New testcase.
+
2015-01-27 Doug Evans <dje@google.com>
* gdb.python/py-objfile.exp: Add tests for objfile.username.
diff --git a/gdb/testsuite/gdb.ada/mi_var_array.exp b/gdb/testsuite/gdb.ada/mi_var_array.exp
new file mode 100644
index 0000000..836e5fe
--- /dev/null
+++ b/gdb/testsuite/gdb.ada/mi_var_array.exp
@@ -0,0 +1,52 @@
+# Copyright 2015 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+load_lib "ada.exp"
+
+standard_ada_testfile bar
+
+if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug]] != "" } {
+ return -1
+}
+
+load_lib mi-support.exp
+set MIFLAGS "-i=mi"
+
+gdb_exit
+if [mi_gdb_start] {
+ continue
+}
+
+mi_delete_breakpoints
+mi_gdb_reinitialize_dir $srcdir/$subdir
+mi_gdb_load ${binfile}
+
+if ![mi_run_to_main] then {
+ fail "Cannot run to main, testcase aborted"
+ return 0
+}
+
+set bp_location [gdb_get_line_number "STOP" ${testdir}/bar.adb]
+mi_continue_to_line \
+ "bar.adb:$bp_location" \
+ "stop at start of main Ada procedure"
+
+mi_gdb_test "-var-create vta * vta" \
+ "\\^done,name=\"vta\",numchild=\"2\",.*" \
+ "Create bt varobj"
+
+mi_gdb_test "-var-list-children vta" \
+ "\\^done,numchild=\"2\",children=\\\[child={name=\"vta.n\",exp=\"n\",numchild=\"0\",type=\"bar\\.int\"},child={name=\"vta.f\",exp=\"f\",numchild=\"0\",type=\"array \\(1 .. n\\) of character\"}\\\],.*" \
+ "list vta's children"
diff --git a/gdb/testsuite/gdb.ada/mi_var_array/bar.adb b/gdb/testsuite/gdb.ada/mi_var_array/bar.adb
new file mode 100644
index 0000000..b39d97c
--- /dev/null
+++ b/gdb/testsuite/gdb.ada/mi_var_array/bar.adb
@@ -0,0 +1,29 @@
+-- Copyright 2015 Free Software Foundation, Inc.
+--
+-- This program is free software; you can redistribute it and/or modify
+-- it under the terms of the GNU General Public License as published by
+-- the Free Software Foundation; either version 3 of the License, or
+-- (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+with Pck; use Pck;
+
+procedure Bar is
+ M : Integer := 35;
+ subtype Int is Integer range 0 .. M;
+ type Variant_Type (N : Int := 0) is record
+ F : String(1 .. N) := (others => 'x');
+ end record;
+ type Variant_Type_Access is access all Variant_Type;
+
+ VTA : Variant_Type_Access;
+begin
+ Do_Nothing (VTA'Address); -- STOP
+end Bar;
diff --git a/gdb/testsuite/gdb.ada/mi_var_array/pck.adb b/gdb/testsuite/gdb.ada/mi_var_array/pck.adb
new file mode 100644
index 0000000..3f490ee
--- /dev/null
+++ b/gdb/testsuite/gdb.ada/mi_var_array/pck.adb
@@ -0,0 +1,21 @@
+-- Copyright 2015 Free Software Foundation, Inc.
+--
+-- This program is free software; you can redistribute it and/or modify
+-- it under the terms of the GNU General Public License as published by
+-- the Free Software Foundation; either version 3 of the License, or
+-- (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+package body Pck is
+ procedure Do_Nothing (A : System.Address) is
+ begin
+ null;
+ end Do_Nothing;
+end Pck;
diff --git a/gdb/testsuite/gdb.ada/mi_var_array/pck.ads b/gdb/testsuite/gdb.ada/mi_var_array/pck.ads
new file mode 100644
index 0000000..0ee9ef9
--- /dev/null
+++ b/gdb/testsuite/gdb.ada/mi_var_array/pck.ads
@@ -0,0 +1,19 @@
+-- Copyright 2015 Free Software Foundation, Inc.
+--
+-- This program is free software; you can redistribute it and/or modify
+-- it under the terms of the GNU General Public License as published by
+-- the Free Software Foundation; either version 3 of the License, or
+-- (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+with System;
+package Pck is
+ procedure Do_Nothing (A : System.Address);
+end Pck;