Codeblocks issue with consoles and debugging - gdb

I am running Codeblocks 13.12 installed from the official ubuntu repos (I am running LinuxMint 18 on 4.4.0-34-generic kernel).
Whenever I have XTerm as my terminal on C::B (Settings->Environment->Terminal to launch console programs:xterm -T $TITLE -e), the debugging works flawlessly.
But when I select gnome-terminal as my "running" terminal, magically the debugging stops working. I do not know if it is a bug or if the gnome-terminal has some issues or even if codeblocks doesn't like gnome-terminal.

Related

Can't run code on geany. Cannot execute build command

I installed geany on Fedora.
It compiles and builds my c++ code but it can't run the code.
"Cannot execute build command "xterm -e "/bin/sh /tmp/geany_run_script_BJ09E0.sh"": No such file or directory. Check the Terminal setting in Preferences"
I'm new on Linux and i don't know how to properly set terminal settings.
Depending on your spin, bring different Console Emulators.
For example, Fedora with KDE comes with konsole terminal emulator.
To use konsole with Geany, configure Edit - Preferences - Tools ->
Terminal: konsole -e "/bin/sh %c"
But, if you still want to use the xterm emulator (lighter and faster), you can install it from the repository, leaving Geany with the default configuration.
sudo dnf install xterm

Error while using Visual studio Remote GDB debugger

I have tried with no success for a good 4 hours to debug a program using Visual studio remote debugger and I keep getting the same error message:
could not launch gdbserver. gdbserver could either be missing on your system and need to be installed, or it failed to start the program.
-My attempted solutions so far:
I logged into the Linux (fedora)remote system and installed gdb, and all the required depencises. However I get another message saying:
no package gdbserver available.
Is there a difference between gdb and gdbserver?
Realizing that I was not succeeding with the Fedora I decided to try and install gdb/dependencies on a Centos7 system. Going to Visual studio and launching the remote debugger. I still get the same error message.
Your expertise will be very appreciated
i installed the gdbserver this works for me on the raspberry pi
sudo apt-get install gdbserver

Netbeans "Resolve missing debugger command" C++

Whenever I try to debug any program (i.e. a welcome message), I get this prompt. Any ideas how to run the debugger for C++ program?
I am using Macbook Pro OS X El Capitan (10.11.3)
For Mac OSX 10.5 and above,
Install Homebrew (if you don't have it already)
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Install GDB
brew install gdb
Go to https://sourceware.org/gdb/wiki/BuildingOnDarwin and follow the instructions to code sign the gdb binary.
If you're on Sierra, run the following command in your terminal
echo "set startup-with-shell off" >> ~/.gdbinit
Finally, run the following comamnd in your terminal
which gdb
Copy the output path from that command, (mine was /usr/local/bin/gdb) into the Debugger Command box in Netbeans and start debugging!
On Linux systems derived from debian, you have to install gdb
sudo apt-get install gdb
Then in debbuger command type
/usr/bin/gdb
More information of gdb can be found in GDB: The GNU Project Debugger
Make sure gdb is installed in your machine. you can do this by following
C:\cygwin64>setup-x86_64.exe -q -P gdb
after this, select gdb as a debugger in netbeans
gdb location
Use Synaptic to install gdb. This debugger is required for Netbeans.
On a Mac, I installed HomeBrew first, then followed this exactly on the Sierra OS. Worked perfectly. After Homebrew is installed, you have to create then sign your gdb certificate. Then select it in your IDE debugger section.
The instructions show how to select gdb in Eclipse, but I got it working in NetBeans by pushing the debugger button and typing in the file path in the popup (as mentioned in this document).
https://www.ics.uci.edu/~pattis/common/handouts/macmingweclipse/allexperimental/mac-gdb-install.html

"Hello World" fails to run. Eclipse (Galileo) CDT plugin problems with MinGW and Cygwin on Windows Vista

Trying to run a simple Hello World C++ program on Eclipse (Galileo) CDT plugin on Windows Vista. Following the "Before You Begin" instructions for Eclipse/CDT...
1) Downloaded and installed the latest Cygwin. However, could not compile with Cygwin.
Internal Builder: Cannot run program "g++": Launching failed
the Eclipse CDT docs say...
currently Cygwin >= version 3.4.4-999 is not supported since gcc and g++ commands cannot >be launched from the windows' native shell
It seems to be a typo (Cygwin version is at 1.7.7) but running cygcheck -c, I get the version of g++ which is 3.4.4.x.
Hence I assumed that this version of g++ cannot be run from the command line. So gave up on Cygwin.
2) Downloaded and installed MinGW, gdb, MSYS.
This time, it was able to compile, but when trying to run, I get a popup saying that
the program Hello.exe has stopped working
You should use either Cygwin, or Mingw, because their dll's might conflict if they're both discoverable via %PATH%.
Show your build process (copypaste text from your build console) and %PATH% contents.
The simplest solution was to install the latest Eclipse (Helios SR1) and the CDT plugin.
I needed to also delete the old projects/import old source into new projects.
For Galileo, see:
http://sourceware.org/ml/cygwin/2010-03/msg00510.html
http://dreamlayers.blogspot.com/2010/01/eclipse-incompatibility-with-cygwin-17.html

Vista-Eclipse (Galileo) CDT w/ MinGW and MinGW's GDB fails to output cerr output

I installed Eclipse and I can get g++ to compile the code correctly; however, when I start the debugger none of the "cerr >>" outputs are ever displayed in the Eclipse console. I tried to run GDB manually and it, too, does not display the cerr output. Is anyone else experiencing this?? I am running the GDB 5.3-something that is available with MinGW.
I think newer versions of GDB work on Windows Vista. Version 6.8 or something is available with the TDM-GCC project.