]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
Add kernel module support for linux-kernel target
authorPhilipp Rudo <prudo@linux.vnet.ibm.com>
Thu, 16 Mar 2017 09:50:25 +0000 (10:50 +0100)
committerAndreas Arnez <arnez@linux.vnet.ibm.com>
Thu, 16 Mar 2017 16:01:48 +0000 (17:01 +0100)
commit699e91f4e1d62b56ad9cce10c0220c7aae524ebb
tree866d9a0e7f6916f1bb0066254439b3292a7475d7
parent60a2f0378478f101e049dd622f69bf01f6d690a0
Add kernel module support for linux-kernel target

This patch implements module support for the new linux-kernel target by
adding a target_so_ops. In addition this patch adds handling for kernel
virtual addresses. This is necessary because kernel modules, unlike
task_structs, live in kernel virtual address space. Thus addresses need
to be translated before they can be read from. We achieve this by adding
an implementation for the targets to_xfer_partial hook, which translates
the addresses before passing them down to the target beneath.

gdb/ChangeLog:

    * lk-modules.h: New file.
    * lk-modules.c: New file.
    * lk-low.h (lk_hook_is_kvaddr, lk_hook_vtop)
    (lk_hook_get_module_text_offset): New arch dependent hooks.
    (sturct lk_private_hooks): Add new hooks.
    (LK_MODULES_NAME_LEN, LK_UTS_NAME_LEN): New define.
    * lk-low.c (lk-modules.h): New include.
    (lk_kvtop, restore_current_target, lk_xfer_partial): New functions.
    (lk_init_private_data): Declare needed debug symbols.
    (lk_try_push_target): Assert for new hooks and set solib_ops.
    (init_linux_kernel_ops): Add implementation for to_xfer_partial.
    * solib.c (get_solib_search_path): New function.
    * solib.h (get_solib_search_path): New export.
    * Makefile.in (SFILES, ALLDEPFILES): Add lk-modules.c.
    (HFILES_NO_SRCDIR): Add lk-modules.h.
    (ALL_TARGET_OBS): Add lk-modules.o.
    * configure.tgt (lk_target_obs): Add lk-modules.o.
gdb/Makefile.in
gdb/configure.tgt
gdb/lk-low.c
gdb/lk-low.h
gdb/lk-modules.c [new file with mode: 0644]
gdb/lk-modules.h [new file with mode: 0644]
gdb/solib.c
gdb/solib.h