eclipse调试器 - 断点意外行为 [英] eclipse debugger - breakpoint unexpected behaviour

查看:179
本文介绍了eclipse调试器 - 断点意外行为的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要一些使用Eclipse断点的帮助。我正在使用Eclipse Luna Service Release 2 RC3(4.4.2),使用GDB 7.1在ubuntu 10.04 32位上处理多线程c ++应用程序。
我设法放置和停止断点,但继续我不会让调试器停在同一个地方,虽然它会一次又一次地执行该行(不停止断点),添加新的断点线以下或更高,使其停止,但是在单击恢复时,它不会再停止在这些行。我试图使用非停止模式,没有,但仍然得到相同的意想不到的结果。
我甚至尝试创建新的项目hello世界,其中我添加了while循环和睡眠,并设置一个断点作为睡眠。它停在那里,但是删除断点,恢复并再次添加断点,它不再停止....

  int main (){
while(1)
{
sleep(1);
}
cout<<< !!!你好,世界!!! <终点//打印!!! Hello World !!!
return 0;
}

我从来没有看到这样的不受保护的行为。请帮助...



谢谢,Ran

解决方案

我也有同样的问题。我可以用你所说的Hello World项目(我在WindowsXP上的KeplerSR2上)来描述它。



我看到你发现自己发布的答案(更改GDB启动器从GDS DSF到传统创建进程启动器),如果其他人遇到同样的问题,我链接:
http://stackoverflow.com/a/27377261/2937955



但是,我理解为什么GDB SDF无法正常工作,在我的情况下至少。看来gdb没有找到源文件。当我添加一个断点时,它正在喊我没有源文件名为D:010workspaceTestGDB.cpp。看来gdb不喜欢反斜杠...为什么这只是简历上的问题?那确实很奇怪



这使我得到以下答案,我希望它也适用于您:保持GDB DSF启动器,但在运行>调试配置> yourLauncher>源选项卡中,单击添加并选择项目 - 相对于源文件夹的路径。选择您的项目并将其放在默认源查找路径之上。


I need some help with using Eclipse breakpoints. I am working on multithread c++ application using Eclipse Luna Service Release 2 RC3 (4.4.2), with GDB 7.1, on ubuntu 10.04 32-bits. I manage to put and stop on breakpoints but on continuing I don't get the debugger stop on the same place though it periodically execute that line again and again (without stopping on breakpoint), adding new breakpoint line below or above, makes it stop, but on clicking resume, it does not stop again at these lines. I tried to work with non stop mode and without, but still get same unexpected result. I even tried creating new project hello world in which I added the while loop and sleep, and set a breakpoint as sleep. It stops there, but removing breakpoint, resuming and adding breakpoint again, it does not stop any more....

int main() {
    while(1)
    {
        sleep(1);
    }
    cout << "!!!Hello World!!!" << endl; // prints !!!Hello World!!!
    return 0;
}

I never seen such unepected behaviour. Please help...

Thanks, Ran

解决方案

It's exactly the same problem I had. I can reproduce it as you described with your hello world project (I'm on KeplerSR2 on WindowsXP).

I saw you found yourself the answer I posted about it (changing the GDB launcher from "GDS DSF" to "Legacy Create Process Launcher"), I linked it if others encounter the same problem: http://stackoverflow.com/a/27377261/2937955

But I understood a bit better why GDB SDF did not work properly, in my case at least. It seems gdb did not find the source files. When I was adding a breakpoint it was shouting at me "No source file named D: 010workspaceTestGDB.cpp". It seems gdb doesn't like backslashes... Why this is a problem only on resume? That sure is strange.

That led me to the following answer, which I hope will work for you too: keep GDB DSF Launcher, but in Run>Debug Configurations>yourLauncher>Source tab, click add and choose "Project - Path Relative to Source Folders". Choose your project and put it above the "Default" Source Lookup Path.

这篇关于eclipse调试器 - 断点意外行为的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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