aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.base
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2010-09-30 17:51:39 +0000
committerTom Tromey <tromey@redhat.com>2010-09-30 17:51:39 +0000
commit9ae8282da74ec1fbc0f89d87e645cbaabfa609ce (patch)
treea9242e14a57148f7c249f096ae437ade3f50e6ce /gdb/testsuite/gdb.base
parente7390eec2e49ac9d5bf459e26dcf905aa74c2e07 (diff)
downloadgdb-9ae8282da74ec1fbc0f89d87e645cbaabfa609ce.zip
gdb-9ae8282da74ec1fbc0f89d87e645cbaabfa609ce.tar.gz
gdb-9ae8282da74ec1fbc0f89d87e645cbaabfa609ce.tar.bz2
gdb
* completer.c (count_struct_fields): Handle anonymous structs and unions. (add_struct_fields): Likewise. gdb/testsuite * gdb.base/completion.exp: Test completion through anonymous union. * gdb.base/break1.c (struct some_struct): Add anonymous union.
Diffstat (limited to 'gdb/testsuite/gdb.base')
-rw-r--r--gdb/testsuite/gdb.base/break1.c1
-rw-r--r--gdb/testsuite/gdb.base/completion.exp4
2 files changed, 5 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.base/break1.c b/gdb/testsuite/gdb.base/break1.c
index 93b563a..ab8e00f 100644
--- a/gdb/testsuite/gdb.base/break1.c
+++ b/gdb/testsuite/gdb.base/break1.c
@@ -24,6 +24,7 @@ struct some_struct
{
int a_field;
int b_field;
+ union { int z_field; };
};
struct some_struct values[50];
diff --git a/gdb/testsuite/gdb.base/completion.exp b/gdb/testsuite/gdb.base/completion.exp
index 1f7c214..904ee98 100644
--- a/gdb/testsuite/gdb.base/completion.exp
+++ b/gdb/testsuite/gdb.base/completion.exp
@@ -684,6 +684,10 @@ gdb_expect {
timeout { fail "(timeout) complete 'p &values\[0\] -> a' 2" }
}
+gdb_test "complete p &values\[0\]->z" \
+ "p &values.0.->z_field" \
+ "copmletion of field in anonymous union"
+
# The following tests used to simply try to complete `${objdir}/file',
# and so on. The problem is that ${objdir} can be very long; the
# completed filename may be more than eighty characters wide. When