• 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évisionbb749d8ae30108c85d3ae5011a4261d01574b342 (tree)
l'heure2019-11-11 02:44:49
AuteurTom Tromey <tom@trom...>
CommiterTom Tromey

Message de Log

Defer minimal symbol name-setting

Currently the demangled name of a minimal symbol is set when creating
the symbol. However, there is no intrinsic need to do this. This
patch instead arranges for the demangling to be done just before the
minsym hash tables are filled. This will be useful in a later patch.

gdb/ChangeLog
2019-10-19 Tom Tromey <tom@tromey.com>

* symtab.h (struct minimal_symbol) <name_set>: New member.
* minsyms.c (minimal_symbol_reader::record_full): Copy name.
Don't call symbol_set_names.
(minimal_symbol_reader::install): Call symbol_set_names.

Change-Id: I4fe3993b99fb3a43968067806e294d48e377fd76

Change Summary

Modification

--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,10 @@
1+2019-10-19 Tom Tromey <tom@tromey.com>
2+
3+ * symtab.h (struct minimal_symbol) <name_set>: New member.
4+ * minsyms.c (minimal_symbol_reader::record_full): Copy name.
5+ Don't call symbol_set_names.
6+ (minimal_symbol_reader::install): Call symbol_set_names.
7+
18 2019-11-10 Tom Tromey <tom@tromey.com>
29
310 * tui/tui-wingeneral.c (tui_unhighlight_win): Use can_box.
--- a/gdb/minsyms.c
+++ b/gdb/minsyms.c
@@ -1127,7 +1127,12 @@ minimal_symbol_reader::record_full (gdb::string_view name,
11271127 msymbol = &m_msym_bunch->contents[m_msym_bunch_index];
11281128 symbol_set_language (msymbol, language_auto,
11291129 &m_objfile->per_bfd->storage_obstack);
1130- symbol_set_names (msymbol, name, copy_name, m_objfile->per_bfd);
1130+
1131+ if (copy_name)
1132+ msymbol->name = obstack_strndup (&m_objfile->per_bfd->storage_obstack,
1133+ name.data (), name.size ());
1134+ else
1135+ msymbol->name = name.data ();
11311136
11321137 SET_MSYMBOL_VALUE_ADDRESS (msymbol, address);
11331138 MSYMBOL_SECTION (msymbol) = section;
@@ -1354,6 +1359,17 @@ minimal_symbol_reader::install ()
13541359 m_objfile->per_bfd->minimal_symbol_count = mcount;
13551360 m_objfile->per_bfd->msymbols = std::move (msym_holder);
13561361
1362+ msymbols = m_objfile->per_bfd->msymbols.get ();
1363+ for (int i = 0; i < mcount; ++i)
1364+ {
1365+ if (!msymbols[i].name_set)
1366+ {
1367+ symbol_set_names (&msymbols[i], msymbols[i].name,
1368+ false, m_objfile->per_bfd);
1369+ msymbols[i].name_set = 1;
1370+ }
1371+ }
1372+
13571373 build_minimal_symbol_hash_tables (m_objfile);
13581374 }
13591375 }
--- a/gdb/symtab.h
+++ b/gdb/symtab.h
@@ -698,6 +698,10 @@ struct minimal_symbol : public general_symbol_info
698698
699699 unsigned maybe_copied : 1;
700700
701+ /* Non-zero if this symbol ever had its demangled name set (even if
702+ it was set to NULL). */
703+ unsigned int name_set : 1;
704+
701705 /* Minimal symbols with the same hash key are kept on a linked
702706 list. This is the link. */
703707