You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Debug symbols are missing when gauge-java compiles the Java code #188
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
Execute gauge run on any Java project.
Use javap -v on any of the generated classes to check that LocalVariableTable is missing or empty on every method.
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.
@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?
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...
Activity
glalejos commentedon Oct 20, 2018
I've set
gauge_custom_compile_dirtotarget/test-classes/(which is the Maven default), and usedmvn test-compilebefore 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.
shubhamsc commentedon Oct 22, 2018
@glalejos It's a good thing to add javac arguments in
env/java.properties. So we can add env variablegauge_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,sourceIs it good enough to solve your problem?
glalejos commentedon Oct 22, 2018
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 thegauge_jvm_argsoption 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.propertiesfile, then the white space character should be the separator for all arguments. This could pose a compatibility problem for arguments such asgauge_custom_build_path, which may require additional mechanisms (double quotes?) to enable users to enter white spaces...AzazelSensei commentedon Sep 1, 2026
Opened #965 with
gauge_javac_argsas a space-separated javac flag list, as discussed here.Add gauge_javac_args so javac can emit debug symbols #188 (#965)