1 --- ./gdb/linespec.c 2008-08-27 00:27:33.000000000 +0200
2 +++ ./gdb/linespec.c 2008-08-27 00:53:16.000000000 +0200
3 @@ -284,6 +284,15 @@ find_methods (struct type *t, char *name
7 +add_minsym_members_compar (const void *ap, const void *bp)
9 + const char *a = *(const char **) ap;
10 + const char *b = *(const char **) bp;
12 + return strcmp (a, b);
16 add_minsym_members (const char *class_name,
17 const char *member_name,
18 struct minimal_symbol **msym_arr)
19 @@ -293,6 +302,7 @@ add_minsym_members (const char *class_na
25 /* To find the member, we first cheat and use symbol completion.
26 This will give us a list of all the member names including
27 @@ -307,6 +317,28 @@ add_minsym_members (const char *class_na
28 strcat (completion_name, "(");
29 list = make_symbol_completion_list (completion_name,
31 + if (list == NULL || list[0] == NULL)
33 + xfree (completion_name);
37 + /* Make the list entries unique - Multi-PC breakpoints are already resolved
40 + while (list && list[counter] != NULL)
42 + qsort (list, counter, sizeof (*list), add_minsym_members_compar);
44 + while (src_i + 1 < counter)
46 + if (strcmp (list[src_i], list[src_i + 1]) != 0)
47 + list[dst_i++] = list[src_i];
50 + list[dst_i++] = list[src_i++];
51 + gdb_assert (list[src_i] == NULL);
54 /* Now that we have the list, we generate an array of their
55 corresponding minimal symbols. */
56 @@ -319,6 +351,8 @@ add_minsym_members (const char *class_na
60 +#if 0 /* Multi-PC breakpoints are already resolved by GDB-6.8+. */
62 /* In the case of constructors, there may be in-charge vs not-in-charge
63 constructors. Check for names with $base which indicates not-in-charge
65 @@ -353,6 +387,8 @@ add_minsym_members (const char *class_na
69 +#endif /* Multi-PC breakpoints are already resolved by GDB-6.8+. */
71 xfree (completion_name);