Skip to content
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

Comments in assembler files for some architectures are indexed as identifiers #291

Open
fstachura opened this issue Jun 25, 2024 · 3 comments
Labels

Comments

@fstachura
Copy link
Collaborator

See for example:
https://elixir.bootlin.com/linux/latest/source/arch/arc/kernel/head.S#L25
https://elixir.bootlin.com/linux/latest/source/arch/sh/kernel/entry-common.S#L8
https://elixir.bootlin.com/linux/latest/source/arch/arm/kernel/entry-common.S#L43 (end of the line, after @)

This is likely due to the fact, that different architectures have different comment syntax in GNU Assembler.
https://en.wikipedia.org/wiki/GNU_Assembler

@fstachura fstachura changed the title Comments in assembler files some architectures are indexed as identifiers Comments in assembler files for some architectures are indexed as identifiers Jun 25, 2024
@fstachura fstachura added the bug label Jun 25, 2024
@tleb
Copy link
Member

tleb commented Jun 25, 2024

Do you have any idea to address this? The indexer must be able, just from the file content and its filepath, to determine how parsing should be done. That sounds hard, or project specific.

@fstachura
Copy link
Collaborator Author

fstachura commented Jul 2, 2024

I don't see any good way to detect architecture from the assembler file alone, I think this would have to be fixed in a different way for every project.
Another problem is that most assembler files in Linux codebase are in arch/, however, some are not. See https://elixir.bootlin.com/linux/latest/source/drivers/memory/ti-emif-sram-pm.S

@tleb
Copy link
Member

tleb commented Jul 3, 2024

OK, last solution would be to make the general parsing we do be more generic to other assembly language files. For example (^|\s)!\s being the start of a line comment seems pretty safe from a quick grep. Same for ;.

We wouldn't want to have each project definition having to define parsing of assembly files. That's too complex for little benefits.

This sounds low priority to me though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants