Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Mircea Gherzan <mircea.gherzan@intel.com>
To: tromey@redhat.com, vladimir@codesourcery.com, marc.khouzam@ericsson.com
Cc: gdb-patches@sourceware.org, mgherzan@gmail.com,
	       Mircea Gherzan <mircea.gherzan@intel.com>
Subject: [PATCH 2/3] MI: add tests for breakpoints with multiple locations
Date: Thu, 28 Feb 2013 18:50:00 -0000	[thread overview]
Message-ID: <1362076197-15363-2-git-send-email-mircea.gherzan@intel.com> (raw)
In-Reply-To: <1362076197-15363-1-git-send-email-mircea.gherzan@intel.com>

2013-02-27  Mircea Gherzan  <mircea.gherzan@intel.com>

gdb/testsuite:
	* gdb.mi/overloaded.cc: New file.
	* gdb.mi/mi-breakpoint-multiple.exp: New file.

Signed-off-by: Mircea Gherzan <mircea.gherzan@intel.com>
---
 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. <mircea.gherzan@intel.com>
+#
+# 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 <http://www.gnu.org/licenses/>.
+
+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=\"<MULTIPLE>\",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. <mircea.gherzan@intel.com>
+
+   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 <http://www.gnu.org/licenses/>.  */
+
+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


  reply	other threads:[~2013-02-28 18:30 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-28 18:30 [PATCH 1/3] MI: fix the result of -break-insert " Mircea Gherzan
2013-02-28 18:50 ` Mircea Gherzan [this message]
2013-02-28 18:56 ` [PATCH 3/3] MI: document the format for breakpoints " Mircea Gherzan
2013-02-28 18:59   ` Eli Zaretskii
2013-03-02 16:53 ` [PATCH 1/3] MI: fix the result of -break-insert " André Pönitz
2013-03-07 16:32   ` Mircea Gherzan
2013-03-07 20:54     ` André Pönitz
2013-03-07 21:44       ` Marc Khouzam
2013-03-08  0:15         ` André Pönitz
2013-03-11 15:06           ` Mircea Gherzan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1362076197-15363-2-git-send-email-mircea.gherzan@intel.com \
    --to=mircea.gherzan@intel.com \
    --cc=gdb-patches@sourceware.org \
    --cc=marc.khouzam@ericsson.com \
    --cc=mgherzan@gmail.com \
    --cc=tromey@redhat.com \
    --cc=vladimir@codesourcery.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox