public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [pushed] gdb: make two objfile functions return bool
@ 2020-05-12 15:33 Simon Marchi
  0 siblings, 0 replies; only message in thread
From: Simon Marchi @ 2020-05-12 15:33 UTC (permalink / raw)
  To: gdb-patches; +Cc: Simon Marchi

gdb/ChangeLog:

	* objfiles.h (is_addr_in_objfile,
	shared_objfile_contains_address_p): Return bool.
	* objfile.c (is_addr_in_objfile,
	shared_objfile_contains_address_p): Return bool.
---
 gdb/ChangeLog  |  7 +++++++
 gdb/objfiles.c | 19 ++++++++++---------
 gdb/objfiles.h |  9 ++++++---
 3 files changed, 23 insertions(+), 12 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 3db87b99d5d5..919f44d1512f 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,10 @@
+2020-05-12  Simon Marchi  <simon.marchi@efficios.com>
+
+	* objfiles.h (is_addr_in_objfile,
+	shared_objfile_contains_address_p): Return bool.
+	* objfile.c (is_addr_in_objfile,
+	shared_objfile_contains_address_p): Return bool.
+
 2020-05-11  Tom Tromey  <tromey@adacore.com>
 
 	* cli/cli-cmds.c (info_command): Restore.
diff --git a/gdb/objfiles.c b/gdb/objfiles.c
index d329a953c17c..3aa7973e0d56 100644
--- a/gdb/objfiles.c
+++ b/gdb/objfiles.c
@@ -1303,16 +1303,15 @@ inhibit_section_map_updates (struct program_space *pspace)
     (&get_objfile_pspace_data (pspace)->inhibit_updates, 1);
 }
 
-/* Return 1 if ADDR maps into one of the sections of OBJFILE and 0
-   otherwise.  */
+/* See objfiles.h.  */
 
-int
+bool
 is_addr_in_objfile (CORE_ADDR addr, const struct objfile *objfile)
 {
   struct obj_section *osect;
 
   if (objfile == NULL)
-    return 0;
+    return false;
 
   ALL_OBJFILE_OSECTIONS (objfile, osect)
     {
@@ -1321,12 +1320,14 @@ is_addr_in_objfile (CORE_ADDR addr, const struct objfile *objfile)
 
       if (obj_section_addr (osect) <= addr
 	  && addr < obj_section_endaddr (osect))
-	return 1;
+	return true;
     }
-  return 0;
+  return false;
 }
 
-int
+/* See objfiles.h.  */
+
+bool
 shared_objfile_contains_address_p (struct program_space *pspace,
 				   CORE_ADDR address)
 {
@@ -1334,10 +1335,10 @@ shared_objfile_contains_address_p (struct program_space *pspace,
     {
       if ((objfile->flags & OBJF_SHARED) != 0
 	  && is_addr_in_objfile (address, objfile))
-	return 1;
+	return true;
     }
 
-  return 0;
+  return false;
 }
 
 /* The default implementation for the "iterate_over_objfiles_in_search_order"
diff --git a/gdb/objfiles.h b/gdb/objfiles.h
index 77f94e4f21d1..0b47bd0c1e2f 100644
--- a/gdb/objfiles.h
+++ b/gdb/objfiles.h
@@ -741,13 +741,16 @@ extern void objfile_set_sym_fns (struct objfile *objfile,
 
 extern void objfiles_changed (void);
 
-extern int is_addr_in_objfile (CORE_ADDR addr, const struct objfile *objfile);
+/* Return true if ADDR maps into one of the sections of OBJFILE and false
+   otherwise.  */
+
+extern bool is_addr_in_objfile (CORE_ADDR addr, const struct objfile *objfile);
 
 /* Return true if ADDRESS maps into one of the sections of a
    OBJF_SHARED objfile of PSPACE and false otherwise.  */
 
-extern int shared_objfile_contains_address_p (struct program_space *pspace,
-					      CORE_ADDR address);
+extern bool shared_objfile_contains_address_p (struct program_space *pspace,
+                                               CORE_ADDR address);
 
 /* This operation deletes all objfile entries that represent solibs that
    weren't explicitly loaded by the user, via e.g., the add-symbol-file
-- 
2.26.2


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-05-12 15:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-12 15:33 [pushed] gdb: make two objfile functions return bool Simon Marchi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).