搜索: user-defined
例子。 # save this file in ~/.gdb or some where easy to find.
# then in ~/.gdbinit add the following line...
# source ~/.gdb/osip_gdb_util
#
# help p_osip_list_size
# help p_osip_list define p_osip_list_size
set $list = ($arg0)
set $list_size = 0
set $node = $list->node
while ($node != 0)
set $list_size++
set $node = (__node_t *)$node->next
end printf "List size: %d", $list_size
end
document p_osip_list_size
p_osip_list_size <list>: Print size of osip list
end define p_osip_list
set $list = ($arg0)
set $list_size = 0
set $node = $list->node
while ($node != 0)
set $list_size++
print $node->element
set $node = (__node_t *)$node->next
end
end
document p_osip_list
p_osip_list <list>: Prints the content of the list.
To see the value, cast the information back to the original form.
For example: *(osip_generic_param_t)$1
end

gdb的user-define command的更多相关文章

  1. gdb中的define命令

    可以使用define命令达到类似于display的效果:比如每ni后显示当前5条指令: define s5 ni x/5i $pc end 甚至可以手动传入要显示指令的条数: define s ni ...

  2. J-Link GDB Server Command

    J-Link GDB Server - SEGGER Hilden, Germany – September 15th, 2011 – SEGGER Microcontroller today ann ...

  3. GDB配置与.gdbinit的编写

    GDB配置与.gdbinit的编写 当 GDB(即 GNU Project Debugger)启动时,它在当前用户的主目录中寻找一个名为 .gdbinit 的文件:如果该文件存在,则 GDB 就执行该 ...

  4. gdb 调试学习

    gdb 是unix/linux 系统下的程序调试工具,和IDE(如VS, Eclipse等)的图形化调试工具相比,gdb在断点,跟踪显示方面有着不足,但是它在某些方面比图形化调试工具更加丰富的功能. ...

  5. [转]Building a Basic Fuzzer with GDB: The Five Minute GDB Scripting Tutorial

    link:http://www.praetorian.com/blog/building-a-basic-fuzzer-with-gdb-the-five-minute-gdb-scripting-t ...

  6. 用gdb理解C宏(#和##)

    在Unix/Linux内核代码以及GNU libc源代码中,有两个C的宏被广泛使用. 例如: /* glibc-2.25/sysdeps/powerpc/powerpc64/sysdep.h */ # ...

  7. gdb help all 帮助信息

    Command class: aliases ni -- Step one instruction rc -- Continue program being debugged but run it i ...

  8. 用 set follow-fork-mode child即可。这是一个 gdb 命令,其目的是告诉 gdb 在目标应用调用fork之后接着调试子进程而不是父进程,因为在 Linux 中fork系统调用成功会返回两次,一次在父进程,一次在子进程

    GDB的那些奇淫技巧 evilpan 收录于 Security  2020-09-13  约 5433 字   预计阅读 11 分钟  709 次阅读  gdb也用了好几年了,虽然称不上骨灰级玩家,但 ...

  9. arcmap Command

    The information in this document is useful if you are trying to programmatically find a built-in com ...

  10. GDB 多进程调试

    启动: $gdb <file>  || $gdb 然后(gdb)file <file> 运行: (gdb)run <该程序本身的命令行参数> 查看代码: (gdb) ...

随机推荐

  1. vs2012 发布网站丢失文件

    问题描述 在发布网站时,发现上线的网站总是功能缺失,而本地代码确实没问题. 到发布网站的磁盘去查看,发现丢失了很多静态页面文件. 这是一个很奇怪的问题:mvc的网站,丢失了很多View(大部分的csh ...

  2. Javascript 链式运动框架——逐行分析代码,让你轻松了解运动的原理

    所谓链式运动,就是一环扣一环.我们的很多运动实际上来说指的就是分阶段的,第一个阶段动完,下个阶段开始动. 这个链式运动框架就是用来处理这些问题的. 我们先来看下之前的运动框架,以下是Javascrip ...

  3. PHP简易计算器方法2

    <?php    $sum="";    $num1=$_POST['num1'];    $num2=$_POST['num2']; if(is_numeric($num1 ...

  4. Constructor Prototype Pattern 原型模式(PHP示例)

    当一个类大部分都是相同的只有部分是不同的时候,如果需要大量这个类的对象,每次都重复实例化那些相同的部分是开销很大的,而如果clone之前建立对象的那些相同的部分,就可以节约开销. 针对php的一种实现 ...

  5. struts2笔记10-值栈

    1.问题 提交页面: <h4>注册产品</h4> <form action="save.do" method="post"> ...

  6. vi/vim 键盘

  7. 将Controller中的数据传递到View中显示

    如何将Controller 中的数据传送到View 步骤: (1)要有数据,如果要用到对象可以在Model 中定义对应的类 (2)要有装数据的容器: System.Text.StringBuilder ...

  8. FieldInfo.IsSpecialName Property【转】

    Gets a value indicating whether the corresponding SpecialName attribute is set in the FieldAttribute ...

  9. n!的近似值 (stirling approximation)与 大O记法(big -O- notation)

    參考wiki: 1.n!的近似值 (stirling approximation) (中文) http://zh.wikipedia.org/wiki/%E6%96%AF%E7%89%B9%E9%9D ...

  10. UBUNTU 下如何升级 gcc, g++

    正如大家所知道的GCC并不支持"make uninstall". 一种推荐安装方式就是把GCC 安装在你自己指定的一个路径,当你不须要某个GCC版本号的时候你仅仅须要移除相应版本号 ...