From: Joel Brobecker <brobecker@adacore.com>
To: gdb-patches@sourceware.org
Cc: Joel Brobecker <brobecker@adacore.com>
Subject: [PATCH 3/3] Testcase: "info locals" with Ada renamings.
Date: Wed, 29 Feb 2012 20:07:00 -0000 [thread overview]
Message-ID: <1330546034-27156-4-git-send-email-brobecker@adacore.com> (raw)
In-Reply-To: <1330546034-27156-1-git-send-email-brobecker@adacore.com>
gdb/testsuite/ChangeLog:
* gdb.ada/info_locals_renaming: New testcase.
Tested on x86_64-linux. Will commit if patch #1 or an equilvalent
makes it.
---
gdb/testsuite/gdb.ada/info_locals_renaming.exp | 36 ++++++++++++++++++++
gdb/testsuite/gdb.ada/info_locals_renaming/foo.adb | 22 ++++++++++++
gdb/testsuite/gdb.ada/info_locals_renaming/pck.adb | 21 +++++++++++
gdb/testsuite/gdb.ada/info_locals_renaming/pck.ads | 20 +++++++++++
4 files changed, 99 insertions(+), 0 deletions(-)
create mode 100644 gdb/testsuite/gdb.ada/info_locals_renaming.exp
create mode 100644 gdb/testsuite/gdb.ada/info_locals_renaming/foo.adb
create mode 100644 gdb/testsuite/gdb.ada/info_locals_renaming/pck.adb
create mode 100644 gdb/testsuite/gdb.ada/info_locals_renaming/pck.ads
diff --git a/gdb/testsuite/gdb.ada/info_locals_renaming.exp b/gdb/testsuite/gdb.ada/info_locals_renaming.exp
new file mode 100644
index 0000000..a8c6469
--- /dev/null
+++ b/gdb/testsuite/gdb.ada/info_locals_renaming.exp
@@ -0,0 +1,36 @@
+# Copyright 2012 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"
+
+if { [skip_ada_tests] } { return -1 }
+
+set testdir "info_locals_renaming"
+set testfile "${testdir}/foo"
+set srcfile ${srcdir}/${subdir}/${testfile}.adb
+set binfile ${objdir}/${subdir}/${testfile}
+
+file mkdir ${objdir}/${subdir}/${testdir}
+if {[gdb_compile_ada "${srcfile}" "${binfile}" executable {debug}] != ""} {
+ return -1
+}
+
+clean_restart ${testfile}
+
+set bp_location [gdb_get_line_number "STOP" ${testdir}/foo.adb]
+runto "foo.adb:$bp_location"
+
+gdb_test "info locals" "gv = 1"
+
diff --git a/gdb/testsuite/gdb.ada/info_locals_renaming/foo.adb b/gdb/testsuite/gdb.ada/info_locals_renaming/foo.adb
new file mode 100644
index 0000000..8f29709
--- /dev/null
+++ b/gdb/testsuite/gdb.ada/info_locals_renaming/foo.adb
@@ -0,0 +1,22 @@
+-- Copyright 2012 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 Foo is
+ GV : Integer renames Pck.Global_Variable;
+begin
+ Increment (GV); -- STOP
+end Foo;
diff --git a/gdb/testsuite/gdb.ada/info_locals_renaming/pck.adb b/gdb/testsuite/gdb.ada/info_locals_renaming/pck.adb
new file mode 100644
index 0000000..e69386d
--- /dev/null
+++ b/gdb/testsuite/gdb.ada/info_locals_renaming/pck.adb
@@ -0,0 +1,21 @@
+-- Copyright 2012 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 Increment (I : in out Integer) is
+ begin
+ I := I + 1;
+ end Increment;
+end Pck;
diff --git a/gdb/testsuite/gdb.ada/info_locals_renaming/pck.ads b/gdb/testsuite/gdb.ada/info_locals_renaming/pck.ads
new file mode 100644
index 0000000..c795c4b
--- /dev/null
+++ b/gdb/testsuite/gdb.ada/info_locals_renaming/pck.ads
@@ -0,0 +1,20 @@
+-- Copyright 2012 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 Pck is
+ Global_Variable : Integer := 1;
+
+ procedure Increment (I : in out Integer);
+end Pck;
--
1.7.1
next prev parent reply other threads:[~2012-02-29 20:07 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-29 20:07 Better support for Ada renamings in "info locals" output Joel Brobecker
2012-02-29 20:07 ` [RFA 1/3] language-specific read_var_value for Ada renamings Joel Brobecker
2012-03-01 19:52 ` Tom Tromey
2012-03-01 22:58 ` Joel Brobecker
2012-03-02 14:20 ` Tom Tromey
2012-03-02 19:33 ` Joel Brobecker
2012-02-29 20:07 ` Joel Brobecker [this message]
2012-03-02 19:34 ` [PATCH 3/3] Testcase: "info locals" with " Joel Brobecker
2012-02-29 20:16 ` [commit/Ada 2/3] processId: Do not modify already encoded IDs Joel Brobecker
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=1330546034-27156-4-git-send-email-brobecker@adacore.com \
--to=brobecker@adacore.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