GNU Binutils with patches for OS216
Révision | 19ef5c713c0116f2e15fea28168614d7894b613a (tree) |
---|---|
l'heure | 2009-06-17 03:39:41 |
Auteur | Keith Seitz <keiths@redh...> |
Commiter | Keith Seitz |
* linespec.c (collect_methods): Delete.
(add_matching_methods): Reove destructor special case.
(find_method): Call find_methods directly instead of
collect_methods.
* valops.c (value_struct_elt): Remove destructor
special cases.
(check_field): Likewise.
(value_struct_elt_for_reference): Likewise.
(destructor_name_p): Remove misleading comment about dtors
being "special cases".
* gdbtypes.h (get_destructor_fn_field): Remove. No longer needed.
* gdbtypes.c (get_destructor_fn_field): Likewise.
@@ -1,3 +1,18 @@ | ||
1 | +2009-06-16 Keith Seitz <keiths@redhat.com> | |
2 | + | |
3 | + * linespec.c (collect_methods): Delete. | |
4 | + (add_matching_methods): Reove destructor special case. | |
5 | + (find_method): Call find_methods directly instead of | |
6 | + collect_methods. | |
7 | + * valops.c (value_struct_elt): Remove destructor | |
8 | + special cases. | |
9 | + (check_field): Likewise. | |
10 | + (value_struct_elt_for_reference): Likewise. | |
11 | + (destructor_name_p): Remove misleading comment about dtors | |
12 | + being "special cases". | |
13 | + * gdbtypes.h (get_destructor_fn_field): Remove. No longer needed. | |
14 | + * gdbtypes.c (get_destructor_fn_field): Likewise. | |
15 | + | |
1 | 16 | 2009-06-16 Pedro Alves <pedro@codesourcery.com> |
2 | 17 | |
3 | 18 | * mi/mi-main.c (mi_cmd_data_read_memory): Dispatch |
@@ -1334,34 +1334,6 @@ get_vptr_fieldno (struct type *type, struct type **basetypep) | ||
1334 | 1334 | } |
1335 | 1335 | } |
1336 | 1336 | |
1337 | -/* Find the method and field indices for the destructor in class type T. | |
1338 | - Return 1 if the destructor was found, otherwise, return 0. */ | |
1339 | - | |
1340 | -int | |
1341 | -get_destructor_fn_field (struct type *t, | |
1342 | - int *method_indexp, | |
1343 | - int *field_indexp) | |
1344 | -{ | |
1345 | - int i; | |
1346 | - | |
1347 | - for (i = 0; i < TYPE_NFN_FIELDS (t); i++) | |
1348 | - { | |
1349 | - int j; | |
1350 | - struct fn_field *f = TYPE_FN_FIELDLIST1 (t, i); | |
1351 | - | |
1352 | - for (j = 0; j < TYPE_FN_FIELDLIST_LENGTH (t, i); j++) | |
1353 | - { | |
1354 | - if (is_destructor_name (TYPE_FN_FIELD_PHYSNAME (f, j)) != 0) | |
1355 | - { | |
1356 | - *method_indexp = i; | |
1357 | - *field_indexp = j; | |
1358 | - return 1; | |
1359 | - } | |
1360 | - } | |
1361 | - } | |
1362 | - return 0; | |
1363 | -} | |
1364 | - | |
1365 | 1337 | static void |
1366 | 1338 | stub_noname_complaint (void) |
1367 | 1339 | { |
@@ -1202,8 +1202,6 @@ extern struct type *lookup_template_type (char *, struct type *, | ||
1202 | 1202 | |
1203 | 1203 | extern int get_vptr_fieldno (struct type *, struct type **); |
1204 | 1204 | |
1205 | -extern int get_destructor_fn_field (struct type *, int *, int *); | |
1206 | - | |
1207 | 1205 | extern int get_discrete_bounds (struct type *, LONGEST *, LONGEST *); |
1208 | 1206 | |
1209 | 1207 | extern int is_ancestor (struct type *, struct type *); |
@@ -76,10 +76,6 @@ static struct symtabs_and_lines find_method (int funfirstline, | ||
76 | 76 | struct type *t, |
77 | 77 | struct symbol *sym_class); |
78 | 78 | |
79 | -static int collect_methods (char *copy, struct type *t, | |
80 | - struct symbol *sym_class, | |
81 | - struct symbol **sym_arr); | |
82 | - | |
83 | 79 | static NORETURN void cplusplus_error (const char *name, |
84 | 80 | const char *fmt, ...) |
85 | 81 | ATTR_NORETURN ATTR_FORMAT (printf, 2, 3); |
@@ -306,11 +302,6 @@ add_matching_methods (int method_counter, struct type *t, | ||
306 | 302 | else |
307 | 303 | phys_name = TYPE_FN_FIELD_PHYSNAME (f, field_counter); |
308 | 304 | |
309 | - /* Destructor is handled by caller, don't add it to | |
310 | - the list. */ | |
311 | - if (is_destructor_name (phys_name) != 0) | |
312 | - continue; | |
313 | - | |
314 | 305 | sym_arr[i1] = lookup_symbol_in_language (phys_name, |
315 | 306 | NULL, VAR_DOMAIN, |
316 | 307 | language, |
@@ -849,6 +840,10 @@ decode_line_1 (char **argptr, int funfirstline, struct symtab *default_symtab, | ||
849 | 840 | p = skip_quoted (*argptr); |
850 | 841 | } |
851 | 842 | |
843 | + /* Keep any template parameters */ | |
844 | + if (*p == '<') | |
845 | + p = find_template_name_end (p); | |
846 | + | |
852 | 847 | copy = (char *) alloca (p - *argptr + 1); |
853 | 848 | memcpy (copy, *argptr, p - *argptr); |
854 | 849 | copy[p - *argptr] = '\0'; |
@@ -1441,7 +1436,7 @@ find_method (int funfirstline, char ***canonical, char *saved_arg, | ||
1441 | 1436 | /* Find all methods with a matching name, and put them in |
1442 | 1437 | sym_arr. */ |
1443 | 1438 | |
1444 | - i1 = collect_methods (copy, t, sym_class, sym_arr); | |
1439 | + i1 = find_methods (t, copy, SYMBOL_LANGUAGE (sym_class), sym_arr); | |
1445 | 1440 | |
1446 | 1441 | if (i1 == 1) |
1447 | 1442 | { |
@@ -1492,37 +1487,6 @@ find_method (int funfirstline, char ***canonical, char *saved_arg, | ||
1492 | 1487 | } |
1493 | 1488 | } |
1494 | 1489 | |
1495 | -/* Find all methods named COPY in the class whose type is T, and put | |
1496 | - them in SYM_ARR. Return the number of methods found. */ | |
1497 | - | |
1498 | -static int | |
1499 | -collect_methods (char *copy, struct type *t, | |
1500 | - struct symbol *sym_class, struct symbol **sym_arr) | |
1501 | -{ | |
1502 | - int i1 = 0; /* Counter for the symbol array. */ | |
1503 | - | |
1504 | - if (destructor_name_p (copy, t)) | |
1505 | - { | |
1506 | - /* Destructors are a special case. */ | |
1507 | - int m_index, f_index; | |
1508 | - | |
1509 | - if (get_destructor_fn_field (t, &m_index, &f_index)) | |
1510 | - { | |
1511 | - struct fn_field *f = TYPE_FN_FIELDLIST1 (t, m_index); | |
1512 | - | |
1513 | - sym_arr[i1] = | |
1514 | - lookup_symbol (TYPE_FN_FIELD_PHYSNAME (f, f_index), | |
1515 | - NULL, VAR_DOMAIN, (int *) NULL); | |
1516 | - if (sym_arr[i1]) | |
1517 | - i1++; | |
1518 | - } | |
1519 | - } | |
1520 | - else | |
1521 | - i1 = find_methods (t, copy, SYMBOL_LANGUAGE (sym_class), sym_arr); | |
1522 | - | |
1523 | - return i1; | |
1524 | -} | |
1525 | - | |
1526 | 1490 | |
1527 | 1491 | |
1528 | 1492 | /* Return the symtab associated to the filename given by the substring |
@@ -1849,10 +1849,6 @@ value_struct_elt (struct value **argp, struct value **args, | ||
1849 | 1849 | |
1850 | 1850 | /* C++: If it was not found as a data field, then try to |
1851 | 1851 | return it as a pointer to a method. */ |
1852 | - | |
1853 | - if (destructor_name_p (name, t)) | |
1854 | - error (_("Cannot get value of destructor")); | |
1855 | - | |
1856 | 1852 | v = search_struct_method (name, argp, args, 0, |
1857 | 1853 | static_memfuncp, t); |
1858 | 1854 |
@@ -1868,32 +1864,6 @@ value_struct_elt (struct value **argp, struct value **args, | ||
1868 | 1864 | return v; |
1869 | 1865 | } |
1870 | 1866 | |
1871 | - if (destructor_name_p (name, t)) | |
1872 | - { | |
1873 | - if (!args[1]) | |
1874 | - { | |
1875 | - /* Destructors are a special case. */ | |
1876 | - int m_index, f_index; | |
1877 | - | |
1878 | - v = NULL; | |
1879 | - if (get_destructor_fn_field (t, &m_index, &f_index)) | |
1880 | - { | |
1881 | - v = value_fn_field (NULL, | |
1882 | - TYPE_FN_FIELDLIST1 (t, m_index), | |
1883 | - f_index, NULL, 0); | |
1884 | - } | |
1885 | - if (v == NULL) | |
1886 | - error (_("could not find destructor function named %s."), | |
1887 | - name); | |
1888 | - else | |
1889 | - return v; | |
1890 | - } | |
1891 | - else | |
1892 | - { | |
1893 | - error (_("destructor should not have any argument")); | |
1894 | - } | |
1895 | - } | |
1896 | - else | |
1897 | 1867 | v = search_struct_method (name, argp, args, 0, |
1898 | 1868 | static_memfuncp, t); |
1899 | 1869 |
@@ -2499,8 +2469,6 @@ classify_oload_match (struct badness_vector *oload_champ_bv, | ||
2499 | 2469 | int |
2500 | 2470 | destructor_name_p (const char *name, const struct type *type) |
2501 | 2471 | { |
2502 | - /* Destructors are a special case. */ | |
2503 | - | |
2504 | 2472 | if (name[0] == '~') |
2505 | 2473 | { |
2506 | 2474 | char *dname = type_name_no_tag (type); |
@@ -2539,14 +2507,6 @@ check_field (struct type *type, const char *name) | ||
2539 | 2507 | /* C++: If it was not found as a data field, then try to return it |
2540 | 2508 | as a pointer to a method. */ |
2541 | 2509 | |
2542 | - /* Destructors are a special case. */ | |
2543 | - if (destructor_name_p (name, type)) | |
2544 | - { | |
2545 | - int m_index, f_index; | |
2546 | - | |
2547 | - return get_destructor_fn_field (type, &m_index, &f_index); | |
2548 | - } | |
2549 | - | |
2550 | 2510 | for (i = TYPE_NFN_FIELDS (type) - 1; i >= 0; --i) |
2551 | 2511 | { |
2552 | 2512 | if (strcmp_iw (TYPE_FN_FIELDLIST_NAME (type, i), name) == 0) |
@@ -2642,12 +2602,6 @@ value_struct_elt_for_reference (struct type *domain, int offset, | ||
2642 | 2602 | /* C++: If it was not found as a data field, then try to return it |
2643 | 2603 | as a pointer to a method. */ |
2644 | 2604 | |
2645 | - /* Destructors are a special case. */ | |
2646 | - if (destructor_name_p (name, t)) | |
2647 | - { | |
2648 | - error (_("member pointers to destructors not implemented yet")); | |
2649 | - } | |
2650 | - | |
2651 | 2605 | /* Perform all necessary dereferencing. */ |
2652 | 2606 | while (intype && TYPE_CODE (intype) == TYPE_CODE_PTR) |
2653 | 2607 | intype = TYPE_TARGET_TYPE (intype); |