From patchwork Thu Feb 15 16:07:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 85824 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 442D6384CB97 for ; Thu, 15 Feb 2024 16:09:26 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from mail-il1-x133.google.com (mail-il1-x133.google.com [IPv6:2607:f8b0:4864:20::133]) by sourceware.org (Postfix) with ESMTPS id B61B13865491 for ; Thu, 15 Feb 2024 16:07:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B61B13865491 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org B61B13865491 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::133 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1708013251; cv=none; b=ok/ncyTgwOBHm4TcXXO6gEzSpxROOg2cOH2V/YN4/1iH40lZGMU8y+4vNemqrSi9Q5znH2yMG+PJaj2WPz92iombN/3RXXR/6NDvwiReO5QLUNU8G6q2tL2cimQ9XAdInQF5LvwhxQIJGMR2lUaGui/B+0zleW//AGiH3qM7NF0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1708013251; c=relaxed/simple; bh=7kHoI5ZnUzErznIDLVOySxALLNU0B1wo8GpsNCsSWpo=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=vRe5HHPSWP2sE6jlHwte5c0K2qN5e4VccKtfEVspOfNnV3bzNN2b+b51xBDOqOlIB5Ma+0hgII+UnD4otTqNJ0CAZwK9QL8NvXIISUvczMVHtA1eWZyopOW2rXyvQ7wKOwHcUFH2jOfWmwwh3ihYLmxwTVvKEJxDiNVTXNPMM+w= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-il1-x133.google.com with SMTP id e9e14a558f8ab-364adc689bdso2984165ab.3 for ; Thu, 15 Feb 2024 08:07:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1708013239; x=1708618039; darn=sourceware.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=GbrD8FTSRE8CkyiG475BbMTf3ua6r64RQB258qkXbvA=; b=NluYmdIfhsao+EYXFeMyOnnLY5g/dzpLQwLfHZvQUEXiGXxwAnGmojVb1JVUWrFs1/ quyprzxApBHWHNCYdQbES0DNnAg1a+cMgQM4WVQPWQthS39w8WA+Tr45ZlQDt8qHFjvd /NmXZwN5lSKU9VQV/BToVKiyBWxWdKcYcNPwOCDEzOfWY0nmi0wkk861SAFN33GzMM35 00TW0qZKSBiW0S2d+i9fVm4m8w1dlJU46Gtf+3PIzr2vV6u4vt8VHSQbakhMJpmsSHRt EUqFSDJ8FNq3b+NThodDUoSLIyib8H0mcKvSa66QutG1WDORNmTS21pJXe9QSeUozwlZ Hd6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708013239; x=1708618039; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=GbrD8FTSRE8CkyiG475BbMTf3ua6r64RQB258qkXbvA=; b=XiPlOEh5CvvEtAJm2UlQ4kvuLIoHva3KuhXT3YrDmK5OLfPkEAQKXvzyxFKMDmA18r AAH/vIf8Tb0FYuXXemsIUaslPuxfbYLs9MB6T/teKXqZ9AGEzTqltBpSrRG4JYr9JKxP FrGgJAkz6w75btx0cbZ3xG1fxslFr8popc7CZBn7J53XknVKEx/+YcMY6GTOZxLngtRf pO2dmi4rdFLT+Vza7JgVTOVtTANgyeCr7iekVROinStyz5vl5JGAyXDSB1+pOzbydzUS lgBRvSJf/A685hSM1l2mwIDxSFScEIAsTv+XFF7CT9TyhdzYG8TyWb1UqcC3J+KsFsq4 LvbQ== X-Gm-Message-State: AOJu0YyexwoFiob8itDeDrn/BrYRyX19pfMTuIW5REHStcDLP/GP6Nbs I7x879CmPqMZINiI/anUUcI7WyMbhi1GwLq4K3fJ7VQubWxVxL+Nr+6ZhBFe3P0E41BBYOEcP8Y = X-Google-Smtp-Source: AGHT+IHA5jEGkn2Ifxsty3A7Warmq0YNSryOvMz2zvtdwfS1AMp3iToz2m7vVyvNaYvhC5dxDtXYNg== X-Received: by 2002:a05:6e02:134e:b0:363:c305:1032 with SMTP id k14-20020a056e02134e00b00363c3051032mr1978167ilr.19.1708013238725; Thu, 15 Feb 2024 08:07:18 -0800 (PST) Received: from localhost.localdomain (71-211-170-195.hlrn.qwest.net. [71.211.170.195]) by smtp.gmail.com with ESMTPSA id q1-20020a056e02096100b003619a43268asm434013ilt.34.2024.02.15.08.07.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 08:07:18 -0800 (PST) From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH v2] Speed up lookup of "type_specific_data" Date: Thu, 15 Feb 2024 09:07:10 -0700 Message-ID: <20240215160710.3999151-1-tromey@adacore.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-Spam-Status: No, score=-11.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org I noticed that "info locals" on a certain large Ada program was very slow. I tracked this down to ada_get_tsd_type expanding nearly every CU in the program. This patch fixes the problem by changing this code to use the more efficient lookup_transparent_type which, unlike the Ada-specific lookup functions, does not try to find all matching instances. Note that I first tried fixing this by changing ada_find_any_type, but this did not work -- I may revisit this approach at some later date. Also note that the copyright dates on the test files are set that way because I copied them from another test. New in v2: the new test failed on the Linaro regression tester. Looking at the logs, it seems that gdb was picking up a 'value' from libgnat: $1 = {} 0xf7e227a4 This version renames the local variable in an attempt to work around this. --- gdb/ada-lang.c | 4 +- gdb/c-lang.c | 6 +- gdb/cp-namespace.c | 4 +- gdb/cp-support.h | 3 +- gdb/language.h | 5 +- gdb/symtab.c | 27 +++++---- gdb/symtab.h | 6 +- gdb/testsuite/gdb.ada/tagged-lookup.exp | 61 ++++++++++++++++++++ gdb/testsuite/gdb.ada/tagged-lookup/foo.adb | 23 ++++++++ gdb/testsuite/gdb.ada/tagged-lookup/pck.adb | 22 +++++++ gdb/testsuite/gdb.ada/tagged-lookup/pck.ads | 21 +++++++ gdb/testsuite/gdb.ada/tagged-lookup/pck2.adb | 21 +++++++ gdb/testsuite/gdb.ada/tagged-lookup/pck2.ads | 22 +++++++ 13 files changed, 204 insertions(+), 21 deletions(-) create mode 100644 gdb/testsuite/gdb.ada/tagged-lookup.exp create mode 100644 gdb/testsuite/gdb.ada/tagged-lookup/foo.adb create mode 100644 gdb/testsuite/gdb.ada/tagged-lookup/pck.adb create mode 100644 gdb/testsuite/gdb.ada/tagged-lookup/pck.ads create mode 100644 gdb/testsuite/gdb.ada/tagged-lookup/pck2.adb create mode 100644 gdb/testsuite/gdb.ada/tagged-lookup/pck2.ads diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index a3fd695e003..59bb64bfb63 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -6469,7 +6469,9 @@ ada_get_tsd_type (struct inferior *inf) struct ada_inferior_data *data = get_ada_inferior_data (inf); if (data->tsd_type == 0) - data->tsd_type = ada_find_any_type ("ada__tags__type_specific_data"); + data->tsd_type + = lookup_transparent_type ("", + SEARCH_TYPE_DOMAIN); return data->tsd_type; } diff --git a/gdb/c-lang.c b/gdb/c-lang.c index ce711c4b4f6..cc33aad088e 100644 --- a/gdb/c-lang.c +++ b/gdb/c-lang.c @@ -935,9 +935,11 @@ class cplus_language : public language_defn } /* See language.h. */ - struct type *lookup_transparent_type (const char *name) const override + struct type *lookup_transparent_type (const char *name, + domain_search_flags flags) + const override { - return cp_lookup_transparent_type (name); + return cp_lookup_transparent_type (name, flags); } /* See language.h. */ diff --git a/gdb/cp-namespace.c b/gdb/cp-namespace.c index 41ab52de54a..fb9fcf8ed6e 100644 --- a/gdb/cp-namespace.c +++ b/gdb/cp-namespace.c @@ -1024,10 +1024,10 @@ cp_lookup_nested_symbol (struct type *parent_type, released version of GCC with such information.) */ struct type * -cp_lookup_transparent_type (const char *name) +cp_lookup_transparent_type (const char *name, domain_search_flags flags) { /* First, try the honest way of looking up the definition. */ - struct type *t = basic_lookup_transparent_type (name); + struct type *t = basic_lookup_transparent_type (name, flags); const char *scope; if (t != NULL) diff --git a/gdb/cp-support.h b/gdb/cp-support.h index f95b6f0f0e2..4015126154b 100644 --- a/gdb/cp-support.h +++ b/gdb/cp-support.h @@ -161,7 +161,8 @@ extern struct block_symbol const struct block *block, const domain_search_flags domain); -struct type *cp_lookup_transparent_type (const char *name); +struct type *cp_lookup_transparent_type (const char *name, + domain_search_flags flags); /* See description in cp-namespace.c. */ diff --git a/gdb/language.h b/gdb/language.h index 5bef965c2c8..19bffcc3a7a 100644 --- a/gdb/language.h +++ b/gdb/language.h @@ -349,9 +349,10 @@ struct language_defn /* Find the definition of the type with the given name. */ - virtual struct type *lookup_transparent_type (const char *name) const + virtual struct type *lookup_transparent_type (const char *name, + domain_search_flags flags) const { - return basic_lookup_transparent_type (name); + return basic_lookup_transparent_type (name, flags); } /* Find all symbols in the current program space matching NAME in diff --git a/gdb/symtab.c b/gdb/symtab.c index 02f5d4f1b3d..aa2de7121cd 100644 --- a/gdb/symtab.c +++ b/gdb/symtab.c @@ -2692,9 +2692,9 @@ symbol::matches (domain_search_flags flags) const /* See symtab.h. */ struct type * -lookup_transparent_type (const char *name) +lookup_transparent_type (const char *name, domain_search_flags flags) { - return current_language->lookup_transparent_type (name); + return current_language->lookup_transparent_type (name, flags); } /* A helper for basic_lookup_transparent_type that interfaces with the @@ -2703,6 +2703,7 @@ lookup_transparent_type (const char *name) static struct type * basic_lookup_transparent_type_quick (struct objfile *objfile, enum block_enum block_index, + domain_search_flags flags, const char *name) { struct compunit_symtab *cust; @@ -2710,7 +2711,7 @@ basic_lookup_transparent_type_quick (struct objfile *objfile, const struct block *block; struct symbol *sym; - cust = objfile->lookup_symbol (block_index, name, SEARCH_STRUCT_DOMAIN); + cust = objfile->lookup_symbol (block_index, name, flags); if (cust == NULL) return NULL; @@ -2718,7 +2719,7 @@ basic_lookup_transparent_type_quick (struct objfile *objfile, block = bv->block (block_index); lookup_name_info lookup_name (name, symbol_name_match_type::FULL); - sym = block_find_symbol (block, lookup_name, SEARCH_STRUCT_DOMAIN, nullptr); + sym = block_find_symbol (block, lookup_name, flags, nullptr); if (sym == nullptr) error_in_psymtab_expansion (block_index, name, cust); gdb_assert (!TYPE_IS_OPAQUE (sym->type ())); @@ -2732,6 +2733,7 @@ basic_lookup_transparent_type_quick (struct objfile *objfile, static struct type * basic_lookup_transparent_type_1 (struct objfile *objfile, enum block_enum block_index, + domain_search_flags flags, const char *name) { const struct blockvector *bv; @@ -2743,8 +2745,7 @@ basic_lookup_transparent_type_1 (struct objfile *objfile, { bv = cust->blockvector (); block = bv->block (block_index); - sym = block_find_symbol (block, lookup_name, SEARCH_STRUCT_DOMAIN, - nullptr); + sym = block_find_symbol (block, lookup_name, flags, nullptr); if (sym != nullptr) { gdb_assert (!TYPE_IS_OPAQUE (sym->type ())); @@ -2762,7 +2763,7 @@ basic_lookup_transparent_type_1 (struct objfile *objfile, global blocks. */ struct type * -basic_lookup_transparent_type (const char *name) +basic_lookup_transparent_type (const char *name, domain_search_flags flags) { struct type *t; @@ -2773,14 +2774,16 @@ basic_lookup_transparent_type (const char *name) for (objfile *objfile : current_program_space->objfiles ()) { - t = basic_lookup_transparent_type_1 (objfile, GLOBAL_BLOCK, name); + t = basic_lookup_transparent_type_1 (objfile, GLOBAL_BLOCK, + flags, name); if (t) return t; } for (objfile *objfile : current_program_space->objfiles ()) { - t = basic_lookup_transparent_type_quick (objfile, GLOBAL_BLOCK, name); + t = basic_lookup_transparent_type_quick (objfile, GLOBAL_BLOCK, + flags, name); if (t) return t; } @@ -2794,14 +2797,16 @@ basic_lookup_transparent_type (const char *name) for (objfile *objfile : current_program_space->objfiles ()) { - t = basic_lookup_transparent_type_1 (objfile, STATIC_BLOCK, name); + t = basic_lookup_transparent_type_1 (objfile, STATIC_BLOCK, + flags, name); if (t) return t; } for (objfile *objfile : current_program_space->objfiles ()) { - t = basic_lookup_transparent_type_quick (objfile, STATIC_BLOCK, name); + t = basic_lookup_transparent_type_quick (objfile, STATIC_BLOCK, + flags, name); if (t) return t; } diff --git a/gdb/symtab.h b/gdb/symtab.h index ca5a5b0f7fd..9c20a20f062 100644 --- a/gdb/symtab.h +++ b/gdb/symtab.h @@ -2307,9 +2307,11 @@ extern void reread_symbols (int from_tty); The type returned must not be opaque -- i.e., must have at least one field defined. */ -extern struct type *lookup_transparent_type (const char *); +extern struct type *lookup_transparent_type + (const char *name, domain_search_flags flags = SEARCH_STRUCT_DOMAIN); -extern struct type *basic_lookup_transparent_type (const char *); +extern struct type *basic_lookup_transparent_type + (const char *name, domain_search_flags flags = SEARCH_STRUCT_DOMAIN); /* Macro for name of symbol to indicate a file compiled with gcc. */ #ifndef GCC_COMPILED_FLAG_SYMBOL diff --git a/gdb/testsuite/gdb.ada/tagged-lookup.exp b/gdb/testsuite/gdb.ada/tagged-lookup.exp new file mode 100644 index 00000000000..708b8aac19e --- /dev/null +++ b/gdb/testsuite/gdb.ada/tagged-lookup.exp @@ -0,0 +1,61 @@ +# Copyright 2024 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 . + +# Check that we can print values of parameters of type 'pointer +# (access) to tagged type'. See PR gdb/22670. + +load_lib "ada.exp" + +require allow_ada_tests + +standard_ada_testfile foo + +if {[gdb_compile_ada "${srcfile}" "${binfile}" executable {debug}] != ""} { + return -1 +} + +clean_restart ${testfile} + +set bp_location [gdb_get_line_number "STOP" ${testdir}/foo.adb] +if {![runto "foo.adb:$bp_location"]} { + return +} + +gdb_test_no_output "set debug symtab-create 1" + +# The idea here is that just a single CU should be expanded while +# searching for the tsd type. +set found_pck 0 +set found_pck2 0 +gdb_test_multiple "print *value" "only one CU expanded" -lbl { + -re ".symtab-create. start_subfile: name = \[^,\]*pck\\.adb, name_for_id = \[^\r\n\]*\r\n" { + set found_pck 1 + exp_continue + } + -re ".symtab-create. start_subfile: name = \[^,\]*pck2\\.adb, name_for_id = \[^\r\n\]*\r\n" { + set found_pck2 1 + exp_continue + } + -re ".symtab-create. start_subfile: name = \[^,\]*, name_for_id = \[^\r\n\]*\r\n" { + exp_continue + } + -re -wrap ".* = \\\(n => $decimal\\\)" { + if {$found_pck + $found_pck2 == 1} { + pass $gdb_test_name + } else { + fail $gdb_test_name + } + } +} diff --git a/gdb/testsuite/gdb.ada/tagged-lookup/foo.adb b/gdb/testsuite/gdb.ada/tagged-lookup/foo.adb new file mode 100644 index 00000000000..35e1aa3a12a --- /dev/null +++ b/gdb/testsuite/gdb.ada/tagged-lookup/foo.adb @@ -0,0 +1,23 @@ +-- Copyright 2017-2024 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; +with Pck2; use Pck2; +procedure Foo is + The_Local_Var : access Top_T2 := new Top_T2'(N => 2); +begin + Inspect (new Top_T'(N => 2)); -- STOP + Inspect2 (The_Local_Var); +end Foo; diff --git a/gdb/testsuite/gdb.ada/tagged-lookup/pck.adb b/gdb/testsuite/gdb.ada/tagged-lookup/pck.adb new file mode 100644 index 00000000000..d5f843a0a29 --- /dev/null +++ b/gdb/testsuite/gdb.ada/tagged-lookup/pck.adb @@ -0,0 +1,22 @@ +-- Copyright 2017-2024 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 Pck2; use Pck2; +package body Pck is + procedure Inspect (Obj: access Top_T'Class) is + begin + null; + end Inspect; +end Pck; diff --git a/gdb/testsuite/gdb.ada/tagged-lookup/pck.ads b/gdb/testsuite/gdb.ada/tagged-lookup/pck.ads new file mode 100644 index 00000000000..7731fe29886 --- /dev/null +++ b/gdb/testsuite/gdb.ada/tagged-lookup/pck.ads @@ -0,0 +1,21 @@ +-- Copyright 2017-2024 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 + type Top_T is tagged record + N : Integer := 1; + end record; + procedure Inspect (Obj: access Top_T'Class); +end Pck; diff --git a/gdb/testsuite/gdb.ada/tagged-lookup/pck2.adb b/gdb/testsuite/gdb.ada/tagged-lookup/pck2.adb new file mode 100644 index 00000000000..87f77e503da --- /dev/null +++ b/gdb/testsuite/gdb.ada/tagged-lookup/pck2.adb @@ -0,0 +1,21 @@ +-- Copyright 2017-2024 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 Pck2 is + procedure Inspect2 (Obj: access Top_T2'Class) is + begin + null; + end Inspect2; +end Pck2; diff --git a/gdb/testsuite/gdb.ada/tagged-lookup/pck2.ads b/gdb/testsuite/gdb.ada/tagged-lookup/pck2.ads new file mode 100644 index 00000000000..c45962b3c5c --- /dev/null +++ b/gdb/testsuite/gdb.ada/tagged-lookup/pck2.ads @@ -0,0 +1,22 @@ +-- Copyright 2017-2024 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; +package Pck2 is + type Top_T2 is tagged record + N : Integer := 1; + end record; + procedure Inspect2 (Obj: access Top_T2'Class); +end Pck2;