From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28790 invoked by alias); 28 Feb 2013 18:30:34 -0000 Received: (qmail 28745 invoked by uid 22791); 28 Feb 2013 18:30:31 -0000 X-SWARE-Spam-Status: No, hits=-8.2 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_SPAMHAUS_DROP,KHOP_THREADED,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mga03.intel.com (HELO mga03.intel.com) (143.182.124.21) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 28 Feb 2013 18:30:24 +0000 Received: from azsmga002.ch.intel.com ([10.2.17.35]) by azsmga101.ch.intel.com with ESMTP; 28 Feb 2013 10:30:23 -0800 X-ExtLoop1: 1 Received: from swsutil001.isw.intel.com ([10.237.237.11]) by AZSMGA002.ch.intel.com with ESMTP; 28 Feb 2013 10:30:21 -0800 Received: from ulslx001.iul.intel.com (ulslx001.iul.intel.com [172.28.207.63]) by swsutil001.isw.intel.com (8.13.6/8.13.6/MailSET/Hub) with ESMTP id r1SIUI0W013586; Thu, 28 Feb 2013 18:30:18 GMT Received: from ulslx001.iul.intel.com (localhost [127.0.0.1]) by ulslx001.iul.intel.com with ESMTP id r1SIUIBb015593; Thu, 28 Feb 2013 19:30:18 +0100 Received: (from mgherza1@localhost) by ulslx001.iul.intel.com with id r1SIUIo1015589; Thu, 28 Feb 2013 19:30:18 +0100 From: Mircea Gherzan To: tromey@redhat.com, vladimir@codesourcery.com, marc.khouzam@ericsson.com Cc: gdb-patches@sourceware.org, mgherzan@gmail.com, Mircea Gherzan Subject: [PATCH 2/3] MI: add tests for breakpoints with multiple locations Date: Thu, 28 Feb 2013 18:50:00 -0000 Message-Id: <1362076197-15363-2-git-send-email-mircea.gherzan@intel.com> In-Reply-To: <1362076197-15363-1-git-send-email-mircea.gherzan@intel.com> References: <1362076197-15363-1-git-send-email-mircea.gherzan@intel.com> X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2013-02/txt/msg00755.txt.bz2 2013-02-27 Mircea Gherzan gdb/testsuite: * gdb.mi/overloaded.cc: New file. * gdb.mi/mi-breakpoint-multiple.exp: New file. Signed-off-by: Mircea Gherzan --- gdb/testsuite/gdb.mi/mi-breakpoint-multiple.exp | 46 +++++++++++++++++++++++ gdb/testsuite/gdb.mi/overloaded.cc | 40 ++++++++++++++++++++ 2 files changed, 86 insertions(+), 0 deletions(-) create mode 100644 gdb/testsuite/gdb.mi/mi-breakpoint-multiple.exp create mode 100644 gdb/testsuite/gdb.mi/overloaded.cc diff --git a/gdb/testsuite/gdb.mi/mi-breakpoint-multiple.exp b/gdb/testsuite/gdb.mi/mi-breakpoint-multiple.exp new file mode 100644 index 0000000..bc0419f --- /dev/null +++ b/gdb/testsuite/gdb.mi/mi-breakpoint-multiple.exp @@ -0,0 +1,46 @@ +# Copyright 2012-2013 Free Software Foundation, Inc. +# +# Contributed by Intel Corp. +# +# 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 mi-support.exp + +if {[skip_cplus_tests]} { + return -1 +} + +gdb_exit +if [mi_gdb_start] { + continue +} + +standard_testfile overloaded.cc + +if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } { + untested mi-breakpoint-multiple.exp + return -1 +} + +set line_foo_void_body [gdb_get_line_number "foo_void_body"] +set line_foo_int_body [gdb_get_line_number "foo_int_body"] + +mi_run_to_main + +mi_gdb_test "11-break-insert foo" \ + "11\\^done,bkpt=\{number=\"2\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"\",times=\"0\",original-location=\"foo\",locations=\\\[\{number=\"2\\.1\",enabled=\"y\",addr=\"$hex\",func=\"foo\\(\\)\",file=\".*overloaded.cc\",fullname=\".*overloaded.cc\",line=\"$line_foo_void_body\",thread-groups=\\\[\"i1\"\\\]\},\{number=\"2\\.2\",enabled=\"y\",addr=\"$hex\",func=\"foo\\(int\\)\",file=\".*overloaded.cc\",fullname=\".*overloaded.cc\",line=\"$line_foo_int_body\",thread-groups=\\\[\"i1\"\\\]\}\\\]\}" \ + "insert breakpoint on breakpoint with multiple locations" + +mi_gdb_exit + diff --git a/gdb/testsuite/gdb.mi/overloaded.cc b/gdb/testsuite/gdb.mi/overloaded.cc new file mode 100644 index 0000000..52430d0 --- /dev/null +++ b/gdb/testsuite/gdb.mi/overloaded.cc @@ -0,0 +1,40 @@ +/* This testcase is part of GDB, the GNU debugger. + + Copyright 2012-2013 Free Software Foundation, Inc. + + Contributed by Intel Corp. + + 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 . */ + +int +foo (void) +{ + return 0; /* foo_void_body */ +} + +int +foo (int bar) +{ + return 0; /* foo_int_body */ +} + +int +main (void) +{ + int x = foo (); + + foo (x); + + return 0; +} -- 1.7.1