aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Pluzhnikov <ppluzhnikov@google.com>2008-06-06 18:29:52 +0000
committerPaul Pluzhnikov <ppluzhnikov@google.com>2008-06-06 18:29:52 +0000
commitebfe2e3fb6a1078dcbbc4231ddd7ddec365bfe09 (patch)
tree7b05aef107b98dc8e85f5108e106fc862702ba8f
parentfed276330df0721afc7f3df134e958ce4633aa4d (diff)
downloadgdb-ebfe2e3fb6a1078dcbbc4231ddd7ddec365bfe09.zip
gdb-ebfe2e3fb6a1078dcbbc4231ddd7ddec365bfe09.tar.gz
gdb-ebfe2e3fb6a1078dcbbc4231ddd7ddec365bfe09.tar.bz2
2008-06-06 Paul Pluzhnikov <ppluzhnikov@google.com>
* gdb.cp/call-c.exp: Test for incorrect handling of reference to pointer. * gdb.cp/call-c.cc: Likewise.
-rw-r--r--gdb/testsuite/ChangeLog6
-rw-r--r--gdb/testsuite/gdb.cp/call-c.cc11
-rw-r--r--gdb/testsuite/gdb.cp/call-c.exp5
3 files changed, 22 insertions, 0 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index ddfc839..917d930 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+2008-06-06 Paul Pluzhnikov <ppluzhnikov@google.com>
+
+ * gdb.cp/call-c.exp: Test for incorrect handling of reference
+ to pointer.
+ * gdb.cp/call-c.cc: Likewise.
+
2008-06-06 Nick Roberts <nickrob@snap.net.nz>
* gdb.base/annota1.exp (thread_switch): Test for thread-changed
diff --git a/gdb/testsuite/gdb.cp/call-c.cc b/gdb/testsuite/gdb.cp/call-c.cc
index a8119f9..8ab617e 100644
--- a/gdb/testsuite/gdb.cp/call-c.cc
+++ b/gdb/testsuite/gdb.cp/call-c.cc
@@ -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);
}
diff --git a/gdb/testsuite/gdb.cp/call-c.exp b/gdb/testsuite/gdb.cp/call-c.exp
index 7e2d992..494d48f 100644
--- a/gdb/testsuite/gdb.cp/call-c.exp
+++ b/gdb/testsuite/gdb.cp/call-c.exp
@@ -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"