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

[Bug]: --cpp-lines does not work if -g appears later in command line #26577

Open
mppf opened this issue Jan 21, 2025 · 1 comment
Open

[Bug]: --cpp-lines does not work if -g appears later in command line #26577

mppf opened this issue Jan 21, 2025 · 1 comment

Comments

@mppf
Copy link
Member

mppf commented Jan 21, 2025

Summary of Problem

Description:
I'm trying to debug something and need to look at the C code. If I compile with chpl program.chpl --savec=tmp --no-cpp-lines -g then I still see the #line directives. But, if I put the -g before --no-cpp-lines then it works.

(A bonus task related to this issue would be to come up with a better user-facing name than -cpp-lines; that can be misinterpreted as "Show me the C++ lines" but it actually means "Include #line directives so you see .chpl line numbers").

Is this issue currently blocking your progress?
No

Steps to Reproduce

Source Code:

any

Compile command:

see above

Associated Future Test(s):
TODO

Configuration Information

chpl version 2.3.0

@mppf mppf added the type: Bug label Jan 21, 2025
@bradcray
Copy link
Member

I'd consider this to be working as intended, in the sense that we typically process flags in order and permit the effects of the flags to override one another silently. For example chpl --fast --bounds-checks will do all the things --fast normally does, including disabling bounds checks, and then --bounds-checks overrides that default.

Here, -g has the effect of turning on -cpp-lines (for non-developers) as documented on the man page:

       -g, --[no-]debug
          Causes the generated C code to be compiled with debugging turned on.
          If you are trying to debug a Chapel program, this flag is virtually
          essential along with the --savec flag. This flag also turns on the
          --cpp-lines option unless compiling as a developer (for example, via
          --devel).

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

No branches or pull requests

2 participants