aboutsummaryrefslogtreecommitdiff
path: root/gdb/objfiles.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2024-02-10 15:03:18 -0700
committerTom Tromey <tom@tromey.com>2024-02-20 08:52:33 -0700
commit94a75b0363b1e09416e9bd24cac72d98864688d8 (patch)
treef4b83dd7c2150d7fef8bcb76dfddd4da735a1b52 /gdb/objfiles.c
parent8480a37e146c40e82a93c0ecf6144571516c95c5 (diff)
downloadbinutils-94a75b0363b1e09416e9bd24cac72d98864688d8.zip
binutils-94a75b0363b1e09416e9bd24cac72d98864688d8.tar.gz
binutils-94a75b0363b1e09416e9bd24cac72d98864688d8.tar.bz2
Add obj_section::contains method
I noticed a number of spots checking whether an address is in an obj_section. This patch introduces a new method for this and changes some code to use it. Regression tested on x86-64 Fedora 38. Approved-By: Andrew Burgess <aburgess@redhat.com>
Diffstat (limited to 'gdb/objfiles.c')
-rw-r--r--gdb/objfiles.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gdb/objfiles.c b/gdb/objfiles.c
index bcaae42..d880b93 100644
--- a/gdb/objfiles.c
+++ b/gdb/objfiles.c
@@ -1213,7 +1213,7 @@ is_addr_in_objfile (CORE_ADDR addr, const struct objfile *objfile)
if (section_is_overlay (osect) && !section_is_mapped (osect))
continue;
- if (osect->addr () <= addr && addr < osect->endaddr ())
+ if (osect->contains (addr))
return true;
}
return false;