如何用source insight写内核代码

简介: 别的文章都会做很多说明, 铺垫, 我就不多说了, 直接来重点 vim写代码的时候, 有一种情况不是很好处理, 比如 struct a{int x; int y; iny z} struct b{int x; int y; iny z} pb->z想从这里跳到到结构体b的定义需要编辑器理解pb的含义, 而不是简单的字符查找 那就让我们来用source insight吧 以

别的文章都会做很多说明, 铺垫, 我就不多说了, 直接来重点

vim写代码的时候, 有一种情况不是很好处理, 比如
struct a{int x; int y; iny z}
struct b{int x; int y; iny z}

pb->z想从这里跳到到结构体b的定义需要编辑器理解pb的含义, 而不是简单的字符查找

那就让我们来用source insight吧

以前都是用Windows挂samba来运行的, 缺点就是速度慢, kernel code文件太多, 一共5w多个, 等同步要很久

还有人会把代码让到windows机器来看, 这样编辑, 编译都需要同步, 不方便

思路就是把source insight放到本地来跑, 用wine可以, 但是source insight是i386的, 所以需要32位的wine, 编译32位的wine需要一堆32位的package-devel包, alios7又没有这些包

简单来说, 用docker来解决这一些

来, 放个dockerfile在这里, 你们都懂了
有了这东西, 写代码能找到快感

FROM centos/systemd

MAINTAINER "shidao.ytt" <shidao.ytt@alibaba-inc.com>
#docker run --privileged -v /sys/fs/cgroup:/sys/fs/cgroup:ro -p 5901:5901 -d di
#docker build --rm --no-cache -t di .

RUN yum -y install bind-utils traceroute net-tools bash-completion tigervnc-server vim git wget epel-release
RUN yum -y install python2-pip

# pip install
RUN pip install --upgrade pip; pip install sshuttle

# install config vnc
RUN yum -y group install GNOME Desktop
RUN systemctl stop firewalld.service; systemctl disable firewalld.service

RUN cp /lib/systemd/system/vncserver@.service /etc/systemd/system/vncserver@:1.service
RUN sed -e 's|<USER>|root|' -e 's|/home||' -i /etc/systemd/system/vncserver@:1.service

RUN systemctl daemon-reload; systemctl enable vncserver@:1.service
RUN echo -e "111111\n111111\nn\n" | vncpasswd

# install wine
RUN yum -y groupinstall 'Development Tools'
RUN yum -y install libX11-devel freetype-devel alsa-lib-devel.i686 libsndfile-devel.i686 readline-devel.i686 glib2.i686 glibc-devel.i686 libgcc.i686 libstdc++-devel.i686 pulseaudio-libs-devel.i686 cmake portaudio-devel.i686 openal-soft-devel.i686 audiofile-devel.i686 freeglut-devel.i686 lcms-devel.i686 libieee1284-devel.i686 openldap-devel.i686 unixODBC-devel.i686 sane-backends-devel.i686 fontforge libgphoto2-devel.i686 isdn4k-utils-devel.i686 mesa-libGL-devel.i686 mesa-libGLU-devel.i686 libXxf86dga-devel.i686 libXxf86vm-devel.i686 giflib-devel.i686 cups-devel.i686 gsm-devel.i686 libv4l-devel.i686 fontpackages-devel ImageMagick-devel.i686 openal-soft-devel.i686 libX11-devel.i686 docbook-utils-pdf libtextcat tex-cm-lgc alsa-lib-devel audiofile-devel.i686 audiofile-devel cups-devel.i686 cups-devel dbus-devel.i686 dbus-devel fontconfig-devel.i686 fontconfig-devel freetype.i686 freetype-devel.i686 freetype-devel giflib-devel.i686 giflib-devel lcms-devel.i686 lcms-devel libICE-devel.i686 libICE-devel libjpeg-turbo-devel.i686 libjpeg-turbo-devel libpng-devel.i686 libpng-devel libSM-devel.i686 libSM-devel libusb-devel.i686 libusb-devel libX11-devel.i686 libX11-devel libXau-devel.i686 libXau-devel libXcomposite-devel.i686 libXcomposite-devel libXcursor-devel.i686 libXcursor-devel libXext-devel.i686 libXext-devel libXi-devel.i686 libXi-devel libXinerama-devel.i686 libXinerama-devel libxml2-devel.i686 libxml2-devel libXrandr-devel.i686 libXrandr-devel libXrender-devel.i686 libXrender-devel libxslt-devel.i686 libxslt-devel libXt-devel.i686 libXt-devel libXv-devel.i686 libXv-devel libXxf86vm-devel.i686 libXxf86vm-devel mesa-libGL-devel.i686 mesa-libGL-devel mesa-libGLU-devel.i686 mesa-libGLU-devel ncurses-devel.i686 ncurses-devel openldap-devel.i686 openldap-devel openssl-devel.i686 openssl-devel zlib-devel.i686 pkgconfig sane-backends-devel.i686 sane-backends-devel xorg-x11-proto-devel glibc-devel.i686 prelink fontforge flex bison libstdc++-devel.i686 pulseaudio-libs-devel.i686 gnutls-devel.i686 libgphoto2-devel.i686 openal-soft-devel openal-soft-devel.i686 isdn4k-utils-devel.i686 gsm-devel.i686 samba-winbind libv4l-devel.i686 cups-devel.i686 libtiff-devel.i686 gstreamer-devel.i686 gstreamer-plugins-base-devel.i686 gettext-devel.i686 libmpg123-devel.i686

RUN cd; wget http://dl.winehq.org/wine/source/2.x/wine-2.22.tar.xz; tar xJf wine-2.22.tar.xz; cd wine-2.22; ./configure; make -j60; make install

RUN yum clean all

CMD ["/usr/sbin/init"]
目录
相关文章
|
8月前
|
机器学习/深度学习 Java 开发工具
机器学习PAI常见问题之export DEBUG=ON 后编译不过如何解决
PAI(平台为智能,Platform for Artificial Intelligence)是阿里云提供的一个全面的人工智能开发平台,旨在为开发者提供机器学习、深度学习等人工智能技术的模型训练、优化和部署服务。以下是PAI平台使用中的一些常见问题及其答案汇总,帮助用户解决在使用过程中遇到的问题。
|
开发框架 .NET Java
【Source Insight】工具入门到精通
【Source Insight】工具入门到精通
|
Ubuntu Linux 数据安全/隐私保护
【Source Insight】工具入门到精通(下)
【Source Insight】工具入门到精通
RK3399平台开发系列讲解(内核入门篇)1.51、platform_get_resource 函数实现细节
RK3399平台开发系列讲解(内核入门篇)1.51、platform_get_resource 函数实现细节
187 0
|
设计模式 缓存 算法
【Java并发编程实战14】构建自定义同步工具(Building-Custom-Synchronizers)(下)
JDK包含许多存在状态依赖的类,例如FutureTask、Semaphore和BlockingQueue,他们的一些操作都有前提条件,例如非空、任务已完成等。
174 0
|
开发工具 C++ 程序员
Source Insight 3.X 标签插件v1.0发布
Source Insight可以说是一款程序员必备的开发/阅读源码工具,美中不足的是SI没有标签栏,多个源码之间切换很不方便,于是我就乘闲暇之余写了该作品sihook:标签插件;不过严格意义上来说sihook并不算是插件,而是一个内挂:)   如何给Source Insight添加标签栏呢?可以查看...
1462 0