Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1312)

Unified Diff: gdb/testsuite/gdb.cp/baseenum.cc

Issue 124383005: GDB 7.6.50 (Closed) Base URL: http://git.chromium.org/native_client/nacl-gdb.git@upstream
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gdb/testsuite/gdb.cp/arg-reference.exp ('k') | gdb/testsuite/gdb.cp/baseenum.exp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gdb/testsuite/gdb.cp/baseenum.cc
diff --git a/gdb/testsuite/gdb.cp/expand-sals.cc b/gdb/testsuite/gdb.cp/baseenum.cc
similarity index 57%
copy from gdb/testsuite/gdb.cp/expand-sals.cc
copy to gdb/testsuite/gdb.cp/baseenum.cc
index 71f72f9b05c17e17a4f8decd45f60d6020602400..66e30db5842d0f29b460abef150a1325c6299773 100644
--- a/gdb/testsuite/gdb.cp/expand-sals.cc
+++ b/gdb/testsuite/gdb.cp/baseenum.cc
@@ -1,8 +1,6 @@
/* This testcase is part of GDB, the GNU debugger.
- Copyright (C) 2009-2012 Free Software Foundation, Inc.
-
- This file is part of GDB.
+ Copyright 2003-2013 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
@@ -17,37 +15,66 @@
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
-func ()
+class A
{
- return 42; /* func-line */
-}
+public:
+ enum E {X,Y,Z};
+};
+
+class B1 : public A
+{
+};
-volatile int global_x;
+class B2 : public A
+{
+};
-class A
+class C : public B1, public B2
{
public:
- A ()
- {
- global_x = func (); /* caller-line */
- }
+ void test(E e);
};
-/* class B is here just to make the `func' calling line above having multiple
- instances - multiple locations. Template cannot be used as its instances
- would have different function names which get discarded by GDB
- expand_line_sal_maybe. */
+void C::test(E e)
+{
+ if (e == X) // breakpoint 1
+ {
+ }
+}
-class B : public A
+namespace N
{
-};
+ class A
+ {
+ public:
+ enum E {X, Y, Z};
+ };
-int
-main (void)
+ class B1 {};
+ class B2 : public A {};
+
+ class C : public B1, public B2
+ {
+ public:
+ void test (E e);
+ };
+
+ void
+ C::test (E e)
+ {
+ if (e == X) // breakpoint 2
+ {
+ }
+ }
+}
+
+int main()
{
- A a;
- B b;
+ C c;
+ c.test(A::X);
+ N::C nc;
+ nc.test (N::A::X);
return 0;
}
+
« no previous file with comments | « gdb/testsuite/gdb.cp/arg-reference.exp ('k') | gdb/testsuite/gdb.cp/baseenum.exp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698