GDB调试ROS Launch启动程序

GDB是一个由GNU开源组织发布的、UNIX/LINUX操作系统下的、基于命令行的、功能强大的程序调试工具。我尝试用GBD调试的原因是程序出现非重复性的错误,报错后找不到原因。

1.报错

[kitti_filtering_node-4] process has died [pid 17594, exit code -11, cmd /home/lmk/file/OSCode/dev_lidarclass/L8C/catkin_ws/devel/lib/lidar_localization/kitti_filtering_node __name:=kitti_filtering_node __log:=/home/lmk/.ros/log/bbfdea4e-a753-11ed-8674-a4ae128129e9/kitti_filtering_node-4.log].
log file: /home/lmk/.ros/log/bbfdea4e-a753-11ed-8674-a4ae128129e9/kitti_filtering_node-4*.log

2.在launch文件中添加

launch-prefix = "gdb -ex run --args"

3.我添加后的效果

    <node pkg="localization"  type="filtering_node"  name="filtering_node"  output="screen" launch-prefix = "gdb -ex run --args"></node>

4.启动launch文件后,会出现和GBD配置相关的一些输出信息,可以直接按回车进行确认。

GNU gdb (Ubuntu 8.1.1-0ubuntu1) 8.1.1
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
---Type <return> to continue, or q <return> to quit---process[base2imu-6]: started with pid [9878]

5.发现错误,应该内存没搞好。

Thread 1 "kitti_filtering" received signal SIGSEGV, Segmentation fault.
0x000055555559c259 in lidar_localization::KITTIFilteringFlow::ValidLidarData() ()
(gdb) valid imu: 1 valid gnss: 1valid velocitydr: 0 valid gnssgps: 0

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值