GDB 7.9.1 compilation fails - build

I need the newest GDB to install arm-none-eabi-gdb from macports, but I get this compliling GDB from sources, what's wrong?
Here is build log

Related

How to install RISCV64 gdb?

I'm trying to install a debugger for riscv64-unknown-none-elf on Ubuntu 20 with apt-get. What package do I need to install to get the riscv64-unknown-none-elf-gdb command?
Normally gdb binary is the part of toolchain, you can install the riscv toolchain.
https://github.com/riscv/riscv-gnu-toolchain

How to fix hang in gdb in ld-linux.so.2 when running a 32-bit executable on a 64-bit Ubuntu (18.04) system?

I'm trying to debug a 32-bit executable on a 64-bit Ubuntu system. It runs just fine by itself from the command line, but when I try to use gdb, it hangs in ld-linux.so.2. Also, gdb works for the 64-bit version of the executable. Does anyone have a clue as to what I should try?
I just re-imaged a machine to Ubuntu 18.04.3, and I installed the multilib versions of gcc and g++.
Thanks in advance.
gdb <executable>
GNU gdb ...
This GDB was configured as "x86_64-linux-gnu"
...
Reading symbols from <executable>...done.
(gdb) show archi
The target architecture is set automatically (currently i386)
(gdb) break main
Breakpoint 1 at ...
(gdb) run
Starting program...
warning: Breakpoint address adjusted from 0xf7fd9be0 to 0xfffffffff7fd9be0.
...
(7 of these)
[hangs...]
[In another terminal, ran 'kill -CONT <pid>']
Program received signal SIGCONT, Continued.
0xf7fd9be0 in ?? () from /lib/ld-linux.so.2
(gdb) cont
[hangs again...]
UPDATE: This problem has been fixed for Ubuntu in the gdb package version 8.1-0ubuntu3.2, so just upgrading your packages (sudo apt update && sudo apt upgrade) should help currently.
ORIGINAL ANSWER:
#EmployedRussian suggested in his edit to the question:
By downgrading from gdb=8.1-0ubuntu3.1 to gdb=8.1-0ubuntu3 the debugger started working again for me.
This also worked for me on Ubuntu 18.04.3. You should issue these commands:
sudo apt install gdb=8.1-0ubuntu3 # downgrade GDB to the working version
sudo apt-mark hold gdb # prevent upgrading (until the repository version is fixed)
I created a bug report for Ubuntu: https://bugs.launchpad.net/ubuntu/+source/gdb/+bug/1848200
You can click Does this bug affect you? if you have an Ubuntu account to get it fixed sooner.
Probably this gdb bug:
https://sourceware.org/bugzilla/show_bug.cgi?id=23210
Try upgrading to the current GDB version (8.3.1). If Ubuntu doesn't offer a package for that, you can try compiling it yourself.
This is now fixed in 8.1-0ubuntu3.2 in bionic-updates: https://launchpad.net/ubuntu/+source/gdb/8.1-0ubuntu3.2

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

A Python Exception error in gdb 7.10

I have installed gdb 7.10 under Ubuntu 14.04 by compiling from the source as detailed in this answer (with the only exception that I copied the executable into /usr/bin). When I execute commands in gdb, I get the following error:
Python Exception <type 'exceptions.NameError'> Installation error: gdb.execute_unwinders function is missing:
What can I do to get rid of it?
What can I do to get rid of it?
GDB wants to install more than just the GDB binary. To make a complete installation, remove /usr/bin/gdb and do make install.

Eclipse CDT cannot debug using gdb on Mac

I have a C++ project imported to Eclipse CDT. I can build and run the project using Makefile and argument settings. However, when I tried to add a debug point and run "debug as local c/c++ application", it throws me an error of "Launching projectName" has encountered a problem. Error with command gdb --version
By expanding the Details, it gives: Error with command: gdb --version
Cannot run program "gdb": Unknown reason
I installed the gdb by Macports before. If I enter command ggdb it returns the version info. If I type which ggdb, it gives /opt/local/bin/ggdb. I tried to add "PATH" to debug configuration -> environment variables and give the path value to it, but it did not work. How should I set the path and link the path please? And what should the variable name be.
The gdb version on my machine is GNU gdb (GDB) 7.7.1
Added: I looked up which ggdb and used the link James provided to change gdb debugger to browse to that path. But it did not work still.
Thanks.
It looks like Eclipse is using the default gdb that was on the system before you installed ggdb from macports. This link shows how to change the debugger settings, change it to ggdb which is the name Macport uses.
After installing ggdb from Macports you will have to sign it with a certificate so it will be allowed to control other processes, take a look at "Certifying GDB" here. After creating the certificate, make sure you select the correct name when signing:
$ codesign -s gdb-cert $(which ggdb) /// 'ggdb'