注册 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

hhfighting的博客

以责人之心责己,以恕己之心恕人

 
 
 

日志

 
 
 
 

roslaunch + gdb debug  

2014-10-10 14:51:34|  分类: ros study |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |
Recently I found gdb is really good. Before when I met some crash, I just guess where the problem might be and then try to put some print inside the code to find the problem. It always take many days to figure out the problem. Now I think I am so stupid why even I didn't consider to find the debug tool. Just this time I can't find the reason, so I did some search, then find gdb is really good. I just take several hours to find where the problem exactly is. Let's give my resolution.
My program is developed under the ROS platform. I need set some parameters to control my program, so I use roslaunch to appoint the specific yaml file. Use gdb in roslauch:

add launch-prefix="gdb -ex run --args" to the <node /> tag

and then roslaunch to run. When program met some problem like memory error , gdb will stop program running and tell me the problem (If I don't set gdb, it often crashes without telling me any reason). Sometime it gives which line. If don't give this, I use bt (backtrace) to see why it exactly it crashes.
During this debug I just use two gdb commands: bt and print.

  
  评论这张
 
阅读(1141)| 评论(0)
推荐 转载

历史上的今天

在LOFTER的更多文章

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2017