从命令行正常运行时,为什么gdb在eclipse中不起作用? [英] Why is gdb not working in eclipse when it is working fine from command line?

查看:86
本文介绍了从命令行正常运行时,为什么gdb在eclipse中不起作用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用eclipse为Linux创建并成功编译了一个C ++应用程序。当我从命令行调试它时,一切工作都很好,我可以进行调试。

I have created and successfully compiled a C++ application for Linux using eclipse. When I debug it from the command line everything works perfect, I can debug just fine.

但是我需要在eclipse中调试,因为它更方便和容易。我配置了调试会话,并尝试启动它时出现错误:

But I require debugging in eclipse because is more convenient and easy. I configure the debug session and when trying to launch it I get the error:

Error in final launch sequence
Failed to execute MI command:
-exec-run
Error message from debugger back end:
Warning:\nCannot insert breakpoint 1.\nCannot access memory at address 0x1fff82e8\nCannot insert breakpoint 2.\nCannot access memory at address 0x80001ea4\n
Warning:\nCannot insert breakpoint 1.\nCannot access memory at address 0x1fff82e8\nCannot insert breakpoint 2.\nCannot access memory at address 0x80001ea4\n

但是我不知道为什么会收到该错误,尤其是因为gdb在我从cmd执行它。

But I have no idea why I am getting that error, especially because gdb is working fine when I execute it from cmd.

这些是我在Eclipse中的c ++编译器标志:

These are my c++ compiler flags in eclipse:

-std=c++98 -O0 -g3 -Wall -c -fmessage-length=0

在创建项目时,我选择了 Hello world C ++项目和 Linux GCC作为工具链。

When creating the project I chose the "Hello world C++ Project" and the "Linux GCC" as the toolchain.

我正在使用以下版本的GDB和Eclipse:

I'm working with the following versions of GDB and Eclipse:


  • Eclipse Neon.1a版本(4.6.1)

  • GNU gdb(Ubuntu 7.11.1-0ubuntu1〜16.04)7.11.1

推荐答案

我可以重现此问题的唯一方法是启用地址断点。就我而言,这是CDT中的错误,但与此同时,一种解决方法是从 Breakpoints 视图中删除或禁用任何地址断点。

The only way I can reproduce this problem is to have address breakpoints enabled. As far as I am concerned this is a bug in CDT, but in the meantime as a workaround remove or disable any address breakpoints from the Breakpoints view.

我已提交臭虫509894 来跟踪CDT中的问题

I have submitted Bug 509894 to track the issue in CDT.

这篇关于从命令行正常运行时,为什么gdb在eclipse中不起作用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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