]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Change objfile::has_partial_symbols to return bool
authorTom Tromey <tom@tromey.com>
Sat, 20 Mar 2021 23:23:40 +0000 (17:23 -0600)
committerTom Tromey <tom@tromey.com>
Sat, 20 Mar 2021 23:23:41 +0000 (17:23 -0600)
This changes objfile::has_partial_symbols and
quick_symbol_functions::has_symbols to return bool.

gdb/ChangeLog
2021-03-20  Tom Tromey  <tom@tromey.com>

* objfiles.h (struct objfile) <has_partial_symbols>: Return bool.
* symfile.h (struct quick_symbol_functions) <has_symbols>: Return
bool.
* symfile-debug.c (debug_qf_has_symbols): Return bool.
* psymtab.c (psym_has_symbols): Return bool.
* objfiles.c (objfile::has_partial_symbols): Return bool.
* dwarf2/read.c (dw2_has_symbols): Return bool.

gdb/ChangeLog
gdb/dwarf2/read.c
gdb/objfiles.c
gdb/objfiles.h
gdb/psymtab.c
gdb/symfile-debug.c
gdb/symfile.h

index 20f7b56d4f830b86a3cc71e301d8c5cf81d60ae5..8d2b32d10de573d19d23d277e16cb516b2143773 100644 (file)
@@ -1,3 +1,13 @@
+2021-03-20  Tom Tromey  <tom@tromey.com>
+
+       * objfiles.h (struct objfile) <has_partial_symbols>: Return bool.
+       * symfile.h (struct quick_symbol_functions) <has_symbols>: Return
+       bool.
+       * symfile-debug.c (debug_qf_has_symbols): Return bool.
+       * psymtab.c (psym_has_symbols): Return bool.
+       * objfiles.c (objfile::has_partial_symbols): Return bool.
+       * dwarf2/read.c (dw2_has_symbols): Return bool.
+
 2021-03-20  Tom Tromey  <tom@tromey.com>
 
        * symfile.c (read_symbols): Update.
index dd2abd39b0f6d6e23988494269ee4003f2b90a6f..744b6bca2488d30d8b2d5143634d2275e6810961 100644 (file)
@@ -4872,10 +4872,10 @@ dw2_map_symbol_filenames (struct objfile *objfile, symbol_filename_ftype *fun,
     });
 }
 
-static int
+static bool
 dw2_has_symbols (struct objfile *objfile)
 {
-  return 1;
+  return true;
 }
 
 const struct quick_symbol_functions dwarf2_gdb_index_functions =
index 53ca66d17e64e9744043cebb6b75463600348387..746f7d1f2968d2363941017ae6f716dd29fb8bbe 100644 (file)
@@ -812,11 +812,11 @@ objfile_rebase (struct objfile *objfile, CORE_ADDR slide)
 \f
 /* See objfiles.h.  */
 
-int
+bool
 objfile::has_partial_symbols ()
 {
   if (!sf)
-    return 0;
+    return false;
 
   /* If we have not read psymbols, but we have a function capable of reading
      them, then that is an indication that they are in fact available.  Without
@@ -824,7 +824,7 @@ objfile::has_partial_symbols ()
      not be present in this objfile.  */
   if ((flags & OBJF_PSYMTABS_READ) == 0
       && sf->sym_read_psymbols != NULL)
-    return 1;
+    return true;
 
   return sf->qf->has_symbols (this);
 }
index 0568e16ae4c138eae1d8691a1037b36bcc1efe56..f961bdc011685f64accf03518d951ffa0d275791 100644 (file)
@@ -550,7 +550,7 @@ public:
 
   /* Return true if OBJFILE has partial symbols.  */
 
-  int has_partial_symbols ();
+  bool has_partial_symbols ();
 
   /* The object file's original name as specified by the user,
      made absolute, and tilde-expanded.  However, it is not canonicalized
index 7f41c010e391b8726e77c37dc358d22516496912..94b5acdea54f5d459937a5df475c42e1e78045d9 100644 (file)
@@ -1334,7 +1334,7 @@ psym_expand_symtabs_matching
 /* Psymtab version of has_symbols.  See its definition in
    the definition of quick_symbol_functions in symfile.h.  */
 
-static int
+static bool
 psym_has_symbols (struct objfile *objfile)
 {
   return objfile->partial_symtabs->psymtabs != NULL;
index 2929af81c37fa6fe7ebd81a3cda3da5be6009266..7c022ae341d7e98e406d93b958564b62d8eed9b5 100644 (file)
@@ -70,12 +70,12 @@ debug_symtab_name (struct symtab *symtab)
 \f
 /* Debugging version of struct quick_symbol_functions.  */
 
-static int
+static bool
 debug_qf_has_symbols (struct objfile *objfile)
 {
   const struct debug_sym_fns_data *debug_data
     = symfile_debug_objfile_data_key.get (objfile);
-  int retval;
+  bool retval;
 
   retval = debug_data->real_sf->qf->has_symbols (objfile);
 
index da49911c5cf1029a75144e8120cb5c8967a6c286..76b6d4bcc7856231a3141fc53ba354ccee9cca90 100644 (file)
@@ -150,7 +150,7 @@ struct quick_symbol_functions
 {
   /* Return true if this objfile has any "partial" symbols
      available.  */
-  int (*has_symbols) (struct objfile *objfile);
+  bool (*has_symbols) (struct objfile *objfile);
 
   /* Return the symbol table for the "last" file appearing in
      OBJFILE.  */