Community
Participate
Working Groups
Created attachment 265514 [details] Example Source Code If there are macros within an assembly file, it is not possible to open declaration on the identifiers, even though they are listed in the Outline view. In fact, by performing a double-click on the macro in the Outline view you will directly jump to the `#define` directive. Unfortunately, this won’t happen if you hold <Ctrl> and click on the macro in the assembly source code. For example, in the source code attached there’s a `definitions.h` and a `main.S` file. The assembly file includes this particular header file and uses the defined macro `ANSWER`. In the assembly file itself, there’s also a macro defined named `FOOBAR`. It would be great to provide "Open declaration" support on identifiers, allowing users to jump from line 28 or 29 directly to the `#define` directive when clicking on it.
Thanks. Does this only apply to macros, or are there other kinds of things an assembly file could name, such as a function implemented in C?
This can be implemented as a fairly simple extension to the work done in bug 507285. Since we don't have a full semantic model of code in an assembly file, I believe the best we can do is to search the index for the identifier under the cursor when performing Open Declaration in an assembly file. Additionally, we can search the current assembly file itself for entities that have model elements built for them, like macro definitions (as in the attached example).
New Gerrit change created: https://git.eclipse.org/r/86685
Gerrit change https://git.eclipse.org/r/86685 was merged to [master]. Commit: http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=e3017e7656251315c9e9d1b7a14ad1f642d82a5e
Fixed for 9.3.
(As mentioned in bug 507285, this isn't hooked up for Ctrl+Click. Filed bug 509798 for that.)
I mentioned this, along with bug 507285, in the 9.3 N&N: https://wiki.eclipse.org/CDT/User/NewIn93#Open_Declaration_in_assembly_files