From patchwork Sat Nov 10 15:00:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philippe Waroquiers X-Patchwork-Id: 30106 Received: (qmail 66729 invoked by alias); 10 Nov 2018 15:01:05 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 66576 invoked by uid 89); 10 Nov 2018 15:01:03 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.6 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_SHORT, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mailsec107.isp.belgacom.be Received: from mailsec107.isp.belgacom.be (HELO mailsec107.isp.belgacom.be) (195.238.20.103) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 10 Nov 2018 15:01:02 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=skynet.be; i=@skynet.be; q=dns/txt; s=securemail; t=1541862062; x=1573398062; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=kcVVV3tph+Xo3rq9qEKm4t2J14oFxtjuOsr/eKhMcOw=; b=dtoALPVBEJ36y4Gnxv/KTJT2WBfMR+5UIwnn/OgxddaqJnNC+uemdF9G PU7o4lSpcGMKv9SNz8heRAny2SSyRA==; Received: from 110.212-243-81.adsl-dyn.isp.belgacom.be (HELO md.home) ([81.243.212.110]) by relay.skynet.be with ESMTP/TLS/DHE-RSA-AES128-GCM-SHA256; 10 Nov 2018 16:00:54 +0100 From: Philippe Waroquiers To: gdb-patches@sourceware.org Cc: Philippe Waroquiers Subject: [RFAv2 2/2] Test case for 'info variables|functions' with minimal symbols. Date: Sat, 10 Nov 2018 16:00:48 +0100 Message-Id: <20181110150048.21031-3-philippe.waroquiers@skynet.be> In-Reply-To: <20181110150048.21031-1-philippe.waroquiers@skynet.be> References: <20181110150048.21031-1-philippe.waroquiers@skynet.be> MIME-Version: 1.0 X-IsSubscribed: yes 2018-11-10 Philippe Waroquiers * gdb.base/info_minsym.c: New file. * gdb.base/info_minsym.exp: New file. --- gdb/testsuite/gdb.base/info_minsym.c | 29 +++++++++++++++++++++ gdb/testsuite/gdb.base/info_minsym.exp | 36 ++++++++++++++++++++++++++ 2 files changed, 65 insertions(+) create mode 100644 gdb/testsuite/gdb.base/info_minsym.c create mode 100644 gdb/testsuite/gdb.base/info_minsym.exp diff --git a/gdb/testsuite/gdb.base/info_minsym.c b/gdb/testsuite/gdb.base/info_minsym.c new file mode 100644 index 0000000000..3e28fe1b78 --- /dev/null +++ b/gdb/testsuite/gdb.base/info_minsym.c @@ -0,0 +1,29 @@ +/* This testcase is part of GDB, the GNU debugger. + + Copyright 2018 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 . */ + +static int minsym_var; + +static int minsym_fun (void) +{ + minsym_var++; +} + +int +main (void) +{ + return minsym_fun (); +} diff --git a/gdb/testsuite/gdb.base/info_minsym.exp b/gdb/testsuite/gdb.base/info_minsym.exp new file mode 100644 index 0000000000..be4e33132f --- /dev/null +++ b/gdb/testsuite/gdb.base/info_minsym.exp @@ -0,0 +1,36 @@ +# Copyright (C) 2018 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 . + + +# Verify 'info variables|functions' +# shows minimal symbols when no type matching is requested +# does not show minimal symbols when type matching is requested. + +set testfile info_minsym + +standard_testfile info_minsym.c + +# Compile the program without debugging information, to have minimal symbols. +if {[prepare_for_testing "failed to prepare" $testfile $srcfile {c}]} { + return -1 +} + +clean_restart ${testfile} + +gdb_test_no_output "info variables -q -t int minsym" "minsym variables do not match type" +gdb_test_no_output "info functions -q -t int minsym" "minsym functions do not match type" + +gdb_test "info variables -q minsym" "$hex minsym_var" "minsym variables found" +gdb_test "info functions -q minsym" "$hex minsym_fun" "minsym functions found"