Split vDSO range lookup to a gdbarch hook
We have a case in solib-svr4.c where we could reuse symfile-mem.c's vDSO range lookup. Since symfile-mem.c is not present in all configurations solib-svr4.c is, move that lookup to a gdbarch hook. This has the minor (good) side effect that we stop even trying the target_auxv_search lookup against targets that don't have a concept of a vDSO, in case symfile-mem.c happens to be linked in the build (--enable-targets=all). Tested on x86_64 Fedora 20. gdb/ 2014-10-10 Pedro Alves <palves@redhat.com> * arch-utils.c (default_vsyscall_range): New function. * arch-utils.h (default_vsyscall_range): New declaration. * gdbarch.sh (vsyscall_range): New hook. * gdbarch.h, gdbarch.c: Regenerate. * linux-tdep.c (linux_vsyscall_range): New function. (linux_init_abi): Install linux_vsyscall_range as vsyscall_range gdbarch hook. * memrange.c (address_in_mem_range): New function. * memrange.h (address_in_mem_range): New declaration. * symfile-mem.c (find_vdso_size): Delete function. (add_vsyscall_page): Use gdbarch_vsyscall_range.
This commit is contained in:
parent
31cc0b807b
commit
3437254d7b
10 changed files with 120 additions and 26 deletions
|
@ -31,6 +31,15 @@ mem_ranges_overlap (CORE_ADDR start1, int len1,
|
|||
return (l < h);
|
||||
}
|
||||
|
||||
/* See memrange.h. */
|
||||
|
||||
int
|
||||
address_in_mem_range (CORE_ADDR address, const struct mem_range *r)
|
||||
{
|
||||
return (r->start <= address
|
||||
&& (address - r->start) < r->length);
|
||||
}
|
||||
|
||||
/* qsort comparison function, that compares mem_ranges. Ranges are
|
||||
sorted in ascending START order. */
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue