Successfully decode .eh_frame, now able to calculate the base offset of each parameter, can keep going on profiling feature of GKD
Author: admin
objdump 2.24 has bug
objdump 2.24 has bug, but this bug is fixed in 2.25. It dump the wrong address for my 32 bits kernel.
Decoded first two instructions of .eh_frame
Decoded first two instructions of .eh_frame, dwarf spec is lack of detail, need to hack into the objdump to understand each byte, it is time consuming.
binutils compile error
If you compiling binutils and have these error, just remove d-exp.c and try again. d-exp.c should be generated by d-exp.y but binutils makefile won’t delete it during “make distclean”
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 […]
I finally understand why same parameter even has multiple locations
I finally understand why same parameter even has multiple locations. My pass concept is parameter stay in the stack. But after hacking the dwarf, it show me same parameter have multiple location during execution. Take a look below image, I wrote a function call kmalloc2 (blue arrow), the third parameter “size” has three locations (yellow […]
Finally can dump out the parameter type from dwarf standard
Finally can dump out the parameter type from dwarf standard. Some parameter is store recursively, so need to read out DW_AT_type and get the right die and decode again. Personally I think dwarf is just too hard to parse. Here is the code https://sourceforge.net/p/peter-dwarf/code/254/tree//trunk/src/main/java/com/peterdwarf/dwarf/DwarfLib.java https://sourceforge.net/p/peter-dwarf/code/254/tree//trunk/src/main/java/com/peterdwarf/dwarf/Dwarf.java
This is how to decode dwarf DT_Type
This is how to decode dwarf DT_Type
heading toward to decode the range address of dwarf
heading toward to decode the range address of dwarf, this job is killing me. And I found the information in die is not always meaningful, see below.
ubuntu 12.04 vnc startup script for fallback mode
Fixed ubuntu vnc keymap problem
ubuntu 12.04 vnc keymap has trouble, D become minimize all windows and S become start menu, run these to fix it.
compile dwarfdump in mac
CFLAGS=’-I /opt/local/include -L /opt/local/lib’ CXXFLAGS=’-I /opt/local/include -L /opt/local/lib’ ./configure –prefix=/peter-dwarfdump make make install Because mac gcc doesn’t search for the /opt/local, so need to specific the path manually.
Peter-dwarf library can show hierarchy data for compile unit now
Peter-dwarf library can show hierarchy data for compile unit now
Thinkaholic open source event 2015/2/10
Thinkaholic open source event 2015/2/10
I should look at this
I should look at this printf -> _fstat -> _sbrk -> write
now is good enough
now is good enough, can focus on library things
tomcat auto startup script
just save this to /etc/init.d/tomcat and link to /etc/rc5.d/S99tomcat
disable gnome “unable to mount…” dialog
gsettings set org.gnome.desktop.media-handling automount false …and enable it again: gsettings set org.gnome.desktop.media-handling automount true
Elf is having duplicate compile unit, why ld doesn’t clear it out?
Elf is having duplicate compile unit, why ld doesn’t clear it out?
why i receive zero in my socket
I have two programs, one written in c++, the other is in java. C++ keep sending bytes to java, overtime write out 400KB. Java keep receiving the data using the readBytes function, this function returns an integer which is the number of byte it actually read for the function call. For every send (400kb) in […]
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.
Empty bochs instrument crash in linux, but not in mac
Empty bochs instrument crash in linux, but not in mac. My instrument code is nearly empty. core dump: configure: run by: bochsrcSDL.bxrc: instrument.h: instrument.cc:
Java has bug again
Java has bug again. After you installed idk 1.8u25 in your mac, open Eclipse.app/Contents/MacOS/eclipse.ini, you will see: -vm /Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home But actually this line has no effect, when you run eclipse with -console -debug, you still see it is running use idk 1.6 “-vm /System/Library/Frameworks/JavaVM.framework”. To fix it, change that line to -vm /Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/bin/java Peter.
make bochs runs faster
Without “CXXFLAGS=-O3”, boots can only runs 20M ips on my i5 mbpr. With that, now is 57M ips.
volatile keyword is not everything to prevent compiler optimization
When you add the keyword “volatile” in front of variable declaration, it prevents compiler to optimize the line that are using that variable. But if the line is completely useless, compiler will still optimized it out, prevent to generate any byte code for it.
bochs problem again
I am unable to get the “” from the input stream. Please help. In command line, when i start bochs, I saw “”, which is very normal. But if i use java to read it out, i never got the . I tried different classes (BufferedReader, InputStream), none of them success.
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 […]
Tutorial : Add a debug command in bochs
This tutorial teach you how to add a debug command in boots, you need to touch these files only: debug.h dbg_main.cc lexer.l parser.y Step 1) First of all, you need to add your command (see below) to lexer.l, don’t add anything below the line “[A-Za-z_][A-Za-z0-9_]* { bxlval.sval = strdup(bxtext); return(BX_TOKEN_GENERIC); }”, because it will eat […]
bochs can’t compile in mac (solved)
bochs can’t compile in mac because the configure always set gui_debugger=1, just set this variable to 0 in line 22459. Bochs can be compile in mac with “./configure –enable-disasm –with-sdl –enable-debugger”
${new} will cause error in old tomcat 7
Below code has error, because the ${new} will crash old tomcat 7. JSTL has bug.
Sharepoint online bug
Sharepoint online bug – If you place an html-email-address to it and click “check” button, it crash. Even you delete all text and the check button can’t resume normal.
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
(solved) install .net 3.5 to azure windows 2012
Install the below fix will resolve this issue http://support2.microsoft.com/kb/3005628
sharepoint 2013 deploy app hang up
In visual studio, when you deploy your sharepoint app, if t hang up in “Installation is in progress”. Make sure your “SharePoint Timer Service” is running, this problem will be solved
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.
command to connect sharepoint 2013 to office web apps server
First, do these in office web apps server Second, do these in sharepoint server
openocd with arm is working
openocd with arm is working
openjtag + openocd + smartarm 2200
Finally connect my openjtag usb device to my old smartarm 2200 development board using openocd. The next step is buy a x86 dev board (intel galileo) and try to use openocd with it. Then port peter-bochs to support openocd, finally i will have a hardware debug platform for os dev. http://www.zlgmcu.com is a development board […]