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

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

Open
glalejos opened this issue Oct 13, 2018 · 3 comments
Open

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

glalejos opened this issue Oct 13, 2018 · 3 comments

Comments

@glalejos
Copy link

glalejos commented Oct 13, 2018

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!

@gaugebot gaugebot bot added the community label Oct 13, 2018
@glalejos
Copy link
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.

@shubhamsc
Copy link
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?

@glalejos
Copy link
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...

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

No branches or pull requests

3 participants