diff options
author | Vladimir Prus <vladimir@codesourcery.com> | 2008-04-06 08:56:37 +0000 |
---|---|---|
committer | Vladimir Prus <vladimir@codesourcery.com> | 2008-04-06 08:56:37 +0000 |
commit | 2b2d9e11a0bd5355936c876a8d14a06d78d4b39e (patch) | |
tree | 96d07737397754779f0b1b68d79a1f6efc8fc08a /gdb/testsuite/gdb.cp/breakpoint.cc | |
parent | 2344873715652bf0296adce9f7f686e914fdd36e (diff) | |
download | gdb-2b2d9e11a0bd5355936c876a8d14a06d78d4b39e.zip gdb-2b2d9e11a0bd5355936c876a8d14a06d78d4b39e.tar.gz gdb-2b2d9e11a0bd5355936c876a8d14a06d78d4b39e.tar.bz2 |
Fix breakpoint condition that use member variables.
* valops.c (check_field): Remove.
(check_field_in): Rename to check_field.
(value_of_this): Use la_name_of_this.
* value.h (check_field): Adjust prototype.
* language.h (la_value_of_this): Rename to la_name_of_this.
* language.c (unknown_language_defn): Specify "this" for
name_of_this.
(auto_language_defn): Likewise.
(local_language_defn): Likewise.
* ada-lang.c (ada_language_defn): Adjust comment.
* c-lang.c (c_language_defn): Adjust comment.
(cplus_language_defn): Specify "this" for name_of_this.
(asm_language_defn): Adjust comment.
(minimal_language_defn): Adjust comment.
* f-lang.c (f_language_defn): Specify NULL for name_of_this.
* jv-lang.c (java_language_defn): Specify "this" for name_of_this.
* m2-lang.c (m2_language_defn): Specify "this" for name_of_this.
* objc-lang.c (objc_language_defn): Specify "self" for
name_of_this.
* p-lang.c (pascal_language_defn): Specify "this" for
name_of_this.
* scm-lang.c (scm_language_defn): Specify NULL for name_of_this.
* symtab.c (lookup_symbol_aux): Lookup "this" in the
proper scope, and check for field in type of "this", without
trying to create a value.
Diffstat (limited to 'gdb/testsuite/gdb.cp/breakpoint.cc')
-rw-r--r-- | gdb/testsuite/gdb.cp/breakpoint.cc | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/gdb/testsuite/gdb.cp/breakpoint.cc b/gdb/testsuite/gdb.cp/breakpoint.cc index c719af2..98b7891 100644 --- a/gdb/testsuite/gdb.cp/breakpoint.cc +++ b/gdb/testsuite/gdb.cp/breakpoint.cc @@ -17,8 +17,26 @@ 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 g = 0; + class C1 { public: + C1(int i) : i_(i) {} + + int foo () + { + return 1; // conditional breakpoint in method + } + + int bar () + { + for (int i = 0; i < 1; ++i) + { + int t = i * 2; + g += t; // conditional breakpoint in method 2 + } + } + class Nested { public: int @@ -27,13 +45,22 @@ public: return 1; } }; + +private: + int i_; }; int main () { C1::Nested c1; - c1.foo(); + c1.foo (); + + C1 c2 (2), c3 (3); + c2.foo (); + c2.bar (); + c3.foo (); + c3.bar (); return 0; } |