m4l490n
m4l490n

Reputation: 1692

Why is gdb not working in eclipse when it is working fine from command line?

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.

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

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

These are my c++ compiler flags in eclipse:

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

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

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

Upvotes: 3

Views: 1936

Answers (1)

Jonah Graham
Jonah Graham

Reputation: 7970

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.

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

Upvotes: 3

Related Questions