Category Archives: GKD
GKD symbol parsing engine failed to parse c++ symbol

GKD symbol parsing engine failed to parse c++ symbol
dwarf is too much for c++

One side effect about changing the kernel from c to c++ is that: in the kernel file, the number of dwarf information will increase dramatically from 1,000 to 1,550,000. This let the peter-dwarf parser work slowing to build a tree to display it (But the dwarf parsing still fast). I added the parameter in PeterDwarfPanel […]
GKD debugger shortcut

GKD debugger shortcut
All svn history for peter-bochs debugger

Its time to keep track of all history, peter-bochs change svn server for a few times. Here are all svn history: peter-bochs-self-host  <– peter-bochs svn history hosted in my own server peter-bochs-google <– peter-bochs svn history hosted in google code gkd <– peter-bochs renamed to GKD, svn history hosted in my own server
Amazing recording feature by specific which code-block you want to record

In the original GKD design, it works with bochs instrumentation. Being helped (https://sourceforge.net/p/bochs/discussion/39593/thread/d960fe94/?limit=50) by the author of bochs (Mr Stanislav Shwartsman ) emulator, now we can use the prefetch instruction to specific which code-block you want to record, it becomes even more useful now. Every code surrounded by PREFETCHT0 and PREFETCHT1 instruction, GKD will record jumping instruction […]
GKD can dump the exceptions now

GKD can dump the exceptions now, it helps me to trace what happened to my kernel
GKD is running fast with bochs instrumentation stub now

GKD is running fast with bochs instrumentation stub now, it captures all jmp/call/int/ret, all instructions that change you EIP. I am using H2 as the backbone database, every second can records over 100,000 instruction, which is pretty fast. Turn on subtitle when you are watching it:
Successfully decode .eh_frame

Successfully decode .eh_frame, now able to calculate the base offset of each parameter, can keep going on profiling feature of GKD
Tsinghua ucore kernel with GKD

I talked to Professor Chen from Tsing Hua (http://media.cs.tsinghua.edu.cn/cn/cheny), i tried their education kernel (https://github.com/chyyuu/ucore_lab). I modified a little bit their Makefile so that it can be compiled in Mac and debug using my GKD debugger.
I finally understand why “DW_OP_fbreg: 0” is possible

In the following function kmalloc2, take a look the first parameter, the memory location of that parameter is stated by dwarf “DW_AT_location : 2 byte block: 91 0 (DW_OP_fbreg: 0)”, where “DW_OP_fbreg: 0” means stack+0. I was thinking why it is possible. Because when cpu executed call instruction, it already pushed 4 bytes into the […]
objdump has bug

objdump command has bug, i tried to use this command “objdump -dS kernel” to display mixed assembly and c code. But objdump has bug, it dump the same piece of c source code in two different memory locations. I double checked the dwarf data, nothing wrong. On more prove the dwarf is correct, my GKD […]
now is good enough

now is good enough, can focus on library things
The jump profiling is little bit enhanced

The jump profiling is little bit enhanced. After load up the ELF kernel, it can read out all symbols and display it in the jump profiling window. It helps people to tracing where the EIP jumping to which c++ function.
My proposal to Bochs team

Dear Bochs Team My name is Peter, the author of GKD, prior call peter-bochs. Peter-Bochs parses the bochs debugger output. During the last 3 years, I am busy to support each version of bochs because the output of bochs debug command is different. I want to format the bochs debugger command output to xml, so […]
GKD 20141011 released

Fixed a serious bug using windows bochs. In java, the function String::matched will return false when it has a ‘\r’. Download here https://www.dropbox.com/s/7nf2swf1exkisna/GKD-20141011.jar?dl=0
GKD with windows is working

Someone comlpaint GKD dosen’t work with Bochs in windows. Because the bochs path has space. I just tested it in windows 7, this issue doesn’t exist.
GKD dependency tree graph

GKD dependency tree graph
GKD progress 2014/04/14

Still working on the stub. Refactor the whole project and adding one more layer (add debugger stub to support different emulators) to the architecture, all are very hard and time consuming, even the whole project is developed by me. But this experience make be serious to the project-initial-design. Architecture is *important* !!!
JLibGDB need 333 mins to execute 10 millions single step commands to gdb

JLibGDB need 335 mins to send 10 millions single step commands to gdb and execute. Not bad.
JLibGDB

I was trying to create a new debug server in qemu, but it is failed, there are so many pieces of code are twitted with GDB, so a new debug server is unable to make it work. Now I changed my direction, because on gdb communication protocol, i extend it to fit for peter-bochs (will […]
GKD Dev Plan 2013/05/25

test : PB -> C -> catch breakpoint -> C C -> catch breakpoint -> N x Si -> C restart Qemu refactor all the equals(“bochs”) code to LibGKD better to use enum for bochs/qemu enhance profiling feature for vnc recording Here is the list of gdb command: (gdb) help all   Command class: aliases […]
Able to display the qemu screen in GKD

I use Tightvnc java library to display the qemu screen in GKD. The tightvnc java library is able to display in a JFrame/JApplet, but not in a JPanel, so I modified it to make it work in a JPanel, all the code is in , take a look the function initVNCPanel()
converted LibGKD to maven project

converted LibGKD to maven project, because peter-swing is now a maven project, better to convert it too
Restructuring the debugger

At the moment, i am facing 2 big problems of bochs, the first one is unsolvable, bochs running too slow. It is ok if you are doing a hobby OS development, but if you are trying to use bochs to run a full feature Linux kernel or a windows 7, it is just so slow. […]
when you debugging qemu, it will keep firing SIGUSR1 so gdb will always catched in some breakpooints that are not defined by you

when you debugging qemu, it will keep firing SIGUSR1 so gdb will always catched in some breakpooints that are not defined by you, to turn off the SIGUSR1, you have to: (gdb) info signal SIGUSR1 Signal Stop Print Pass to program Description SIGUSR1 Yes Yes Yes User defined signal 1 And if deemed to not […]