]> Git Repo - binutils.git/commitdiff
2008-06-06 Paul Pluzhnikov <[email protected]>
authorPaul Pluzhnikov <[email protected]>
Fri, 6 Jun 2008 18:29:52 +0000 (18:29 +0000)
committerPaul Pluzhnikov <[email protected]>
Fri, 6 Jun 2008 18:29:52 +0000 (18:29 +0000)
* gdb.cp/call-c.exp: Test for incorrect handling of reference
to pointer.
* gdb.cp/call-c.cc: Likewise.

gdb/testsuite/ChangeLog
gdb/testsuite/gdb.cp/call-c.cc
gdb/testsuite/gdb.cp/call-c.exp

index ddfc83993b1674281503a2e817fc98cdf6093f37..917d9302463af149a8f52c2b3c57d2f2b978d3b2 100644 (file)
@@ -1,3 +1,9 @@
+2008-06-06  Paul Pluzhnikov  <[email protected]>
+
+       * gdb.cp/call-c.exp: Test for incorrect handling of reference
+       to pointer.
+       * gdb.cp/call-c.cc: Likewise.
+
 2008-06-06  Nick Roberts  <[email protected]>
 
        * gdb.base/annota1.exp (thread_switch): Test for thread-changed
index a8119f93f96f9522b48995f762691321b327347b..8ab617eb0fdf3c91fa2e03a256eceac04c04ab97 100644 (file)
@@ -21,7 +21,18 @@ int func(int x)
    return x;
 }
 
+struct Foo {
+  Foo() : x_(1) { }
+  int func() const { return x_; }
+ private:
+  int x_;
+};
+
 int main()
 {
+    Foo f;
+    Foo *pf = &f;
+    Foo* &rf = pf;
+    rf->func(); /* set breakpoint here */
     return func(0);
 }
index 7e2d992b3f636feb0801f99be5d5ce184e0879de..494d48f03138c04fe4e57e365a9ebe2c74b51ed1 100644 (file)
@@ -43,4 +43,9 @@ gdb_load ${binfile}
 
 runto_main
 
+gdb_test "b [gdb_get_line_number {breakpoint here} ${testfile}.cc ]" \
+        ".*Breakpoint .*call-c.*"
+
 gdb_test "print foo(1)" "\\\$$decimal = 1"
+gdb_test "continue" ".*breakpoint here.*" "continue to bp"
+gdb_test "print rf->func()" "\\\$$decimal = 1"
This page took 0.044993 seconds and 4 git commands to generate.