Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tom@tromey.com>
Subject: [PATCH 1/9] Slightly simplify minsym creation
Date: Thu, 07 Mar 2019 20:57:00 -0000	[thread overview]
Message-ID: <20190307205709.21919-2-tom@tromey.com> (raw)
In-Reply-To: <20190307205709.21919-1-tom@tromey.com>

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-07  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.
---
 gdb/ChangeLog  |  6 ++++++
 gdb/coffread.c |  3 ++-
 gdb/minsyms.h  | 13 +++++++------
 3 files changed, 15 insertions(+), 7 deletions(-)

diff --git a/gdb/coffread.c b/gdb/coffread.c
index b89c0e2e803..8c8e0784789 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);
 }
 \f
 /* coff_symfile_init ()
diff --git a/gdb/minsyms.h b/gdb/minsyms.h
index 729d3946075..532436c16c1 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:
-- 
2.17.2


  parent reply	other threads:[~2019-03-07 20:57 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-07 21:11 [PATCH 0/9] Minor minimal symbol improvements Tom Tromey
2019-03-07 20:57 ` [PATCH 3/9] Remove some unneeded initializations in minimal_symbol_reader Tom Tromey
2019-03-07 20:57 ` [PATCH 2/9] Introduce and use language_set Tom Tromey
2019-03-07 23:05   ` John Baldwin
2019-03-08 22:21     ` Tom Tromey
2019-03-08 22:43     ` Tom Tromey
2019-03-08 23:44       ` John Baldwin
2019-03-07 20:57 ` [PATCH 4/9] Remove minsym termination Tom Tromey
2019-03-07 20:57 ` [PATCH 8/9] Use memcpy in minimal_symbol_reader::install Tom Tromey
2019-03-07 20:57 ` [PATCH 6/9] Use htab_up for demangled hash Tom Tromey
2019-03-07 20:57 ` [PATCH 5/9] Simplify per-BFD storage management Tom Tromey
2019-03-07 20:57 ` [PATCH 9/9] Change minimal_symbol inheritance Tom Tromey
2019-03-07 20:57 ` [PATCH 7/9] Allocate minimal symbols with malloc Tom Tromey
2019-03-07 20:57 ` Tom Tromey [this message]
2019-03-15 22:04 ` [PATCH 0/9] Minor minimal symbol improvements Tom Tromey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190307205709.21919-2-tom@tromey.com \
    --to=tom@tromey.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox