GDB stuck at “Configuring GDB Aborting configuring GDB” - c

I've installed (OSX Mojave 10.14.6.) Eclipse CDT and GNU MCU Eclipse plugin and finaly GNU Tools for ARM. My goal is to build and debug ARM code using GDB (arm-none-eabi-gdb).
I've created a Hello World project for Arm, which builds ok - but, debugging seems not to work with GDB (that comes with the Arm package). GDB gets stuck:
I have set the proper paths in Eclipse to arm-none-eabi-gdb.
I have signed the arm-none-eabi-gdb (with the same certificate that I used to sign GDB installed via brew into /usr/local/bin/gdb the day before - and it worked!).
I have also tried running Eclipse as root from command line.
Nothing helps.
The message is "Configuring GDB Aborting configuring GDB".
What to do?

Probably what is going on here is that you built to a given target (ARM based) and you're trying to run it (with gdb) on your mac (x86).
You'll need an emulator or QEMU to properly run on your mac or maybe a real board.

Related

How do I install crystal-lang on rapsberry pi?

When I try to add it to sources as per debian install instructions I get this error. I'm guessing this means that there are no arm packages for it.
Failed to fetch https://dist.crystal-lang.org/apt/dists/crystal/InRelease Unable to find expected entry 'main/binary-armhf/Packages' in Release file (Wrong sources.list entry or malformed file)
I'm guessing I probably need to install it from source. How would I go about doing that with an arm cpu? When I check it out and run make I get the error:
You need to have a crystal executable in your path! Makefile:113:
recipe for target '.build/crystal' failed make: *** [.build/crystal]
Error 1
Any suggestions would be greatly appreciated.
EDIT: There's now a semi-official repository for crystal on raspbian, check it out here: http://public.portalier.com/raspbian
Crystal doesn't build Debian packages for ARM, and you're correct in that you'll need to build from source.
However, the Crystal compiler is written in Crystal. This presents the obvious problem of how to get a compiler to build the compiler. The answer is cross-compilation: building an arm binary on a x86 desktop computer and copying it across.
Here's a quick step-by-step based on my memory of last time I cross-compiled:
Install Crystal on a x86 desktop PC, and check it works.
Install all required libraries on the desktop and Raspberry Pi. You'll need the same LLVM version on the Raspberry Pi and desktop. This is probably the hardest and longest step. You can install llvm 3.9 from debian testing for ARM, see this stackoverflow post for how to install only LLVM from debian testing.
Check out the sources from git on both computers, and run make deps.
Cross-compile the compiler by running this command in the root of the git repository:
./bin/crystal build src/compiler/crystal.cr --cross-compile --target arm-unknown-linux-gnueabihf --release -s -D without_openssl -D without_zlib
This command will create a crystal.o file in your current directory, and also output a linker command (cc crystal.o -o crystal ...).
Copy crystal.o to the raspberry pi, and run the linker command. Be sure to edit the absolute path to llvm_ext.o so that it points to the Crystal checkout on your Raspberry Pi, not the checkout on your desktop. Also make sure that all references to llvm-config in the command are for the correct LLVM version. For example, changing /usr/local/bin/llvm-config to llvm-config-3.9 on Raspbian.
Run the crystal executable in your current directory (./crystal -v) and make sure it works.
Ensure to set CRYSTAL_PATH environment variable is set to lib:/path/to/crystal/source/checkout/src so that the compiler can find the standard library when compiling applications.

gdb Debugger stuck on 62% during initialization in Eclipse

I am new to coding and trying to get eclipse neon running on my macbook air. I am having trouble getting the debugger to work. I installed gdb with homebrew, created a certificate and signed gdb as per the instructions in the link:
https://www.ics.uci.edu/~pattis/common/handouts/macmingweclipse/allexperimental/mac-gdb-install.html
I then configured eclipse debugger settings with the location of the newly installed gdb. However now when I try to start the debugger, the initialization process starts but gets stuck forever on 62%. Any tips on how to solve this? Could it be a memory issue? MBA has 4gb RAM...
This is a known bug in CDT - Bug #509737
The problem in summary is that CDT version 9.2.0 cannot work with GDB version 7.12.
One way to resolve this is to use an older version of GDB, for example GDB version 7.11
Another way to workaround this is to pretend GDB 7.12 is actually version 7.11.
Create the following executable script:
#!/bin/sh
if [ "$1" = "--version" ]; then
echo "GNU gdb (Debian 7.11-1) 7.11"
exit
fi
exec /usr/local/bin/gdb "$#"
and configure eclipse to run it instead of gdb.

gdb package not appearing in Cygwin setup

I need to write some programs in C, so I've downloaded and installed cygwin and Eclipse Neon cpp.
I've installed the required Cygwin packages and my C programs are compiling and running but I can't debug them because GDB isn't installed.
I get "Error with command: gdb --version" when I try to debug in Eclipse.
I've opened the Cygwin setup again, searched but there's no GDB in the packages (Picture of the installation) list. How can I add the GDB package to the Cygwin setup and install it so that Eclipse can use it?
The difference between my question and the one that is suggested is that I entered the setup but can't find the package.
I'm running Windows 10, Eclipse Neon.1a Release 4.6.1 and Cygwin 2.6.0
Thanks

Error while launching gdb version Eclipse

Here is an issue I've worked around by simply not using Eclipse for debugging, but it's getting out-of-hand.
I've used Eclipse Helios, Juno and Kepler over the last year and they all display exactly the same problem when I try to debug a local C/C++ application.
When I try to debug, it simply reports the error "Error while launching gdb --version".
gdb is in my path, but to be sure, I change the Debug settings to list the path explicitly. If I do that, I simply get "Error while launching /usr/bin/gdb --version", which is no better.
I'm using Scientific Linux version 6.4 (as required by my customers) and currently, I'm trying to use Eclipse Kepler. Running from the command line, gdb has no problem reporting it's version:
# gdb --version
GNU gdb (GDB) Red Hat Enterprise Linux (7.2-60.el6)
[... licensing info]
Please, please let me know how to fix this as I have spent weeks working at only a fraction of the rate I would expect because I'm not utilizing an integrated development environment, but using separate tools.
I've seen other similar posts, but they are either
(a) about Windows / MingW - although I've tried their ideas anyway, just in case they work.
(b) don't have any answer provided.
As Scientific Linux is a RedHat derivative, I expect RHEL or CentOS information would be as relevant for me.

Sourcery G++ (cross-compiler for ARM) installation failure

I was trying to install Sourcery G++ cross-compiler for ARM on Ubuntu 10.04 LTS from the following link ->http://www.codesourcery.com/sgpp/lite/arm/portal/release644
I did not use the graphical interface since I got java.awt error. While using the console mode of installation, I provided all the details asked by the program.(changed the default location of installation)
Some time into the installation, I got this error:
Unable to create file links
An error occurred while running an internal program.
Please remove the toolchain from "/home//cross_compiler".
EXITCODE=-1
I'm not sure what the reason is. I redid this process as a root user and I still got the same error.I am trying to install this on a 64 bit machine.
I suppose it is important to check your system requirements.
There is the possibility you are running a 64bit build of Ubuntu.
Sourcery G++ requires 32bit host libraries. Ensure those are installed.
In my mind, it may be easier to run a 32bit installation in a VM.
If that is not possible, there are installation logs in the 'uninstall' directory of your installation attempt directory. That may help you troubleshoot the issue.
You must have the 32-bit compatibility libraries installed to install Sourcery CodeBench.
From the FAQ: "What do I need to do to install and run Sourcery CodeBench on an x86 64-bit Linux host system?"
https://sourcery.mentor.com/sgpp/lite/arm/portal/kbentry62
Full FAQ here:
https://sourcery.mentor.com/sgpp/lite/arm/portal/target_arch?#action=faq&target_arch=arm
The ARM Lite edition tools have their own mailing list where you can ask such questions.
Go to sourcerytools.com and use the "arm-gnu" mailing list for ARM Lite edition questions.
Cheers!

Resources