How do I install gdb on a Macbook M1 to use it in Eclipse? - eclipse

I am quite new to the programming world and am trying to learn some coding on Eclipse by following a guided self-study book.
For the course I should use Eclipse with gdb for debugging. Unfortunately I cannot get gdb working; I managed to follow the steps in this file (https://www.ics.uci.edu/~pattis/common/handouts/macmingweclipse/allexperimental/mac-gdb-install.html) and everything worked, excpet for gdb to relaunch after quitting. So now I am quite clueless about how to proceed?
I also tried installing it via Homebrew, but when executing
brew install gdb
I get the message
gdb: The x86_64 architecture is required for this software. Error: gdb: An unsatisfied requirement failed this build.
I know that there are issues with gdb on Mac with M1 chip, but is there any way to resolve this? My computer knowledge isn't very good as for know, so I probably need quite a step-by-step guidance.
Thank you very much in advance!

GDB has not been ported to MacOS for the M1 (AArch64) architecture. The lldb debugger is available for MacOS on M1, you could consider using that debugger.

Related

I want to program STM32 using keil uVision on a macbook with an m2 processor. How to do it and is it possible at all?

I have keil uVision on Windows using Parallels. I have STM32(a lot of different) and ST-LINK. So, I want to firmware my program from a macbook with m2 processor. Can I do it?
I tried to find the drivers in the internet, but nothing works. If you can give me instructions on what to do, I will be very grateful to you.
Keil as you know is not supported on Unix platforms and as powerful as the MacBook is you cannot use it. However, you can use UTM software, and install Windows 11 for ARM from here:
https://www.microsoft.com/en-us/software-download/windowsinsiderpreviewARM64
You can then install Keil on the windows.
As a fellow MacBook user, I feel left out with Keil not being in support but we do have 2009 options such as Eclipse. Pair eclipse with brew and the terminal and you almost have a Keil experience.
Try out this video of the UTM, Windows 11 procedure:
https://www.youtube.com/watch?v=KGZMV8IuUtA

How to install assembly x86 on vs code for m1 mac

I'm taking a class for assembly x86 and I haven't figured out how to get it running on my current version of vs code. I was wondering if someone can explain how to do this or link to a tutorial they found.
Some extra things that may be helpful: Computer is an m1 mac, I have the necessary things installed to run c++ and python, vs code is the 2022 version.

Eclipse 2019-03 C/C++ lldb debugger setup on macOS Catalina

I'm trying to set up lldb debugger on Eclipse and I follow this link https://wiki.eclipse.org/CDT/User/FAQ#How_do_I_get_the_LLDB_debugger.3F
Follow by the paragraph "How do I install the LLDB debugger integration?", the content is out-of-date and I try to google but still can't find the answer. My problems are:
In my Eclipse Help > Install new Software, I can find any C/C++ LLDB Debugger Integration option to install.
I'm using Xcode version 12 and it no longer support lldb-mi.
Can anyone help me on this thank you.
lldb-mi is no longer part of the basic lldb distribution, but you can get the sources (and instructions on building it) here:
https://github.com/lldb-tools/lldb-mi

CUDA Nsight Eclipse debugger error (Mac OS X)

I am running Nsight Eclipse edition on my MacBook PRO (OS X 10.8.2, mountain lion, CUDA 5.0, GT650M)
and I am getting a strange error each time I try to start the debugger in Nsight.
In the console I get: Coalescing of the CUDA commands output is off. and an error screen.
Here is a screenshot of the error:
I went through the Nsight documentation and found this line:
GPUs used to run X11 (on Linux) or Aqua (on Mac) cannot be used to
debug CUDA applications in Nsight Eclipse Edition. Consult cuda-gdb
documentation for details.
Does this mean I can't run the debugger form Nsight, but just from terminal?
The message you are seein means the debugger was not properly setup on your system (e.g. it will not even work from the console). Please follow the steps outlined in "Setting Up the Debugger Environment" of the cuda-gdb manual
You will need a two-GPU system to debug a CUDA code using visual debugger. Unfortunately, no Mac laptops qualify even though they have Intel graphics. The issue been the OS can start using NVIDIA GPU at any moment and may hang if the device is suspended on a breakpoint.
Your cuda-gdb is not properly code signed, which is required by the Darwin kernel to debug applications.
Follow this guideline to create a System code sign certificate
http://www.noktec.be/archives/1251
Then, code sign the following binaries (assuming the certificate you created is cuda_gdb)
sudo codesign -s cuda_gdb /usr/local/cuda/bin/cuda-gdb
sudo codesign -s cuda_gdb /usr/local/cuda/bin/cuda-binary-gdb
Also, in order to launch the application, you also need to make sure the DYLD_LIBRARY_PATH contains the cuda runtime library path
DYLB_LIBRARY_PATH /usr/local/cuda/lib

Eclipse Segfault (OSX)

I'm trying to start eclipse but it crashes after the splash screen and before workspace selection.
This is version: eclipse-java-indigo-SR2-macosx-cocoa-x86_64 on Mac OSX 10.6.8
Launching the eclipse application or executing the alias from a shell ./eclipse (or Eclipse.app/Contents/MacOS/eclipse) results in a segfault.
$ ./eclipse
Invalid memory access of location 0x10 rip=0x7fff84ea3164
Segmentation fault
However, it runs successfully as the super user
$ sudo ./eclipse
Password:
This is fine for now, but running eclipse under sudo does not seem like a good idea.
To make this stranger still, this installation of eclipse worked fine a few months ago and I can't remember changing anything relevant.
Any ideas?
Thanks
Before taking the more drastic step of re-installing Java on Mac OS X [not always so simple :( .. ], I just reinstalled Eclipse and ADT - and it worked fine after that.
In my case, I got this error trying to start Eclipse
Segmentation fault: 11
.. it appeared in my Eclipse ADT setup after I updated the Android SDK for Google Play Services, and then tried to run Installation of update from "Check For Updates". Restarting the computer did not help.
I would try re-installing Java. The Apple installer might thwart you, but this can help get past it.
I'd suggest getting the Java Developer package from Apple, as it includes Javadoc and source for the core libraries.