This is the mail archive of the
gdb-cvs@sourceware.org
mailing list for the GDB project.
[binutils-gdb] Slightly simplify minsym creation
- From: Tom Tromey <tromey at sourceware dot org>
- To: gdb-cvs at sourceware dot org
- Date: 15 Mar 2019 22:07:46 -0000
- Subject: [binutils-gdb] Slightly simplify minsym creation
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=3db066bcd5bac9a8d6be85ea4cfa8f52dbdcc600
commit 3db066bcd5bac9a8d6be85ea4cfa8f52dbdcc600
Author: Tom Tromey <tom@tromey.com>
Date: Fri Mar 1 17:37:30 2019 -0700
Slightly simplify minsym creation
Only one caller of minimal_symbol_reader::record_with_info was using
the return value, so this patch simplifies this code by having it
return void and changing that caller to use record_full instead.
gdb/ChangeLog
2019-03-15 Tom Tromey <tom@tromey.com>
* minsyms.h (class minimal_symbol_reader) <record_with_info>:
Don't return the symbol.
* coffread.c (record_minimal_symbol): Use record_full.
Diff:
---
gdb/ChangeLog | 6 ++++++
gdb/coffread.c | 3 ++-
gdb/minsyms.h | 13 +++++++------
3 files changed, 15 insertions(+), 7 deletions(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 6390295..2d6d895 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,9 @@
+2019-03-15 Tom Tromey <tom@tromey.com>
+
+ * minsyms.h (class minimal_symbol_reader) <record_with_info>:
+ Don't return the symbol.
+ * coffread.c (record_minimal_symbol): Use record_full.
+
2019-03-14 Eli Zaretskii <eliz@gnu.org>
The MS-Windows port of ncurses fails to switch to a color pair if
diff --git a/gdb/coffread.c b/gdb/coffread.c
index b89c0e2..8c8e078 100644
--- a/gdb/coffread.c
+++ b/gdb/coffread.c
@@ -463,7 +463,8 @@ record_minimal_symbol (minimal_symbol_reader &reader,
return NULL;
}
- return reader.record_with_info (cs->c_name, address, type, section);
+ return reader.record_full (cs->c_name, strlen (cs->c_name), true, address,
+ type, section);
}
/* coff_symfile_init ()
diff --git a/gdb/minsyms.h b/gdb/minsyms.h
index 729d394..532436c 100644
--- a/gdb/minsyms.h
+++ b/gdb/minsyms.h
@@ -116,14 +116,15 @@ class minimal_symbol_reader
/* Like record_full, but:
- uses strlen to compute NAME_LEN,
- - passes COPY_NAME = true. */
+ - passes COPY_NAME = true.
- struct minimal_symbol *record_with_info (const char *name,
- CORE_ADDR address,
- enum minimal_symbol_type ms_type,
- int section)
+ This variant does not return the new symbol. */
+
+ void record_with_info (const char *name, CORE_ADDR address,
+ enum minimal_symbol_type ms_type,
+ int section)
{
- return record_full (name, strlen (name), true, address, ms_type, section);
+ record_full (name, strlen (name), true, address, ms_type, section);
}
private: