-
Notifications
You must be signed in to change notification settings - Fork 207
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
Support invoking objdump on binary files for 'MinGW GCC' and 'Cross GCC' toolchains #361
Comments
Thank you for your input, @jantje. Ideally we should accommodate both MBS and non-MBS projects, both with or without a tool prefix. The |
I don't think "per-project" will do here as there might be more than one toolchain used within one CDT project. |
Totally agree, @Torbjorn-Svensson. I have found a way to lookup an |
Is there/Will there be any easy way for downstream to override how the path and prefix should be collected for a custom toolchain definition? |
Allows GNU tools to be found on the PATH defined by the build configuration of the containing project. Part of eclipse-cdt#361
Yes, I'm working on an optional CDT build variable to provide the GNU tool prefix so that:
|
Allows GNU tools to be found on the PATH defined by the build configuration of the containing project. Part of eclipse-cdt#361
Allows the GNU tool prefix to be specified by a CDT build variable. Modifies the Cross GCC toolchain description to provide the GNU tool prefix. Part of eclipse-cdt#361
Allows GNU tools to be found on the PATH defined by the build configuration of the containing project. Part of #361
Allows the GNU tool prefix to be specified by a CDT build variable. Modifies the Cross GCC toolchain description to provide the GNU tool prefix. Part of eclipse-cdt#361
@Torbjorn-Svensson does #368 address your concerns? Extenders at the |
I took a look at the PR and overall, it looks good. There were a few small questions/suggestions. Let's handle them in the PR and I'm sure we will get a solution that will be extendable for downstream vendors. |
Allows the GNU tool prefix to be specified by a CDT build variable. Modifies the Cross GCC toolchain description to provide the GNU tool prefix. Part of eclipse-cdt#361
Allows the GNU tool prefix to be specified by a CDT build variable. Modifies the Cross GCC toolchain description to provide the GNU tool prefix. Part of #361
The initial objectives described in this issue are now met. I will work on a New & Noteworthy entry. There is an outstanding item for discussion. Namely, a mechanism for updating the binary parser selection for existing MinGW GCC and Cross GCC projects:
|
@jld01 Thanks for your effort, this is a very useful feature! Based on this, I have a question. I downloaded the latest Embedded IDE from Eclipse's website, created a C managed project and selected the riscv-cross toolchain. In the project properties, I set the local toolchain path, and the binary file of the risc-v architecture can be successfully generated after the build. However, when I double-click the elf file, the editor view only shows the header information, and there is no disassembly content. Usually the disassembly is obtained through the objdump tool related to the toolchain, passing the -d parameter. However, the binary parser tab in the project configuration interface provided by CDT does not provide relevant parameter configuration entries. If I want to double-click the binary file and display the disassembly, do I need to modify the cdt? Below is my IDE info:
|
@baoruiqi, the When using the Embedded CDT toolchain descriptions, you will need to define your own CDT Build Variable within the project properties dialog to specify the GNU tool prefix for the timebeing: Name: Modify the value to suit your toolchain and be sure to include the trailing hyphen. |
I have previously configured the toolchain path on the property page of the project. As you said, the header information is indeed generated by the native objdump in the PATH, so why doesn't eclipse use the tools in the riscv toolchain? If I hadn't configure the toolchain correctly, the project wouldn't be built correctly, but the fact is that the project was built successfully and generate the correct risc-v elf. |
@jld01 I found the reason for the unknown architecture. When I first created the c managed project, I chose RISC-V cross gcc, which is provided by the embedded cdt project. And the cross toolchain provided by CDT is Cross gcc. However, when I create a new project based on the cross gcc toolchain and set the binary parser to gnu elf parser, the result of double-clicking the elf file is a mess characters. |
@baoruiqi does the Default Binary File Editor open correctly if you select it explicitly from the context menu of your generated binary in the Project Explorer view? Open With > Other... > Internal Editors > Default Binary File Editor |
I found the reason, when creating a cross gcc project, the generated binary file has no suffix by default. If I add the elf suffix to the current Build artifact on the project properties page, then it works. In addition, double-clicking the .o format object file in the Debug folder does not need any modification though. I'm reading the relevant source code to figure out how the cdt gets the prefix provided by the toolchain for its purpose. Because I wish to make some modifications to the RISC-V Cross GCC provided by Embedded CDT to meet the same purpose. I would be very grateful if you could give me some pointers. |
@baoruiqi I already have a patch for Embedded CDT to generate the |
@jld01 Great, you are so familiar with Eclipse CDT, could you please give me some advice about this Issue? |
When building CDT projects using a native Linux GCC or Cygwin GCC toolchain, the user can double click on the resulting binary file to invoke
objdump
and present the resulting output in a read-only editor part. It would be beneficial to provide equivalent behaviour when using MinGW GCC toolchains and Cross GCC toolchains.For Linux GCC, this capability is implemented via the
DefaultGnuToolFactory
and CDT expects to findobjdump
on the globalPATH
.A few issues:
org.eclipse.cdt.core.ELF
binary parser rather than theorg.eclipse.cdt.core.GNU_ELF
binary parser at present. Easy to fix.org.eclipse.cdt.core.GNU_PE64
binary parser for MinGW GCC toolchains. Easy to fix.objdump
with a prefix (egarm-none-eabi-objdump
) but theIGnuToolFactory
implementation currently has no context from which to determine that prefix.PATH
on Windows hosts or when using a cross compiler. We need a mechanism to lookup the project containing the binary file and from there lookup the per-projectPATH
.The text was updated successfully, but these errors were encountered: