Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » How to set GDB breakpoint actions?(How to use GDB "breakpoint command list" feature?)
icon4.gif  How to set GDB breakpoint actions? [message #1231183] Tue, 14 January 2014 02:25 Go to next message
tomas kafka is currently offline tomas kafkaFriend
Messages: 1
Registered: January 2014
Junior Member
Hello,

I'd like to be able to something like this in Eclipse:

**Debug Configurations->Startup->Initialization commands or Run commands**
break main
commands
echo "Do something useful"
end


Regular Gdb console supports this, but when you write this in the Eclipse window(**), the process gets blocked after "commands", because it expects your hand-input.

Has anybody an idea how to overcome this? I tried to send a HERE document to commands, but it's not possible. "commands" expects either a breakpoint number after it, or nothing.

I know Eclipse has built-in mechanism for doing actions on breakpoints (breakpoint properties), but there's not an option "gdb command".

Gdb breakpoint command list is an extremely useful stuff, there must be a way.

Thank you for help
Re: How to set GDB breakpoint actions? [message #1231483 is a reply to message #1231183] Tue, 14 January 2014 19:47 Go to previous message
Marc Khouzam is currently offline Marc KhouzamFriend
Messages: 357
Registered: July 2009
Senior Member
There is no support in the Eclipse/CDT UI to set GDB actions on breakpoints. CDT has it's own small set of actions that can be run when a breakpoint is hit. You can right-click on a breakpoint and choose "Breakpoint Properties... -> Actions" to see what is available. Press "New" to create a new action.

As for using the gdb console, it should allow you to set GDB actions yourself. I just tried it:

b 11
Breakpoint 5 at 0x4007e9: file test.cc, line 11.
commands
> echo "do something useful"
> end
"do something useful"

Make sure you are in the actual gdb console an not the process console or the gdb traces console.

Marc
Previous Topic:Remote execution of bash commands with IRemoteProcessBuilder
Next Topic:Problem debugging vector of pointers to objects
Goto Forum:
  


Current Time: Thu Apr 25 14:49:56 GMT 2024

Powered by FUDForum. Page generated in 0.03211 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top