在REDHAWK IDE中进行调试 [英] Debugging in the REDHAWK IDE

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

问题描述

在REDHAWK IDE中逐步调试时,行标记有时似乎未遵循正确的程序流程,并且并非所有变量似乎都未正确更新.

When stepping through debugging in the REDHAWK IDE, the line marker sometimes doesn't seem to follow proper program flow and not all variables don't seem to be updating appropriately.

我正在黑板上奔跑,有多个组件.我通过打开组件的.spd.xml文件并单击概述"选项卡上的调试为"超链接来开始调试.这会将组件与其他组件一起添加到黑板上.启动所有组件后,调试器将击中断点.

I am running in the chalkboard with multiple components. I start debugging by opening the component's .spd.xml file and clicking on the "debug as" hyperlink on the overview tab. This adds the component to the chalkboard with the others. The debugger hits my breakpoint after I start all of the components.

是否有人遇到以下任何一种症状(数据未更新或程序步进不正确)?如果是这样,原因是什么,我该如何克服呢?

Has anyone experienced either of these symptoms (data not updating or program incorrectly stepping)? If so, what is the cause and how do I overcome this?

谢谢

-麦克

推荐答案

您可能正在调试C ++可执行文件.编译源代码时,编译器执行了某些优化,与源代码相比,这些优化可能导致机器代码混乱.这些优化也可能会从范围中删除变量.优化级别是编译期间的参数. REDHAWK中使用的默认级别是-O2.有关详细信息,请参见GCC手册页( http://linux.die.net/man/1/gcc ).

It is likely that you are debugging a C++ executable. When the source code was compiled, the compiler performed certain optimizations which may have caused the machine code to be out of order when compared to the source code. These optimizations may also remove variables from scope. The optimization level is a parameter during compilation. The default level used in REDHAWK is -O2. See the GCC man page for details (http://linux.die.net/man/1/gcc).

如果您有此组件的源代码,请尝试以下操作:

If you have the source code for this component, try the following:

make clean; # Remove the binaries previously compiled if any.
./reconf;
./configure;

# Stop here and check the config.log file and search for CXXFLAGS, at the bottom of the log file you'll notice that they are by default set to '-g -O2'.

make V=1 #The V=1 will set the verbose flag and you'll see the calls to g++/gcc. Notice that the CXXFLAGS are in the g++ calls.


To override the CXXFLAGS you may call configure like so:
./configure 'CXXFLAGS=-O0 -g'

现在,当您重新运行V = 1时,您会看到优化级别已从2降低到零.这可能会解决您的调试问题,但产生的优化二进制文件较少.

Now when you rerun make V=1 you'll see that the optimization level has been reduced from 2 to zero. This will likely solve your debugging issue but has produced a less optimized binary.

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

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