aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.python/py-breakpoint.c
diff options
context:
space:
mode:
authorPhil Muldoon <pmuldoon@redhat.com>2010-04-09 09:41:43 +0000
committerPhil Muldoon <pmuldoon@redhat.com>2010-04-09 09:41:43 +0000
commitadc368187c7bc29c3c227cf986dd021973ce6eaf (patch)
treec01aaab1fc72d2ea058c1be7c717317312a38b81 /gdb/testsuite/gdb.python/py-breakpoint.c
parente760a81b7959d2d3474f12622be217ff218f5e06 (diff)
downloadgdb-adc368187c7bc29c3c227cf986dd021973ce6eaf.zip
gdb-adc368187c7bc29c3c227cf986dd021973ce6eaf.tar.gz
gdb-adc368187c7bc29c3c227cf986dd021973ce6eaf.tar.bz2
2010-04-09 Phil Muldoon <pmuldoon@redhat.com>
Thiago Jung Bauermann <bauerman@br.ibm.com> Tom Tromey <tromey@redhat.com> * breakpoint.c (condition_command): Simplify. Move condition setting code to ... (set_breakpoint_condition): ... here. New function. * breakpoint.h (set_breakpoint_condition): Declare. * Makefile.in (SUBDIR_PYTHON_OBS): Add py-breakpoint. (SUBDIR_PYTHON_SRCS): Likewise. (py-breakpoint.o): New rule. * python/py-breakpoint.c: New file. * python/python-internal.h (gdbpy_breakpoints) (gdbpy_initialize_breakpoints): Declare. (GDB_PY_SET_HANDLE_EXCEPTION) Define. 2010-04-09 Phil Muldoon <pmuldoon@redhat.com> * gdb.python/py-breakpoint.exp: New File. * gdb.python/py-breakpoint.C: Ditto. 2010-04-09 Phil Muldoon <pmuldoon@redhat.com> Thiago Jung Bauermann <bauerman@br.ibm.com> Tom Tromey <tromey@redhat.com> * gdb.texinfo (Breakpoints In Python): New Node.
Diffstat (limited to 'gdb/testsuite/gdb.python/py-breakpoint.c')
-rw-r--r--gdb/testsuite/gdb.python/py-breakpoint.c46
1 files changed, 46 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.python/py-breakpoint.c b/gdb/testsuite/gdb.python/py-breakpoint.c
new file mode 100644
index 0000000..b2ad81b
--- /dev/null
+++ b/gdb/testsuite/gdb.python/py-breakpoint.c
@@ -0,0 +1,46 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2010 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 <http://www.gnu.org/licenses/>.
+*/
+
+
+
+int multiply (int i)
+{
+ return i * i;
+}
+
+int add (int i)
+{
+ return i + i;
+}
+
+
+int main (int argc, char *argv[])
+{
+ int foo = 5;
+ int bar = 42;
+ int result = 0;
+ int i;
+
+ for (i = 0; i < 10; i++)
+ {
+ result += multiply (foo); /* Break at multiply. */
+ result += add (bar); /* Break at add. */
+ }
+
+ return 0; /* Break at end. */
+}