diff options
Diffstat (limited to 'gdb/objfiles.c')
-rw-r--r-- | gdb/objfiles.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/gdb/objfiles.c b/gdb/objfiles.c index 7029196..70a927a 100644 --- a/gdb/objfiles.c +++ b/gdb/objfiles.c @@ -548,6 +548,9 @@ free_objfile_separate_debug (struct objfile *objfile) void free_objfile (struct objfile *objfile) { + /* First notify observers that this objfile is about to be freed. */ + observer_notify_free_objfile (objfile); + /* Free all separate debug objfiles. */ free_objfile_separate_debug (objfile); @@ -1464,6 +1467,29 @@ resume_section_map_updates_cleanup (void *arg) resume_section_map_updates (arg); } +/* Return 1 if ADDR maps into one of the sections of OBJFILE and 0 + otherwise. */ + +int +is_addr_in_objfile (CORE_ADDR addr, const struct objfile *objfile) +{ + struct obj_section *osect; + + if (objfile == NULL) + return 0; + + ALL_OBJFILE_OSECTIONS (objfile, osect) + { + if (section_is_overlay (osect) && !section_is_mapped (osect)) + continue; + + if (obj_section_addr (osect) <= addr + && addr < obj_section_endaddr (osect)) + return 1; + } + return 0; +} + /* The default implementation for the "iterate_over_objfiles_in_search_order" gdbarch method. It is equivalent to use the ALL_OBJFILES macro, searching the objfiles in the order they are stored internally, |