forked from Imagelibrary/binutils-gdb
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>
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user