From 94a75b0363b1e09416e9bd24cac72d98864688d8 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Sat, 10 Feb 2024 15:03:18 -0700 Subject: 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 --- gdb/objfiles.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gdb/objfiles.c') 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; -- cgit v1.1