• R/O
  • HTTP
  • SSH
  • HTTPS

提交

标签
No Tags

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

修订版5e2db402c8e665b0c6ac81047a10cbf4e26329f2 (tree)
时间2018-01-18 03:28:44
作者Tom Tromey <tom@trom...>
CommiterTom Tromey

Log Message

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.

更改概述

差异

--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -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+
18 2018-01-17 Mike Gulick <mgulick@mathworks.com>
29
310 PR gdb/16577
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -1884,10 +1884,7 @@ static struct compunit_symtab *dwarf2_start_symtab (struct dwarf2_cu *,
18841884 CORE_ADDR);
18851885
18861886 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);
18911888
18921889 static void dwarf2_const_value (const struct attribute *, struct symbol *,
18931890 struct dwarf2_cu *);
@@ -10940,7 +10937,7 @@ dwarf2_compute_name (const char *name,
1094010937 but otherwise compute it by typename_concat inside GDB.
1094110938 FIXME: Actually this is not really true, or at least not always true.
1094210939 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
1094410941 will set the demangled name to the result of dwarf2_full_name, and it is
1094510942 the demangled name that GDB uses if it exists. */
1094610943 if (cu->language == language_ada
@@ -11213,8 +11210,8 @@ dwarf2_physname (const char *name, struct die_info *die, struct dwarf2_cu *cu)
1121311210
1121411211 if (cu->language == language_go)
1121511212 {
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.
1121811215 This just undoes that lie until things are cleaned up. */
1121911216 }
1122011217 else
@@ -13880,8 +13877,8 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu)
1388013877 }
1388113878
1388213879 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);
1388513882
1388613883 /* If there is a location expression for DW_AT_frame_base, record
1388713884 it. */
@@ -14436,7 +14433,7 @@ read_variable (struct die_info *die, struct dwarf2_cu *cu)
1443614433 }
1443714434 }
1443814435
14439- new_symbol_full (die, NULL, cu, storage);
14436+ new_symbol (die, NULL, cu, storage);
1444014437 }
1444114438
1444214439 /* Call CALLBACK from DW_AT_ranges attribute value OFFSET
@@ -21381,8 +21378,8 @@ var_decode_location (struct attribute *attr, struct symbol *sym,
2138121378 NULL, allocate a new symbol on the objfile's obstack. */
2138221379
2138321380 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)
2138621383 {
2138721384 struct dwarf2_per_objfile *dwarf2_per_objfile
2138821385 = cu->per_cu->dwarf2_per_objfile;
@@ -21764,14 +21761,6 @@ new_symbol_full (struct die_info *die, struct type *type, struct dwarf2_cu *cu,
2176421761 return (sym);
2176521762 }
2176621763
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-
2177521764 /* Given an attr with a DW_FORM_dataN value in host byte order,
2177621765 zero-extend it as appropriate for the symbol's type. The DWARF
2177721766 standard (v4) is not entirely clear about the meaning of using