diff options
author | Simon Marchi <simon.marchi@efficios.com> | 2020-05-12 11:17:01 -0400 |
---|---|---|
committer | Simon Marchi <simon.marchi@efficios.com> | 2020-05-12 11:17:01 -0400 |
commit | 02ff80c296ea525e1c89fe3bd41e29cc249595f0 (patch) | |
tree | 207c960cda2aeab395970993c3f5bfb5ca46ebb8 /gdb/objfiles.c | |
parent | c7c663418085fa497603bb04bb146a70010aade1 (diff) | |
download | gdb-02ff80c296ea525e1c89fe3bd41e29cc249595f0.zip gdb-02ff80c296ea525e1c89fe3bd41e29cc249595f0.tar.gz gdb-02ff80c296ea525e1c89fe3bd41e29cc249595f0.tar.bz2 |
gdb: make two objfile functions return bool
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.
Diffstat (limited to 'gdb/objfiles.c')
-rw-r--r-- | gdb/objfiles.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/gdb/objfiles.c b/gdb/objfiles.c index d329a95..3aa7973 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" |