From patchwork Thu Mar 23 16:44:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 66815 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 C9951385B51E for ; Thu, 23 Mar 2023 16:45:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C9951385B51E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1679589917; bh=QV7N9kEuPVwlJ1ApvoeLPKP8BInxz9GHWGXun+dpQ7I=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=QLbu5GFYP3bfeddLJCuo5k5XO3aa3xdSYlsba3QqtmVdlvaWEFb9qXkde5ZRTalnp IukWtHD5JJAMU64vuoAukpN+Jfgqrq0XgUISL1zRv82XX3WJELXS8OlnK1owxmEz3q jhPv2oIVFiDhLrqDOIFJpSN1/5Y32ZBEIAWnYG7g= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from mail-io1-xd2e.google.com (mail-io1-xd2e.google.com [IPv6:2607:f8b0:4864:20::d2e]) by sourceware.org (Postfix) with ESMTPS id 044EF3858CDB for ; Thu, 23 Mar 2023 16:44:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 044EF3858CDB Received: by mail-io1-xd2e.google.com with SMTP id d14so7365742ion.9 for ; Thu, 23 Mar 2023 09:44:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679589892; 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=QV7N9kEuPVwlJ1ApvoeLPKP8BInxz9GHWGXun+dpQ7I=; b=q9TXw4vokttBp2aPjHW54VqbbwCFcaj+F/4IMPvTNS5hH6NbXbB2HfV8W+h2Ib2EQe b8llIUy1z+SQDLESOBO2ZAjv8L3BIqASLb8nR8WnyIbWN7ymnn0xDBidAiBljXClf1g5 8JReR/ifYJW8tfz2oYSRORC2Z4B6HWqp1xI3FpXk6LVGerkDkdlwQu/Dv4e9F6d24COk 5i9pLzh5gftOp/w/rV3V0rIhu23czM7IKO6SDabiNecSbd/83fH53dTZjbmb1WOwkNQn QcGph0SKFq6twpM2U+9+0hailqN6TzC7CkkDbIxqZgH9brL/I4WjKPNn88FN5DjuCL80 pamw== X-Gm-Message-State: AO0yUKWSJD1e4FilpFSWLcZ0puzssB5zDyriP/aLc99zcirmcqKL6xHg iFqj3vwlYQYo+GmcH07BHLomptlE4rd55u67nVGtIQ== X-Google-Smtp-Source: AK7set+ZxWUj2bcA/zxu08KP3hRxCbq5F6Z0tiJBDUOrFYon7j56PdOhWlQXTfeAlDBjqV4ZxmQ+SQ== X-Received: by 2002:a5e:c702:0:b0:74c:9cc4:ac0 with SMTP id f2-20020a5ec702000000b0074c9cc40ac0mr6760476iop.14.1679589892236; Thu, 23 Mar 2023 09:44:52 -0700 (PDT) Received: from localhost.localdomain (71-211-185-113.hlrn.qwest.net. [71.211.185.113]) by smtp.gmail.com with ESMTPSA id i7-20020a05663815c700b00406147dad72sm6166560jat.104.2023.03.23.09.44.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Mar 2023 09:44:51 -0700 (PDT) To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH] Add Ada test case for break using a label Date: Thu, 23 Mar 2023 10:44:45 -0600 Message-Id: <20230323164445.2279277-1-tromey@adacore.com> X-Mailer: git-send-email 2.39.1 MIME-Version: 1.0 X-Spam-Status: No, score=-11.7 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 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.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Tom Tromey via Gdb-patches From: Tom Tromey Reply-To: Tom Tromey Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" I noticed there aren't any Ada test cases for setting a breakpoint using a label. This patch adds one, adapted from the AdaCore test suite. --- gdb/testsuite/gdb.ada/break-label.exp | 30 ++++++++++++++++++++++ gdb/testsuite/gdb.ada/break-label/pck.adb | 21 +++++++++++++++ gdb/testsuite/gdb.ada/break-label/pck.ads | 18 +++++++++++++ gdb/testsuite/gdb.ada/break-label/proc.adb | 22 ++++++++++++++++ 4 files changed, 91 insertions(+) create mode 100644 gdb/testsuite/gdb.ada/break-label.exp create mode 100644 gdb/testsuite/gdb.ada/break-label/pck.adb create mode 100644 gdb/testsuite/gdb.ada/break-label/pck.ads create mode 100644 gdb/testsuite/gdb.ada/break-label/proc.adb diff --git a/gdb/testsuite/gdb.ada/break-label.exp b/gdb/testsuite/gdb.ada/break-label.exp new file mode 100644 index 00000000000..15f661c2c9d --- /dev/null +++ b/gdb/testsuite/gdb.ada/break-label.exp @@ -0,0 +1,30 @@ +# Copyright 2023 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" + +require allow_ada_tests + +standard_ada_testfile proc + +if {[gdb_compile_ada "${srcfile}" "${binfile}" executable debug] != ""} { + return -1 +} + +# Ada is case-insensitive, so both of these should work. +foreach_with_prefix name {break_here Break_Here} { + clean_restart ${testfile} + runto "proc:$name" message +} diff --git a/gdb/testsuite/gdb.ada/break-label/pck.adb b/gdb/testsuite/gdb.ada/break-label/pck.adb new file mode 100644 index 00000000000..5ec9187895d --- /dev/null +++ b/gdb/testsuite/gdb.ada/break-label/pck.adb @@ -0,0 +1,21 @@ +-- Copyright 2023 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 Do_Nothing is + begin + null; + end Do_Nothing; +end Pck; diff --git a/gdb/testsuite/gdb.ada/break-label/pck.ads b/gdb/testsuite/gdb.ada/break-label/pck.ads new file mode 100644 index 00000000000..1d26905abdd --- /dev/null +++ b/gdb/testsuite/gdb.ada/break-label/pck.ads @@ -0,0 +1,18 @@ +-- Copyright 2023 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 + procedure Do_Nothing; +end Pck; diff --git a/gdb/testsuite/gdb.ada/break-label/proc.adb b/gdb/testsuite/gdb.ada/break-label/proc.adb new file mode 100644 index 00000000000..d5d15768fdc --- /dev/null +++ b/gdb/testsuite/gdb.ada/break-label/proc.adb @@ -0,0 +1,22 @@ +-- Copyright 2023 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 Proc is +begin + <> + Do_Nothing; +end Proc;