aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@polymtl.ca>2024-05-16 16:29:47 -0400
committerSimon Marchi <simon.marchi@efficios.com>2024-07-15 14:34:12 -0400
commitcc7541ce5e1c317c7b185b005f0c048c997b2b58 (patch)
tree0a281293c45148f74407094146f397f52d25a35e /gdb
parentfbee6a57b23782212e1b2ebf46203da926d3dfb3 (diff)
downloadgdb-cc7541ce5e1c317c7b185b005f0c048c997b2b58.zip
gdb-cc7541ce5e1c317c7b185b005f0c048c997b2b58.tar.gz
gdb-cc7541ce5e1c317c7b185b005f0c048c997b2b58.tar.bz2
gdb: bool-ify a few functions in objfiles.{c,h}
Change return types to bool, and make a few stylistic adjustments. Change-Id: I784c3c33af0394a77c25064b06eb3e128e69222f Approved-By: Tom Tromey <tom@tromey.com> Reviewed-By: Thiago Jung Bauermann <thiago.bauermann@linaro.org>
Diffstat (limited to 'gdb')
-rw-r--r--gdb/objfiles.c77
-rw-r--r--gdb/objfiles.h23
2 files changed, 50 insertions, 50 deletions
diff --git a/gdb/objfiles.c b/gdb/objfiles.c
index f51baab..25129b2 100644
--- a/gdb/objfiles.c
+++ b/gdb/objfiles.c
@@ -731,56 +731,49 @@ objfile_rebase (struct objfile *objfile, CORE_ADDR slide)
if (changed)
breakpoint_re_set ();
}
-
-/* Return non-zero if OBJFILE has full symbols. */
-int
-objfile_has_full_symbols (struct objfile *objfile)
+/* See objfiles.h. */
+
+bool
+objfile_has_full_symbols (objfile *objfile)
{
- return objfile->compunit_symtabs != NULL;
+ return objfile->compunit_symtabs != nullptr;
}
-/* Return non-zero if OBJFILE has full or partial symbols, either directly
- or through a separate debug file. */
+/* See objfiles.h. */
-int
-objfile_has_symbols (struct objfile *objfile)
+bool
+objfile_has_symbols (objfile *objfile)
{
for (::objfile *o : objfile->separate_debug_objfiles ())
if (o->has_partial_symbols () || objfile_has_full_symbols (o))
- return 1;
- return 0;
-}
+ return true;
+ return false;
+}
-/* Many places in gdb want to test just to see if we have any partial
- symbols available. This function returns zero if none are currently
- available, nonzero otherwise. */
+/* See objfiles.h. */
-int
-have_partial_symbols (void)
+bool
+have_partial_symbols ()
{
for (objfile *ofp : current_program_space->objfiles ())
- {
- if (ofp->has_partial_symbols ())
- return 1;
- }
- return 0;
+ if (ofp->has_partial_symbols ())
+ return true;
+
+ return false;
}
-/* Many places in gdb want to test just to see if we have any full
- symbols available. This function returns zero if none are currently
- available, nonzero otherwise. */
+/* See objfiles.h. */
-int
-have_full_symbols (void)
+bool
+have_full_symbols ()
{
for (objfile *ofp : current_program_space->objfiles ())
- {
- if (objfile_has_full_symbols (ofp))
- return 1;
- }
- return 0;
+ if (objfile_has_full_symbols (ofp))
+ return true;
+
+ return false;
}
@@ -799,22 +792,16 @@ objfile_purge_solibs (program_space *pspace)
}
}
+/* See objfiles.h. */
-/* Many places in gdb want to test just to see if we have any minimal
- symbols available. This function returns zero if none are currently
- available, nonzero otherwise. */
-
-int
-have_minimal_symbols (void)
+bool
+have_minimal_symbols ()
{
for (objfile *ofp : current_program_space->objfiles ())
- {
- if (ofp->per_bfd->minimal_symbol_count > 0)
- {
- return 1;
- }
- }
- return 0;
+ if (ofp->per_bfd->minimal_symbol_count > 0)
+ return true;
+
+ return false;
}
/* Qsort comparison function. */
diff --git a/gdb/objfiles.h b/gdb/objfiles.h
index 73d1e99..5cf7331 100644
--- a/gdb/objfiles.h
+++ b/gdb/objfiles.h
@@ -923,13 +923,23 @@ extern void free_objfile_separate_debug (struct objfile *);
extern void objfile_relocate (struct objfile *, const section_offsets &);
extern void objfile_rebase (struct objfile *, CORE_ADDR);
-extern int objfile_has_full_symbols (struct objfile *objfile);
+/* Return true if OBJFILE has full symbols. */
-extern int objfile_has_symbols (struct objfile *objfile);
+extern bool objfile_has_full_symbols (objfile *objfile);
-extern int have_partial_symbols (void);
+/* Return true if OBJFILE has full or partial symbols, either directly
+ or through a separate debug file. */
-extern int have_full_symbols (void);
+extern bool objfile_has_symbols (objfile *objfile);
+
+/* Return true if any objfile of the current program space has partial
+ symbols. */
+
+extern bool have_partial_symbols ();
+
+/* Return true if any objfile of the current program space has full symbols. */
+
+extern bool have_full_symbols ();
extern void objfile_set_sym_fns (struct objfile *objfile,
const struct sym_fns *sf);
@@ -956,7 +966,10 @@ extern void objfile_purge_solibs (program_space *pspace);
/* Functions for dealing with the minimal symbol table, really a misc
address<->symbol mapping for things we don't have debug symbols for. */
-extern int have_minimal_symbols (void);
+/* Return true if any objfile of the current program space has minimal
+ symbols. */
+
+extern bool have_minimal_symbols ();
extern struct obj_section *find_pc_section (CORE_ADDR pc);