IDE>> kat>> 返回
项目作者: TOT0RoKR

项目描述 :
Linux Kernel Assistance Tool
高级语言: Python
项目地址: git://github.com/TOT0RoKR/kat.git
创建时间: 2019-05-09T18:36:02Z
项目社区:https://github.com/TOT0RoKR/kat

开源协议:MIT License

下载


Linux Kernel Assistance Tool (KAT)

Table of Contents

Introduce

wide

This project is tested from linux kernel v5.0.2.

KAT help you to develop and analyze linux kernel code conveniently.
KAT provide File tree, Tag list, Explorer for you.

  1. File tree
    • filetree
    • It show you files which will be compiled probably.
  2. Tag list
    • taglist
    • It show you tags in current window.
  3. Explorer
    • explorer
    • It show you tag’s definitions if you put a mapped key.

KAT’s objective is many people use linux kernel source code usefully and
conveniently in various environments which is to be used various text editors
and IDEs through local and remote accesses.
Currently, It is developed for only linux kernel. But perhaps it’ll be improved
to provide useful development environment with various IDEs and text editors for
many projects containing linux kernel. (I call it Plug-in Development
Environment
)

Install

Preceding condition

I don’t prepare auto installer yet. Please do as follows first.

  1. linux/Makefile

    • Append kat into no-dot-config-targets

      1. no-dot-config-targets := clean mrproper distclean \
      2. cscope gtags TAGS tags help% %docs check% coccicheck \
      3. $(version_h) headers_% archheaders archscripts \
      4. kernelversion %src-pkg \
      5. kat
    • Append kat.ref into MRPROPER_FILES

      1. MRPROPER_FILES += .config .config.old .version \
      2. Module.symvers tags TAGS cscope* GPATH GTAGS GRTAGS GSYMS \
      3. signing_key.pem signing_key.priv signing_key.x509 \
      4. x509.genkey extra_certificates signing_key.x509.keyid \
      5. signing_key.x509.signer vmlinux-gdb.py \
      6. kat.ref
    • Append the following line into help:

      1. @echo ' kat - Generate kat file for editors'
    • Append the kat into following block

      1. tags TAGS cscope gtags kat: FORCE
      2. $(call cmd,tags)
  2. linux/scripts/tags.sh

    • Append function definition dokat() between all_kconfigs() and docscope()

      1. dokat()
      2. {
      3. (echo ":options:"; \
      4. echo ":files:"; \
      5. all_target_sources; \
      6. echo ":kconfigs:"; \
      7. all_kconfigs) > kat.ref
      8. }
    • Append caller of dokat into case scope

      1. case "$1" in
      2. "cscope")
      3. docscope
      4. ;;
      5. "gtags")
      6. dogtags
      7. ;;
      8. "tags")
      9. rm -f tags
      10. xtags ctags
      11. remove_structs=y
      12. ;;
      13. "TAGS")
      14. rm -f TAGS
      15. xtags etags
      16. remove_structs=y
      17. ;;
      18. #################### Append under text ######################
      19. "kat")
      20. # ignore sound and drivers
      21. ignore="$ignore ( -path ${tree}drivers ) -prune -o"
      22. ignore="$ignore ( -path ${tree}sound ) -prune -o"
      23. dokat
      24. ;;
      25. #############################################################
      26. esac

Download KAT

Vundle

Append Vundle plugin in .vimrc.
If you don’t know Vundle you can visit here in order to use.

  1. Plugin 'tot0rokr/kat'

and install.

  1. :PluginInstall

Use

First, you should make kat.ref from Makefile where $PWD are in linux
directory.

  1. $ make kat
  2. $ make ARCH=$(ARCH) kat # make ARCH=arm64 kat

Second, execute Vim.

  1. $ vim

and, you could see loading and making kat.database which is in order to be fast
loading.

  • loading

Set Variable

You can customize variables if you want.

Variable Default Description
g:KATUsing 1(True) 0(False) is not using KAT. Otherwise(True), KAT is used
g:KATUsingFileTree 1(True) 0(False) is not using Filetree. Otherwise, used
g:KATUsingTagList 1(True) 0(False) is not using Taglist. Otherwise, used
g:KATUsingExplorer 1(True) 0(False) is not using Explorer. Otherwise, used
g:KATCreateDefaultMappings 1(True) If this value is 0(False), don’t use default key-mapping
g:KATSizeFileTree 30 Filetree’s window width size
g:KATSizeTagList 30 Taglist’s window width size
g:KATSizeExplorer 8 Explorer’s window height size

Set Command and Key-mapping

You can customize command key-mapping.

Global

Target Default Description
\KATAttachFileTree - Open the Filetree window
\KATDetachFileTree - Close the Filetree window
\KATToggleFileTree \]f Toggle the Filetree window
\KATAttachTagList - Open the Taglist window
\KATDetachTagList - Close the Taglist window
\KATToggleTagList \]t Toggle the Taglist window
\KATAttachExplorer - Open the Explorer window
\KATDetachExplorer - Close the Explorer window
\KATToggleExplorer \]e Toggle the Explorer window
\KATShowTagExplorer \]s Open the Explorer window and show Tag definition under the cursor

Filetree

Target Default Description
\KATFileOpenFileTree \ Open a file under the cursor

Filetree’s abbreviations is shown in Filetree by pushing ?

Taglist

Target Default Description
\KATGotoTagList \ Go to a Tag under the cursor

Taglist’s abbreviations is shown in Taglist by pushing ?

Explorer

Target Default Description
\KATGotoTagExplorer \ and g] Open a file which a Tag under the cursor in, and go to the tag
\KATSelectTagExplorer \ If found tags is multiple, you can choose one by pushing Key