• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Aucun tag

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

GNU Binutils with patches for OS216


Commit MetaInfo

Révision19ef5c713c0116f2e15fea28168614d7894b613a (tree)
l'heure2009-06-17 03:39:41
AuteurKeith Seitz <keiths@redh...>
CommiterKeith Seitz

Message de Log

* 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.

Change Summary

Modification

--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -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+
116 2009-06-16 Pedro Alves <pedro@codesourcery.com>
217
318 * mi/mi-main.c (mi_cmd_data_read_memory): Dispatch
--- a/gdb/gdbtypes.c
+++ b/gdb/gdbtypes.c
@@ -1334,34 +1334,6 @@ get_vptr_fieldno (struct type *type, struct type **basetypep)
13341334 }
13351335 }
13361336
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-
13651337 static void
13661338 stub_noname_complaint (void)
13671339 {
--- a/gdb/gdbtypes.h
+++ b/gdb/gdbtypes.h
@@ -1202,8 +1202,6 @@ extern struct type *lookup_template_type (char *, struct type *,
12021202
12031203 extern int get_vptr_fieldno (struct type *, struct type **);
12041204
1205-extern int get_destructor_fn_field (struct type *, int *, int *);
1206-
12071205 extern int get_discrete_bounds (struct type *, LONGEST *, LONGEST *);
12081206
12091207 extern int is_ancestor (struct type *, struct type *);
--- a/gdb/linespec.c
+++ b/gdb/linespec.c
@@ -76,10 +76,6 @@ static struct symtabs_and_lines find_method (int funfirstline,
7676 struct type *t,
7777 struct symbol *sym_class);
7878
79-static int collect_methods (char *copy, struct type *t,
80- struct symbol *sym_class,
81- struct symbol **sym_arr);
82-
8379 static NORETURN void cplusplus_error (const char *name,
8480 const char *fmt, ...)
8581 ATTR_NORETURN ATTR_FORMAT (printf, 2, 3);
@@ -306,11 +302,6 @@ add_matching_methods (int method_counter, struct type *t,
306302 else
307303 phys_name = TYPE_FN_FIELD_PHYSNAME (f, field_counter);
308304
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-
314305 sym_arr[i1] = lookup_symbol_in_language (phys_name,
315306 NULL, VAR_DOMAIN,
316307 language,
@@ -849,6 +840,10 @@ decode_line_1 (char **argptr, int funfirstline, struct symtab *default_symtab,
849840 p = skip_quoted (*argptr);
850841 }
851842
843+ /* Keep any template parameters */
844+ if (*p == '<')
845+ p = find_template_name_end (p);
846+
852847 copy = (char *) alloca (p - *argptr + 1);
853848 memcpy (copy, *argptr, p - *argptr);
854849 copy[p - *argptr] = '\0';
@@ -1441,7 +1436,7 @@ find_method (int funfirstline, char ***canonical, char *saved_arg,
14411436 /* Find all methods with a matching name, and put them in
14421437 sym_arr. */
14431438
1444- i1 = collect_methods (copy, t, sym_class, sym_arr);
1439+ i1 = find_methods (t, copy, SYMBOL_LANGUAGE (sym_class), sym_arr);
14451440
14461441 if (i1 == 1)
14471442 {
@@ -1492,37 +1487,6 @@ find_method (int funfirstline, char ***canonical, char *saved_arg,
14921487 }
14931488 }
14941489
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-
15261490
15271491
15281492 /* Return the symtab associated to the filename given by the substring
--- a/gdb/valops.c
+++ b/gdb/valops.c
@@ -1849,10 +1849,6 @@ value_struct_elt (struct value **argp, struct value **args,
18491849
18501850 /* C++: If it was not found as a data field, then try to
18511851 return it as a pointer to a method. */
1852-
1853- if (destructor_name_p (name, t))
1854- error (_("Cannot get value of destructor"));
1855-
18561852 v = search_struct_method (name, argp, args, 0,
18571853 static_memfuncp, t);
18581854
@@ -1868,32 +1864,6 @@ value_struct_elt (struct value **argp, struct value **args,
18681864 return v;
18691865 }
18701866
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
18971867 v = search_struct_method (name, argp, args, 0,
18981868 static_memfuncp, t);
18991869
@@ -2499,8 +2469,6 @@ classify_oload_match (struct badness_vector *oload_champ_bv,
24992469 int
25002470 destructor_name_p (const char *name, const struct type *type)
25012471 {
2502- /* Destructors are a special case. */
2503-
25042472 if (name[0] == '~')
25052473 {
25062474 char *dname = type_name_no_tag (type);
@@ -2539,14 +2507,6 @@ check_field (struct type *type, const char *name)
25392507 /* C++: If it was not found as a data field, then try to return it
25402508 as a pointer to a method. */
25412509
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-
25502510 for (i = TYPE_NFN_FIELDS (type) - 1; i >= 0; --i)
25512511 {
25522512 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,
26422602 /* C++: If it was not found as a data field, then try to return it
26432603 as a pointer to a method. */
26442604
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-
26512605 /* Perform all necessary dereferencing. */
26522606 while (intype && TYPE_CODE (intype) == TYPE_CODE_PTR)
26532607 intype = TYPE_TARGET_TYPE (intype);