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] Use bool for solib::symbols_loaded
Date: Fri, 15 Nov 2024 18:44:29 -0700	[thread overview]
Message-ID: <20241116014429.1628623-1-tom@tromey.com> (raw)

This changes solib::symbols_loaded to be of type 'bool'.
---
 gdb/solib.c  | 6 +++---
 gdb/solist.h | 4 +++-
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/gdb/solib.c b/gdb/solib.c
index dfcee4309bd..fdefdf0b142 100644
--- a/gdb/solib.c
+++ b/gdb/solib.c
@@ -593,7 +593,7 @@ solib::clear ()
   this->abfd = nullptr;
 
   /* Our caller closed the objfile, possibly via objfile_purge_solibs.  */
-  this->symbols_loaded = 0;
+  this->symbols_loaded = false;
   this->objfile = nullptr;
 
   this->addr_low = this->addr_high = 0;
@@ -653,7 +653,7 @@ solib_read_symbols (solib &so, symfile_add_flags flags)
 	      so.objfile->addr_low = so.addr_low;
 	    }
 
-	  so.symbols_loaded = 1;
+	  so.symbols_loaded = true;
 	}
       catch (const gdb_exception_error &e)
 	{
@@ -1259,7 +1259,7 @@ reload_shared_libraries_1 (int from_tty)
   for (solib &so : current_program_space->solibs ())
     {
       const char *found_pathname = NULL;
-      bool was_loaded = so.symbols_loaded != 0;
+      bool was_loaded = so.symbols_loaded;
       symfile_add_flags add_flags = SYMFILE_DEFER_BP_RESET;
 
       if (from_tty)
diff --git a/gdb/solist.h b/gdb/solist.h
index 336bb011b2e..8ad0aefd9e3 100644
--- a/gdb/solist.h
+++ b/gdb/solist.h
@@ -77,7 +77,9 @@ struct solib : intrusive_list_node<solib>
      current_sos must initialize these fields to 0.  */
 
   gdb_bfd_ref_ptr abfd;
-  char symbols_loaded = 0;	/* flag: symbols read in yet?  */
+
+  /* True if symbols have been read in.  */
+  bool symbols_loaded = false;
 
   /* objfile with symbols for a loaded library.  Target memory is read from
      ABFD.  OBJFILE may be NULL either before symbols have been loaded, if
-- 
2.46.1


             reply	other threads:[~2024-11-16  1:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-16  1:44 Tom Tromey [this message]
2024-11-16  2:45 ` Simon Marchi

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=20241116014429.1628623-1-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