-
-
Notifications
You must be signed in to change notification settings - Fork 130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
call to openOCD doesnt use quotes for arguments and no console output #486
Comments
To correctly check how Eclipse calls applications, I suggest that instead of echoing the entire line, to write a simple shell script that prints the number of arguments and each argument on a single line. |
Error in services launch sequence |
... tricking eclipse into an error shows the command line without the quotes for the port commands... |
And echo.py (As you mentioned) import sys for arg in sys.argv: |
Find a way to run the echo script to double check. |
Things get weird, I converted the script to an executable (renamed it to printi.py), the output: D:\workspace\test-arm\printi.exe |
...so only the last part is split into several arguments... |
Eclipse starts OpenOCD correctly (at least it did for many years already), the problem occurs only if you start it manually. |
Shouldnt it work then? But it doesnt, but did with the 2019-09 release. Is there any way to disable thr last echo commnd to openocd? Starting openocd from console with the echo doesnt work to. |
The last echo message is needed to inform Eclipse when the GDB server is ready to accept commands. It is difficult to tell what is wrong. Can you provide more details on what you installed, what/how you configured, to try to reproduce the problem? |
I tried the 2019-12 install with C/C++ Development Tools 9.10.0.201912051559 org.eclipse.cdt.feature.group Eclipse CDT IT worked with the newest openocd. Exchanging openocd with the ergument printer i got: printi |
The differences: eclipse platform and the plugin version. Still works |
Ok. It seems to bee a problem with the 6.x versions of the plugins or 4.18 version of eclipse Download and extract the platform binary for windows from http://download.eclipse.org/eclipse/downloads/drops4/R-4.18-202012021800/ Start eclipse and create new workspace Go to "install new software...", select "-- all available sites --- " and select: It takes a while and then create a new c/c++ project Then go into window preferences and configure the global paths under MCU. Here some differences: Now create a simple main.c with just int main(void) and _exit in it and compile. Gcc will complain about exit but generates an elf. Then create an debug configuration gdb openocd debugging. With 4.16 the debug console opens with red text and openocd is running **EDIT: I used the matching versions of the embedded c/c++ or mcu eclipse plugins for the chosen eclipse platform *** |
Unfortunately I cannot reproduce your issue. I downloaded the latest Windows Eclipse IDE for Embedded C/C++ Developers, created a stm32f4discovery blinky project, added the OpenOCD debug configuration, and the debug started as expected:
As seen above, Eclipse properly passes the Started by GNU MCU Eclipse message when starting OpenOCD, and later identifies it in the console output, to know when to start the GDB client. |
But how about the way i discribed? |
Hah, I got it. Could you please add a dependency to the following two packages? C/C++ Development Tools 10.1.0.202012020953 org.eclipse.cdt.feature.group Eclipse CDT Without the Development Tools eclipse can compile correctly, but cannot find gdb for some reason (albeit it is in the same directory as g++ or gcc). If you trick it via PATH to find gdb it does not start openocd correctly. This is the minimal package list for a minimal embedded c/c++ eclipse: C/C++ Development Tools 10.1.0.202012020953 org.eclipse.cdt.feature.group Eclipse CDT |
@jonahgraham Jonah, do you understand where the problem might be? |
Maybe its the development tools alone. I first installed only the embedded packets, then the gdb hardware debugging and finally the development tools packet (which in the end made it work). |
Could you check the |
No - but I will experiment and see what I can figure out. |
I'm afraid you are trying to mix various older versions. The current Embedded CDT plug-ins (v6.x) require CDT 10.x, part of Eclipse 2020-09. |
I take it from this comment you have identified the issue? If so, I won't be doing any further looking at this. |
I don't know if I identified the issue, since I don't know what exactly @marcel-kanter tried to achieve by trying to manually install a selection of the features, I just spotted that those are older versions. |
Please be aware that during my tests I used several versions of eclipse platform and the matching embedded tools. Don't mix the versions of differend posts. I always started with a fresh extract of the platform (e.g. 2012-06 or 2012-12 version) and installed the matching plugins for either version, as it is displayed in the "Install new software dialog of eclipse". The mechanism behind that resolves dependencies (e.g. the platform 2012-12 and the 10.1 version of c/c++ development tools) I should have noted that for the older versions of eclipse i used the matching older versions (former "mcu eclipse" ilg....) of the plugins. The issue is the missing dependency to C/C++ Development tools, as I wrote in my post before closing the issue:
And Looking back at my opening post the c/c++ development tools were missing there too. Besides that I woke up in times when you installed your OS from diskettes and I hate to download a ton of megabytes, install it, already knowing that i dont need it. So i start a barebone platform and install only the plugins i need. Especially working in teams with multiple languages like python, php and c makes managing and distributing the development environment easier. Since only one folder (besides the binaries like gcc) need to be copied. |
I don't understand your use case, and generally I don't recommend mixing plug-ins from different sources, thus the safest way is to use separate Eclipses for different languages, but it is up to you to decide your configuration. If you think that you identified a problem of missing dependencies, can you provide a detailed sequence of steps for us to reproduce? |
Hallo, I have also stumbled over the openOCD problem with quotes and also found this old issue #12 After a lot of try and error I have found a solution: TL;DR shared configuration file with linux line ending works, configuration file with windows line endings end with error I am working with eclipse on Windows and the starting situation was, that I was continueing work on an existing project. When I tried to debug with openOCD the debug session ends with the error
I was wondering what the problem is, because I have another project with working debug configuration. So to make sure that some hidden configuration is not the problem, I had created a new debug configuration. Set all needed configuration values as used in the working debug configuration. But still the problem persists. I had started testing starting openOCD from command line and the problem happen there also. When running openOCD with So it seems single quotes are not supported by windows command line (cmd). But I have found no way to change how the echo command is appended by the eclipse plugin. So why the other project is working??? Both projects are using shared files for debug configuration and so I have compared both. The diff program shows that only the project names differ AND the line ending. After changing the line ending of the debug configuration file both debug configurations are working 😃 So it seems when creating a new debug configuration on windows eclipse is creating a configuration with windows line ending (independant if shared or local file is used), but the plugin is only working with linux line endings. Hope this helps and you can get rid of your problem, too. Edit It seems after the debug configuration is working, also changing the line ending back to windows \r\n does not trigger the issue. So it seems the issue occur only when creating or improting the debug configuration the first time. |
I thought that the recommendation was that the xPack Windows Build Tools be used in this context in which case the BusyBox implementation of |
The command line is only relevant for testing outside of Eclipse. I think the problem is caused by the openOCD plugin which is using no shell. At least if I understand the discussion around this topic correctly. |
@dhMat, if you think that you identified a bug, please provide a clear procedure to reproduce it. |
I did not manage to reproduce the problem. After fixing the problem by changing the line endings in the shared debug configuration file. Also importing the old project no longer trigger the bug. I do not know what the difference between was when the problem occured and now |
I don't really understand what you're saying here.
The plugin will use the xPack Windows Build Tools BusyBox |
I suspect that the same applies to the Eclipse plugin launching OpenOCD. |
I've installed eclipse completely fresh.
After creating a new debug configuration and starting it, eclipse show an error. openocd exited with (1). See openocd console for details.
BUT the console is empty.
Running openocd with the -s and -f parameter from the workspace directory works. Driver gets loaded and the connection opened. So openocd is working properly (It worked already with an orlder version of the MCU eclipse plugin - before and after the risc-v got included into the plugin)
Even with the arguments quoted, it works:
But with the echo it doesn even do enything
Then I put the path to openocd to the PATH env variable. Didn't help with eclipse.
After replacing openocd with echo it prints the following into console:
That shows that it gets called without any quotes.
After doing a search I found an article, complaining about the same problem from 2016, so I copied the newest version of openocd to my drive, to check whether the new version behaves diefferently (old version was 2020-05-03). The old version was from the same site too.
Nope. Same problem.
C/C++ GCC Cross Compiler Support 10.1.0.202011181638 org.eclipse.cdt.build.crossgcc.feature.group
C/C++ GDB Hardware Debugging 10.1.0.202011291939 org.eclipse.cdt.debug.gdbjtag.feature.group
Eclipse Platform 4.18.0.I20201202-1800 org.eclipse.platform.ide
Embedded C/C++ Arm Cross Compiler 6.1.1.202101200825 org.eclipse.embedcdt.managedbuild.cross.arm.feature.group
Embedded C/C++ Core 6.1.1.202101200825 org.eclipse.embedcdt.feature.group
Embedded C/C++ OpenOCD Debugging 6.1.1.202101200825 org.eclipse.embedcdt.debug.gdbjtag.openocd.feature.group
PHP Development Tools (PDT) 7.2.0.202005271851 org.eclipse.php.feature.group
PyDev for Eclipse 8.1.0.202012051215 org.python.pydev.feature.feature.group
Wild Web Developer 0.10.5.202012011111 org.eclipse.wildwebdeveloper.feature.feature.group
eclipse.buildId=4.18.0.I20201202-1800
open jdk-13.0.1
windows 10 64 bit
Could You simply remove the last echo and put the other arguments into quotes?
The text was updated successfully, but these errors were encountered: