Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » A default .gdbinit file for Eclipse CDT(neon)/MingW on Windows
A default .gdbinit file for Eclipse CDT(neon)/MingW on Windows [message #1751218] Thu, 05 January 2017 18:43 Go to next message
Dennis Mabrey is currently offline Dennis MabreyFriend
Messages: 2
Registered: January 2017
Junior Member
I'd like to be able to set a .gdbinit file for all Eclipse CDT(neon)/MingW projects/workspaces created on a Windows 10 PC.

I originally created a .gdbinit file in my $HOME directory that running GBD alone successfully reads in but when running under Eclipse it appears it is ignored. The .gdbinit file has one line: set new-console on. When I run GDB it says it is on while the Eclipse GBD Console claims it is off.

I know I can set the .gdbinit file for an individual project or for a whole workspace(Windows->Preferences->C/C++->Debug->GDB->GDB command file). This works well but this is for a classroom environment where we will have many students create their own workspaces. It would be nice if new-console was always set to on by default.

Why do I want a new console instead of using the Eclipse console? Because user input functions such as calling scanf() or getchar() has issues (particularly under Neon on Windows) . Calling these functions returns values even when nothing has been typed in yet. Also it seems the Eclipse output buffers stdout so printf/puts calls won't appear until the program is over (yeah I know I can call fflush(stdout)).

There are other reasons but the bottom line is that running from a new console just works best for debugging.

I am sure I am missing something obvious but truth be told I am new to both gdb and eclipse. We are trying to move away from Visual Studio.

Thx

Re: A default .gdbinit file for Eclipse CDT(neon)/MingW on Windows [message #1751287 is a reply to message #1751218] Sat, 07 January 2017 00:44 Go to previous messageGo to next message
Jonah Graham is currently offline Jonah GrahamFriend
Messages: 407
Registered: June 2014
Senior Member
Hi Dennis,

Hopefully we can support you moving to Eclipse CDT + GDB.

There is no way in CDT at the moment of doing what you want beyond what you have already discovered.

However there are some options for configuring Eclipse when you install (using Oomph) so that you can set various preferences and IIRC create arbitrary files. So with Oomph you could customize your CDT install to have the GDB command file preference point at a newly created file.

The best place for answers on Oomph I believe is their forum: https://www.eclipse.org/forums/index.php/f/287/

As for adding a check-box style option into CDT for the set new-console on, I recommend filing an enhancement request, and writing the Eclipse code to fix it would be a great first project in getting to know the internals of CDT's Debug Services Framework. https://bugs.eclipse.org/bugs/enter_bug.cgi?product=CDT&bug_severity=enhancement
Re: A default .gdbinit file for Eclipse CDT(neon)/MingW on Windows [message #1751309 is a reply to message #1751287] Sat, 07 January 2017 16:07 Go to previous message
Dennis Mabrey is currently offline Dennis MabreyFriend
Messages: 2
Registered: January 2017
Junior Member
Thank you immensely for the reply. I had searched high and low for an answer. I'll look into Oomph but for now the students don't seem to have any problems setting up the .gdbinit file themselves for their workspace.

Thanks for the reply I appreciate it.
Previous Topic:Eclipse regex_match();
Next Topic:NEON start-up
Goto Forum:
  


Current Time: Sun May 22 18:01:45 GMT 2022

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

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

Back to the top