]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Use bool for solib::symbols_loaded
authorTom Tromey <tom@tromey.com>
Sat, 16 Nov 2024 01:01:40 +0000 (18:01 -0700)
committerTom Tromey <tom@tromey.com>
Sat, 16 Nov 2024 15:45:57 +0000 (08:45 -0700)
This changes solib::symbols_loaded to be of type 'bool'.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
gdb/solib.c
gdb/solist.h

index dfcee4309bd922cfc5e5e73885318deb9165beb2..fdefdf0b1423032fa39f8ee9aae7f1c35f13e1d1 100644 (file)
@@ -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)
index 336bb011b2e07851226aee77919bcc091303c7ae..8ad0aefd9e32b264b08a853eb3577829a8e74767 100644 (file)
@@ -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