Skip to content

Debug symbols are missing when gauge-java compiles the Java code #188

Closed

Description

@glalejos

Hi,

I'm trying to debug the Java code in a Gauge project, but debug symbols are missing. As far as I can see in gauge-java.go, the only possible parameterization of the args variable is related to build directories.

It would help if you could either:

  • Add support for a gauge_javac_args variable to the env/java.properties.
  • Set the -g flag to javac when the GAUGE_DEBUG_OPTS environment variable is present.

Expected behavior

Debug symbols are included during Java code compilation.

Actual behavior

Debug symbols are not included during Java code compilation.

Steps to reproduce

  1. Execute gauge run on any Java project.
  2. Use javap -v on any of the generated classes to check that LocalVariableTable is missing or empty on every method.

Gauge version

I'm using the Debian repository.

Gauge version: 1.0.1
Commit Hash: da2676b

Plugins
-------
html-report (4.0.5)
java (0.6.8)
screenshot (0.0.1)

Thank you!

Activity

  1. glalejos commented on Oct 20, 2018

    @glalejos
    Author

    I've set gauge_custom_compile_dir to target/test-classes/ (which is the Maven default), and used mvn test-compile before running Gauge. This way debug symbols are included.

    However, this solution is suboptimal because it requires the Maven parent project to be present during tests, what makes my testing scripts less portable since now they require more code to be uploaded to the testing environment. I would like to leave Maven apart in this scenario.

  2. shubhamsc commented on Oct 22, 2018

    @shubhamsc
    Contributor

    @glalejos It's a good thing to add javac arguments in env/java.properties. So we can add env variable gauge_javac_args, which we want to run at the time of compilation.

    we need to set something sililar to this gauge_javac_args = -g:lines,source
    Is it good enough to solve your problem?

  3. glalejos commented on Oct 22, 2018

    @glalejos
    Author

    Yes @shubhamsc, that's the idea.

    What would the argument separator character be? Given your example, gauge_javac_args = -g:lines,source, the option separator should be the white space character. Note that the gauge_jvm_args option takes a comma separted list of options, what makes it impossible to provide options such as -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=1044 (unless there is a escape character that I'm not aware of).

    If you want to keep consistency among all arguments in the java.properties file, then the white space character should be the separator for all arguments. This could pose a compatibility problem for arguments such as gauge_custom_build_path, which may require additional mechanisms (double quotes?) to enable users to enter white spaces...

  4. AzazelSensei commented on Sep 1, 2026

    @AzazelSensei
    Contributor

    Opened #965 with gauge_javac_args as a space-separated javac flag list, as discussed here.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions