[kgtp] r1555 committed - Update doc

  • From: kgtp@xxxxxxxxxxxxxx
  • To: kgtp@xxxxxxxxxxxxx
  • Date: Wed, 08 May 2013 07:36:33 +0000

Revision: 1555
Author:   teawater
Date:     Wed May  8 00:36:16 2013
Log:      Update doc

http://code.google.com/p/kgtp/source/detail?r=1555

Modified:
 /wiki/HOWTO.wiki
 /wiki/HOWTOCN.wiki

=======================================
--- /wiki/HOWTO.wiki    Tue May  7 23:49:23 2013
+++ /wiki/HOWTO.wiki    Wed May  8 00:36:16 2013
@@ -27,7 +27,7 @@
|| Attach || Use command "gdb -p pid" or GDB command "attach pid" can attach a program that running in the system. || Need insmod gtp.ko first, see [#Exec_it].<br>Then let GDB connect to KGTP, see [#Make_GDB_connect_to_gtp].<br>Please *note* that after GDB connect to KGTP, Linux kernel will not stop. || || Breakpoints || GDB command "b place_will_stop", let program execute after this command. Then programe will stop in the place that setup a breakpoint. || KGTP doesn't support breakpoints but it support tracepoints. Tracepoints can be considered as a special kind of breakpoints. It can be setup in some place of Linux kernel and define some commands that you want to do in its actions. When tracepoints start, they will execute these commands when Linux kernel execute to these place. When tracepoint stop, you can use some GDB commands parse the data that get by tracepoints like what you do when program stop by breakpoints. *Difference* is breakpoints will stop the program But the tracepoints of KGTP not. Please goto [#GDB_tracepoint] get howto use it. || || Memory read || After GDB stop the program(maybe doesn't need), it can read memory of program with GDB command "print", "x" and so on. || You can set special actions to collect memory to traceframe in tracepoints, and get the its value when tracepoint stop.[#collect_expr1,_expr2,_...] [#Use_tfind_select_the_entry_inside_the_trace_frame_info] <br>Or you can read memory directly when Linux kernel or program is running.[#Direct_access_the_current_value_in_normal_mode] || -|| Continue and stop || GDB can continue program execution with command "continue" and stop it with CTRL-C. || KGTP never stop the Linux kernel. But tracepoint can be start and stop.[#Start_and_stop_the_tracepoint] || +|| Step and continue || GDB can continue program execution with command "continue" and stop it with CTRL-C. || KGTP never stop the Linux kernel. But tracepoint can be start and stop.[#Start_and_stop_the_tracepoint] <br> Or use while-stepping tracepoint record Linux kernel with some times single step and Let KGTP switch to replay mode. Then it support execution commands (continue, step) and reverse-execute commands (reverse-continue, reverse-step). [#Use_while-stepping_let_Linux_kernel_do_single_step] || || Backtrace || GDB can print backtrace of all stack frames with command "backtrace". || KGTP can do it too.[#Howto_backtrace_(stack_dump)] || || Watchpoint || GDB can let programe stop when some memory access happen with watchpoint. || KGTP can record the memory access with watch tracepoint. [#Howto_use_watch_tracepoint_control_hardware_breakpoints_to_recor] || || Call function || GDB can call function of program with command "call function(xx,xx)". || KGTP can call function of Linux kernel with plugin.[#How_to_add_plugin_in_C] ||
=======================================
--- /wiki/HOWTOCN.wiki  Tue May  7 23:49:23 2013
+++ /wiki/HOWTOCN.wiki  Wed May  8 00:36:16 2013
@@ -27,7 +27,7 @@
|| Attach || 使用命令"gdb -p pid"或者GDB命令"attach pid"可以attach系统中的 某个程序. || 需要先insmod gtp.ko,请看 [https://code.google.com/p/kgtp/wiki/HOWTOCN#执行]。<br>然后让GDB连接KGTP,请 看[https://code.google.com/p/kgtp/wiki/HOWTOCN#让GDB连接到KGTP]。<br>请 *注 意* GDB连接到KGTP以后,Linux内核不会停止。|| || Breakpoints || GDB命令"b place_will_stop",让程序在执行这个命令后执 行,则程序将停止在设置这个断点的地方。|| KGTP不支持断点但是支持tracepoint。 Tracepoints可以被看作一种特殊的断点。其可以设置在Linux kernel中的一些地方然 后定义一些命令到它的action中。当tracepoint开始的时候,他们将会在内核执行到这 些地方的时候执行这些命令。当tracepoint停止的时候,你可以像断点停止程序后你做 的那样用GDB命令分析tracepoint得到的数据。 *区别* 是断点会停止程序但是KGTP中 的tracepoint不会。 请到 [https://code.google.com/p/kgtp/wiki/HOWTOCN#GDB_tracepoint] 看如何使用它。 || || 读Memory || GDB停止程序后(也许不需要),它可以用GDB命令"print"或者"x"等应 用程序的内存。 || 你可以在tracepoint中设置特殊的action收集内存到 traceframe中,在tracepoint停止后取得他们的值。 [https://code.google.com/p/kgtp/wiki/HOWTOCN#collect_expr1,_expr2,_...] [http://code.google.com/p/kgtp/wiki/HOWTOCN#用tfind选择trace帧缓存里面的条目 ] <br>或者你可以在内核或者应用程序执行的时候直接读他们的内存。 [https://code.google.com/p/kgtp/wiki/HOWTOCN#在普通模式直接访问当前值] || -|| 继续和停止 || GDB可以用命令"continue"继续程序的执行,用CTRL-C停止其。|| KGTP不会停止Linux内核,但是tracepoint可以开始和停止。 [https://code.google.com/p/kgtp/wiki/HOWTOCN#启动和停止_tracepoint] || +|| Step 和 continue || GDB可以用命令"continue"继续程序的执行,用CTRL-C停止 其。|| KGTP不会停止Linux内核,但是tracepoint可以开始和停止。 [https://code.google.com/p/kgtp/wiki/HOWTOCN#启动和停止_tracepoint] <br> 或 者用 while-stepping tracepoint记录一定次数的single-stepping然后让KGTP切换到 回放模式。这样其就支持执行和方向执行命令了。 [https://code.google.com/p/kgtp/wiki/HOWTOCN#使用while-stepping让Linux内核做 单步] || || Backtrace || GDB可以用命令"backtrace"打印全部调用栈。|| KGTP也可以。 [https://code.google.com/p/kgtp/wiki/HOWTOCN#如何_backtrace_(stack_dump)]|| || Watchpoint || GDB可以用watchpoint让程序在某些内存访问发生的时候停止。|| KGTP可以用watch tracepoint记录内存访问。 [https://code.google.com/p/kgtp/wiki/HOWTOCN#如何用watch_tracepoint控制硬件 断点记录内存访问] || || 调用函数 || GDB可以用命令"call function(xx,xx)"调用程序中的函数。 || KGTP可以用插件调用内核中的函数。 [https://code.google.com/p/kgtp/wiki/HOWTOCN#如何增加用C写的插件] ||

Other related posts:

  • » [kgtp] r1555 committed - Update doc - kgtp