REDHAWK组件调试 [英] REDHAWK component debugging

查看:203
本文介绍了REDHAWK组件调试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法调试工作.

我正在使用REDHAWK的2.1.0版本,并且正在尝试创建自定义组件.

I'm using the 2.1.0 version of REDHAWK and I'm trying to create custom components.

我可以获得运行和工作的发行版.

I can get release version to run and to work.

这就是我的工作,我创建了一个非常基本的自定义组件,该组件接受输入,将其乘以2并将其推入输出流,非常简单.现在,我尝试在沙盒中以调试模式运行此组件,立即崩溃.我唯一看到的是调用栈的最后一个条目,即

Here's what I do, I have created a very basic custom component that takes input, multiplies it by two and pushes it to the output stream, super simple. Now I try to run this component in debug mode in sandbox, instant crash. The only this I can see is the last entry of the callstack, which is

boost::shared_ptr<rh_logger::Logger>::operator->() at shared_ptr.hpp:653

如果我选择不调试就运行组件,则一切正常.它甚至可以做乘法.

If I choose to run my component without debugging, everything works. It even does the multiplication.

我不知道会发生什么,显然,这个智能指针类会进行断言检查以验证它返回的指针,并因为它为零而导致崩溃.作为->运算符,这似乎很危险. SIGSEGV是引发的错误,我想知道BOOST_ASSERT是否会导致失败?

I have no idea what goes on, apparently this smart pointer class does a assert check to validate the pointer that it returns and ends up crashing because it's zero. Being the -> operator, this seems quite dangerous. SIGSEGV is the error being throw, I wonder if BOOST_ASSERT causes that on failure?

操作系统是64位的CentOS 7,它运行在常规的台式机英特尔处理器上,不记得是哪个.

Operating system is CentOS 7 64 bit and it's running on regular desktop intel processor, can't remember which.

我按照REDHAWK手册2.2部分的说明通过下载资源库安装了REDHAWK.

I installed REDHAWK by downloading the repository as instructed in 2.2 part of the REDHAWK manual.

新组件是使用REDHAWK IDE(基于Eclipse)创建的,我选择了C ++作为程序语言.它似乎是一个共享库,当我运行它时,将启动一个名为ComponentHost的进程.

The new component was created with the REDHAWK IDE (eclipse based), I selected C++ as the Program language. It seems to be a shared library and when I run it, a process called ComponentHost is started.

我试图通过右键单击项目"菜单中的组件,然后在沙箱"中选择调试为-组件"来启动沙箱中的组件.以这种方式在发布模式下运行组件.

I'm trying to start the component in the sandbox via right-clicking the component in the Project menu and selecting Debug as - Component in the Sandbox. Running the component in the Release mode this way works.

推荐答案

我可以通过Python沙箱调试组件,因此只需使用[]中的测试系统,只需几个变量即可缩小组件范围:

I'm able to debug a component via the Python sandbox, so just a couple of variables to help narrow it down, with my test system in []:

  1. 哪个操作系统? [CentOS 7]
  2. REDHAWK是从源代码还是RPM安装的? [RPM]
  3. 这是新的基于C ++共享库的组件(入口点类型为"SharedLibrary")还是可执行文件("Executable")? [都]
  4. 您如何启动该组件?通过Python沙箱,以"debugger ='gdb'"作为启动参数?还有其他启动参数吗?

另一种可能的调试方法是正常启动该组件,然后从另一个终端窗口附加GDB.

Another possible debugging approach is to launch the component normally, then attach GDB from another terminal window.

首先,找到组件过程:

  • 如果它是共享库:

  • If it's a shared library:

ps -o pid,comm -C ComponentHost

如果它是可执行文件(其中"是组件可执行文件的名称):

If it's an executable (where "" is the component executable's name):

ps -o pid,cmd -C <name>

希望,很明显,哪个过程是您的目标组件.如果您正在同一沙箱中运行多个共享库组件,则它们将全部属于同一ComponentHost实例.

Hopefully, it's clear which process is your target component. If you're running multiple shared library components from the same sandbox, they will all be part of the same ComponentHost instance.

然后,使用GDB附加到该过程:

Then, attach to the process with GDB:

gdb -p <pid>

从本质上讲,这就是沙盒连接GDB的方式;但是,独立运行它可以让您在连接调试器之前先根据自己的喜好设置流.

This is essentially how the sandbox attaches GDB; however, running it independently allows you to set the flow up to your liking first before attaching the debugger.

这篇关于REDHAWK组件调试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆