Eclipse: what is MI command and why does it matter for running the C code? - eclipse

While trying to debug my C code snippet with Eclipse, it shows out the following popup.
Error in final launch sequence
Failed to execute MI command:
-exec-run
Error message from debugger back end:
Unable to find Mach task port for process-id 4550: (os/kern) failure (0x5).\n (please check gdb is codesigned - see taskgated(8))
Unable to find Mach task port for process-id 4550: (os/kern) failure (0x5).\n (please check gdb is codesigned - see taskgated(8))
Is there a solution for this matter? Also, I want to ask you if it actually bothers a lot to use Eclipse when writing a code in C. I never had this kinds of trouble when I first started learning Xcode, but now there seems to be quite a lot of things I should care with Eclipse.

From Community Forums
When CDT launches, it tries to set a breakpoint at main, so it will interrupt execution when your program starts. However, your target is already running so the breakpoint cannot be set and the whole things fails.
You could simply tell your launch not to set that breakpoint and let it connect to your target.
Go to: Run->Debug Configurations... and find your launch configuration. Then select the Startup subtab, scroll down and uncheck "Set breakpoint at" in the "Runtime options" subsection.
or See gdb fails with “Unable to find Mach task port for process-id” error

Related

Eclipse CDT Error in GDB debugger target is null

I want to debug my test.out program with the the gdb debugger from mingw. Calling the gdb debugger with the image file is running successful on the terminal window, but every time I started the debugger from eclipse I got the
**Error message from debugger back end:
You can't do that when your target is `None'
Failed to execute MI command:
load C:\Temp\test.out
The gdb commander was configured as path/gdb.exe and image and symbol files are the out file.
In the debugger console view I only see the the information about the installed gdb version simular the output that I got when I type only gdb in the terminal window. No MI command.
Any hints how I can solve my problem or find more informatio about it?
Thanks.
I found the solution, I was too stupid. I configured my debug configuration as gdb hardware debugger, but since it is a c-application, I have to configure it as such one.

Visual Studio Code with XDebug Getting Stuck

I'm using XDebug with Visual Studio Code on Windows 10 to debug PHP.
The debugger works but from time to time it's getting stuck (hits the breakpoint but doesn't respond to step in, step over commands).
I tried switching to XDebug nts version (Not Thread Safe) but it doesn't help. Restarting the web server (Apache) doesn't resolve it either. Sometimes computer restart helps but not always...
Any solution or workaround? (Even a command line that frees this deadlock)
Having out of context debug expressions in the watch window causing the debugger to get stuck.You should clear the watch window from expressions.I guess the evaluation of out of context expressions make the debugger to get stuck.

'Failed to execute MI command: -exec-run' error when trying to debug a GNU project with Eclipse

I wish to debug GNU Emacs in Eclipse IDE for C/C++ on my macOS Sierra. I have downloaded the source code with Git and built the project successfully via the command line. I then imported the project to Eclipse as an existing Makefile project with the GNU autotools toolchain setting.
I can now run the Emacs GUI from Eclipse. However, when I try to debug it (with gdb), I get the following error message:
'Launching emacs-26.0.50.1' has encountered a problem.
Error in final launch sequence
Failed to execute MI command:
-exec-run
Error message from debugger back end:
During startup program terminated with signal ?, Unknown signal.
During startup program terminated with signal ?, Unknown signal.
I managed to get rid of this error by specifying the full path to the .gdbinit file in the Run > Debug Configurations... > C/C++ Application > emacs-26.0.50.1 > Debugger > GDB command file: textbox.
I now get a different error, but this is a matter for another question...
I had a similar error message while using the debugger for a small dummy code. I used the suggestion given in this link and got it fixed. In short, I had to change the debugger to an older one. Hope that helps if you are still having the same issue.
The problem for me was using USB 3.0 port. Connected board to USB 2 port and it was working fine.

stm32l0: Failed to execute MI command. Error erasing flash with vFlashErase packet

I'm using a Nucleo STM32L031 with AC6 STM32 workbench (eclipse).
I write my application and go to debug mode, everthing was working well until I add another function in my application. I notice that when I remove/comment the "new_function", the software can go to debug mode again. However when I add the "new_function" to the code and go to debug, an error occurs and it cannot go to debug mode.
Error: Error in final launch sequence
Failed to execute MI command:
load C:Project_STM32L031K6-Nucleo\\Debug\\Project.elf
Error message from debugger back end:
Error erasing flash with vFlashErase packet
Error erasing flash with vFlashErase packet
This error does not occur only for this specific "new_function", but also for other functions e.g TIM21_Init() generated by STM32Cube.
I tried to search for the solution, but couldn't find it.
Thanks
Bien
In my case (stm32f429) changing this option helped:
This is an OpenOCD issue, not a problem with your code. I got this issue when the debugger command file was referring to a "stlink-v2-1" but what I actually have is an "stlink-v2". I'm using the STM32F0 Discovery board.
I believe the Nucleo board has the "stlink-v2-1" so you might have the opposite problem as me. Check to make sure that the setting under "Run menu > Debug Configurations > Debugger > OpenOCD setup" is set to the correct debugger.
If a debug configuration file is being used (the "use default script" or "use local script" option is selected) open that file and look for a line like:
source [find interface/stlink-v2.cfg]
In my case the project wizard had created a template that was referencing stlink-v2-1. Changing it to the above fixed the problem.
UPDATE:
I also got this problem when Eclipse crashed and left OpenOCD running in the background. Run
$ ps aux | grep openocd
And if you see an instance of OpenOCD running when the debugger is not, kill it.

How to have change debugger setting in Eclipse for a launch file

His,
I have been trying to find out why starting DevMode with Debugger from Eclipse was so slow and noticed in the list of processes on my machine the following line:
/usr/lib/jvm/jdk1.6.0_14/bin/java -agentlib:jdwp=transport=dt_socket,suspend=y,address=localhost:47248 ...
Apparently the application is suspended to wait until the debugger is connected which takes about 2 minutes. I would like to set "suspend=n". Does anyone know where I could set this directive. The vm section in Eclipse launch configuration is empty and if I paste the updated debugger config there is a error telling that the values are entered twice.
As I understand it, Eclipse takes this config from somewhere and inserts it automatically when I run launch configurations in debugger mode.
Thanks
You can't remove that parameter and, if you could, it wouldn't make a difference. When you connect a new browser to the GWT OOPHM instance it has to compile the entire project for use in development mode. This is what takes time, not waiting for the debugger to attach.