首页 > 其他 > 详细

gdb的user-define command

时间:2015-05-27 21:00:42      阅读:279      评论:0      收藏:0      [点我收藏+]
搜索: 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

原文:http://www.cnblogs.com/shaohef/p/4534230.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!