From c0eac87f844a1e9c8338366d8d4647fcc2c9a2f5 Mon Sep 17 00:00:00 2001 From: Joel Brobecker Date: Fri, 2 Mar 2012 19:31:53 +0000 Subject: [PATCH] Testcase: "info locals" with Ada renamings. gdb/testsuite/ChangeLog: * gdb.ada/info_locals_renaming: New testcase. --- gdb/testsuite/ChangeLog | 4 +++ .../gdb.ada/info_locals_renaming.exp | 36 +++++++++++++++++++ .../gdb.ada/info_locals_renaming/foo.adb | 22 ++++++++++++ .../gdb.ada/info_locals_renaming/pck.adb | 21 +++++++++++ .../gdb.ada/info_locals_renaming/pck.ads | 20 +++++++++++ 5 files changed, 103 insertions(+) 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/ChangeLog b/gdb/testsuite/ChangeLog index be488d8a329..799e04d7cd4 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2012-03-02 Joel Brobecker + + * gdb.ada/info_locals_renaming: New testcase. + 2012-03-02 Tom Tromey * gdb.base/nextoverexit.c: New file. 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 00000000000..a8c646997d3 --- /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 . + +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 00000000000..8f29709a210 --- /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 . + +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 00000000000..e69386df461 --- /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 . + +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 00000000000..c795c4bdd00 --- /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 . + +package Pck is + Global_Variable : Integer := 1; + + procedure Increment (I : in out Integer); +end Pck; -- 2.30.2