Index: gdb/testsuite/gdb.python/py-explore.cc |
diff --git a/gdb/testsuite/gdb.python/py-breakpoint.c b/gdb/testsuite/gdb.python/py-explore.cc |
similarity index 64% |
copy from gdb/testsuite/gdb.python/py-breakpoint.c |
copy to gdb/testsuite/gdb.python/py-explore.cc |
index d95468adb3c00cec60f5fd716e3e98997a7a89a4..420ba57875e4eb6c62b294be5454ebe828de2918 100644 |
--- a/gdb/testsuite/gdb.python/py-breakpoint.c |
+++ b/gdb/testsuite/gdb.python/py-explore.cc |
@@ -1,6 +1,6 @@ |
/* This testcase is part of GDB, the GNU debugger. |
- Copyright 2010-2012 Free Software Foundation, Inc. |
+ Copyright 2012 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 |
@@ -16,31 +16,39 @@ |
along with this program. If not, see <http://www.gnu.org/licenses/>. |
*/ |
+class A { |
+ public: |
+ virtual ~A() { } |
+}; |
-int result = 0; |
+class B : public A { |
+ public: |
+ virtual ~B() { } |
-int multiply (int i) |
-{ |
- return i * i; |
-} |
- |
-int add (int i) |
-{ |
- return i + i; |
-} |
+ int i; |
+ char c; |
+}; |
+typedef int *int_ptr; |
-int main (int argc, char *argv[]) |
+int |
+func (const A &a) |
{ |
- int foo = 5; |
- int bar = 42; |
- int i; |
+ int val = 10; |
+ int &int_ref = val; |
+ int_ptr ptr = &val; |
+ int_ptr &int_ptr_ref = ptr; |
+ B b; |
- for (i = 0; i < 10; i++) |
- { |
- result += multiply (foo); /* Break at multiply. */ |
- result += add (bar); /* Break at add. */ |
- } |
+ b.i = 10; |
+ b.c = 'a'; |
- return 0; /* Break at end. */ |
+ return 0; /* Break here. */ |
+} |
+ |
+int |
+main () |
+{ |
+ A obj; |
+ return func (obj); |
} |