

When doing systems research, we sometimes need to modify/add new stuff into the Linux kernel.

Hosted on GitHub Pages - Theme by orderedlist Building a Custom Linux Kernel & Debugging via QEMU + GDB If you have some new or better idea, please contact me.Guanzhou's personal storage for lecture notes, blog posts, & good mood. This is referred the official document, which is available here Value is that of the variable defined by the mouse pointerĬTRL-K set a breakpoint at assembly address shown by mouse positionĬTRL-H clear a breakpoint at assembly address shown by mouse positionĬTRL-J add the selected variable at mouse position to the watched Mouse pointer position: ~ CTRL-P print the value of the variable defined by the mouse pointerĬTRL-X print the value that is referenced by the address whose List of default key mappings: CTRL-Z send an interrupt to GDB and the program it is runningĬTRL-N next: next source line, skipping all function callsĬursor position: ~ CTRL-B set a breakpoint on the line where the cursor is locatedĬTRL-E clear all breakpoints on the line where the cursor is located “youvar” represents the variable you want to watch. To do this, you also can input the following on your terminal(gdb) Then the window will be split, and then click the variable you want to watch, and press C+J, then you can see the variable appears in another window.

SHIFT+r(that is capital R)It will run and stop at your break point SHIFT+s(that is capital S)It will step And watch your variable, input following on gvim And then press CTRL+B, then, break point is set. For example, you can click the line you want to set break point. Then, gdb is opened on your terminal, and your gvim is opened at the same time Cool down now input the following on your terminal(gdb): If everything is right during compiling, then If your machine tell you that you need readline, then install libreadline5-devĪnd then, copy some files to ~/.vim you can refer my folder:Ĭp /usr/local/share/vim/vimfiles/clewn.vim ~/.vim/plugin/Ĭp /usr/local/share/vim/vimfiles/doc/clewn.txt ~/.vim/doc/Ĭp /usr/local/share/vim/vimfiles/macros/clewn_mappings.vim ~/.vim/macros/Ĭp /usr/local/share/vim/vimfiles/syntax/gdbvar.vim ~/.vim/syntax/ Note here, may be some one will be suffered from the dependency problem during their installing. And extract the file, then use your terminal to enter the clewn folder
#HOW TO INSTALL GDB DEPENDENCIES HOW TO#
How to install: first of all, you should have your gvim installed,Īs well as gdb And then download the source file of clewn note here, not vimgdb. You can use C-B to make a break, and press R to run your program, and press S to step, and C-J to add the variable you want to watch. Well, this can be changed by you, you can split the window any way you like.
#HOW TO INSTALL GDB DEPENDENCIES CODE#
First, I will show you the screen shot The screen of vim is divide into two sub windows, the top one can display the code and the bottom one shows the variable you want to watch.
