Bugzilla will undergo maintenance 2024-03-29 18h00 CET. Bugzilla will be placed in read-only mode at that time.

Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 507974 - Open Declaration on an identifier in an assembly file
Summary: Open Declaration on an identifier in an assembly file
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-indexer (show other bugs)
Version: 8.6.0   Edit
Hardware: PC Windows 7
: P3 enhancement (vote)
Target Milestone: 9.3.0   Edit
Assignee: Nathan Ridge CLA
QA Contact: Markus Schorn CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-11-22 12:27 EST by Matthias Eckhart CLA
Modified: 2016-12-31 03:38 EST (History)
2 users (show)

See Also:


Attachments
Example Source Code (11.47 KB, application/zip)
2016-11-22 12:27 EST, Matthias Eckhart CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Matthias Eckhart CLA 2016-11-22 12:27:15 EST
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.
Comment 1 Nathan Ridge CLA 2016-11-22 12:58:35 EST
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?
Comment 2 Nathan Ridge CLA 2016-12-07 21:47:05 EST
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).
Comment 3 Eclipse Genie CLA 2016-12-07 21:47:46 EST
New Gerrit change created: https://git.eclipse.org/r/86685
Comment 5 Nathan Ridge CLA 2016-12-14 12:36:29 EST
Fixed for 9.3.
Comment 6 Nathan Ridge CLA 2016-12-31 02:39:35 EST
(As mentioned in bug 507285, this isn't hooked up for Ctrl+Click. Filed bug 509798 for that.)
Comment 7 Nathan Ridge CLA 2016-12-31 03:38:16 EST
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