GNU Binutils with patches for OS216
修订版 | 5e2db402c8e665b0c6ac81047a10cbf4e26329f2 (tree) |
---|---|
时间 | 2018-01-18 03:28:44 |
作者 | Tom Tromey <tom@trom...> |
Commiter | Tom Tromey |
Unify new_symbol and new_symbol_full
This patch unifies new_symbol with new_symbol_full, replacing a
wrapper function with a default parameter.
2018-01-17 Tom Tromey <tom@tromey.com>
* dwarf2read.c (dwarf2_compute_name): Update comment.
(read_func_scope, read_variable): Update.
(new_symbol): Remove.
(new_symbol_full): Rename to new_symbol.
@@ -1,3 +1,10 @@ | ||
1 | +2018-01-17 Tom Tromey <tom@tromey.com> | |
2 | + | |
3 | + * dwarf2read.c (dwarf2_compute_name): Update comment. | |
4 | + (read_func_scope, read_variable): Update. | |
5 | + (new_symbol): Remove. | |
6 | + (new_symbol_full): Rename to new_symbol. | |
7 | + | |
1 | 8 | 2018-01-17 Mike Gulick <mgulick@mathworks.com> |
2 | 9 | |
3 | 10 | PR gdb/16577 |
@@ -1884,10 +1884,7 @@ static struct compunit_symtab *dwarf2_start_symtab (struct dwarf2_cu *, | ||
1884 | 1884 | CORE_ADDR); |
1885 | 1885 | |
1886 | 1886 | static struct symbol *new_symbol (struct die_info *, struct type *, |
1887 | - struct dwarf2_cu *); | |
1888 | - | |
1889 | -static struct symbol *new_symbol_full (struct die_info *, struct type *, | |
1890 | - struct dwarf2_cu *, struct symbol *); | |
1887 | + struct dwarf2_cu *, struct symbol * = NULL); | |
1891 | 1888 | |
1892 | 1889 | static void dwarf2_const_value (const struct attribute *, struct symbol *, |
1893 | 1890 | struct dwarf2_cu *); |
@@ -10940,7 +10937,7 @@ dwarf2_compute_name (const char *name, | ||
10940 | 10937 | but otherwise compute it by typename_concat inside GDB. |
10941 | 10938 | FIXME: Actually this is not really true, or at least not always true. |
10942 | 10939 | It's all very confusing. SYMBOL_SET_NAMES doesn't try to demangle |
10943 | - Fortran names because there is no mangling standard. So new_symbol_full | |
10940 | + Fortran names because there is no mangling standard. So new_symbol | |
10944 | 10941 | will set the demangled name to the result of dwarf2_full_name, and it is |
10945 | 10942 | the demangled name that GDB uses if it exists. */ |
10946 | 10943 | if (cu->language == language_ada |
@@ -11213,8 +11210,8 @@ dwarf2_physname (const char *name, struct die_info *die, struct dwarf2_cu *cu) | ||
11213 | 11210 | |
11214 | 11211 | if (cu->language == language_go) |
11215 | 11212 | { |
11216 | - /* This is a lie, but we already lie to the caller new_symbol_full. | |
11217 | - new_symbol_full assumes we return the mangled name. | |
11213 | + /* This is a lie, but we already lie to the caller new_symbol. | |
11214 | + new_symbol assumes we return the mangled name. | |
11218 | 11215 | This just undoes that lie until things are cleaned up. */ |
11219 | 11216 | } |
11220 | 11217 | else |
@@ -13880,8 +13877,8 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu) | ||
13880 | 13877 | } |
13881 | 13878 | |
13882 | 13879 | newobj = push_context (0, lowpc); |
13883 | - newobj->name = new_symbol_full (die, read_type_die (die, cu), cu, | |
13884 | - (struct symbol *) templ_func); | |
13880 | + newobj->name = new_symbol (die, read_type_die (die, cu), cu, | |
13881 | + (struct symbol *) templ_func); | |
13885 | 13882 | |
13886 | 13883 | /* If there is a location expression for DW_AT_frame_base, record |
13887 | 13884 | it. */ |
@@ -14436,7 +14433,7 @@ read_variable (struct die_info *die, struct dwarf2_cu *cu) | ||
14436 | 14433 | } |
14437 | 14434 | } |
14438 | 14435 | |
14439 | - new_symbol_full (die, NULL, cu, storage); | |
14436 | + new_symbol (die, NULL, cu, storage); | |
14440 | 14437 | } |
14441 | 14438 | |
14442 | 14439 | /* Call CALLBACK from DW_AT_ranges attribute value OFFSET |
@@ -21381,8 +21378,8 @@ var_decode_location (struct attribute *attr, struct symbol *sym, | ||
21381 | 21378 | NULL, allocate a new symbol on the objfile's obstack. */ |
21382 | 21379 | |
21383 | 21380 | static struct symbol * |
21384 | -new_symbol_full (struct die_info *die, struct type *type, struct dwarf2_cu *cu, | |
21385 | - struct symbol *space) | |
21381 | +new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu, | |
21382 | + struct symbol *space) | |
21386 | 21383 | { |
21387 | 21384 | struct dwarf2_per_objfile *dwarf2_per_objfile |
21388 | 21385 | = cu->per_cu->dwarf2_per_objfile; |
@@ -21764,14 +21761,6 @@ new_symbol_full (struct die_info *die, struct type *type, struct dwarf2_cu *cu, | ||
21764 | 21761 | return (sym); |
21765 | 21762 | } |
21766 | 21763 | |
21767 | -/* A wrapper for new_symbol_full that always allocates a new symbol. */ | |
21768 | - | |
21769 | -static struct symbol * | |
21770 | -new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu) | |
21771 | -{ | |
21772 | - return new_symbol_full (die, type, cu, NULL); | |
21773 | -} | |
21774 | - | |
21775 | 21764 | /* Given an attr with a DW_FORM_dataN value in host byte order, |
21776 | 21765 | zero-extend it as appropriate for the symbol's type. The DWARF |
21777 | 21766 | standard (v4) is not entirely clear about the meaning of using |