aboutsummaryrefslogtreecommitdiff
path: root/gdb/ChangeLog
diff options
context:
space:
mode:
authorChristian Biesinger <cbiesinger@google.com>2019-10-22 17:25:50 -0500
committerChristian Biesinger <cbiesinger@google.com>2019-10-29 14:19:41 -0500
commit0c921b219c0f62004787d352b03a746682c01489 (patch)
tree6a69ea0a2e591c1421f3b0721a396b81f288775d /gdb/ChangeLog
parent35e65c49df7d8fac3c0a32fa0d696988a9de675d (diff)
downloadgdb-0c921b219c0f62004787d352b03a746682c01489.zip
gdb-0c921b219c0f62004787d352b03a746682c01489.tar.gz
gdb-0c921b219c0f62004787d352b03a746682c01489.tar.bz2
Only make a nullterminated string if we need to
As of 7bb43059820c5febb4509b15202a93efde442bc6, we no longer need a nullterminated linkage_name to look up the entry in the hash table. So this patch makes it so we only make the copy if the entry was not found. By auditing all callers of symbol_set_names, I found out that all cases where the string may not be nullterminated already pass true for COPY_NAME. So here, I am documenting that as a requirement and am removing the code that relies on undefined behavior in symbol_set_names (it accessed the string past the provided length to check for nulltermination). Note that the Ada case at the beginning of symbol_set_names was already relying on this. gdb/ChangeLog: 2019-10-29 Christian Biesinger <cbiesinger@google.com> * symtab.h (symbol_set_names): Document that copy_name must be set to true for non-nullterminated strings. * symtab.c (symbol_set_names): Only make a nullterminated copy of linkage_name if the entry was not found and we need to demangle. Change-Id: I183302e1f51483ff6dff0fd5c3b0f32f0f04a5d2
Diffstat (limited to 'gdb/ChangeLog')
-rw-r--r--gdb/ChangeLog7
1 files changed, 7 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index c96b61a..1c4e47c 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,12 @@
2019-10-29 Christian Biesinger <cbiesinger@google.com>
+ * symtab.h (symbol_set_names): Document that copy_name must be
+ set to true for non-nullterminated strings.
+ * symtab.c (symbol_set_names): Only make a nullterminated copy of
+ linkage_name if the entry was not found and we need to demangle.
+
+2019-10-29 Christian Biesinger <cbiesinger@google.com>
+
* Makefile.in (HFILES_NO_SRCDIR): Add gdb_binary_search.h.
* dwarf2-frame.c (bsearch_fde_cmp): Update.
(dwarf2_frame_find_fde): Replace bsearch with gdb::binary_search.