Skip to content

Commit 30c34de

Browse files
committed
add more links to root README to cover all the debugging topics; refactor doc names & clean up missing content / dupe content / inaccurate content
1 parent ebe7390 commit 30c34de

12 files changed

+130
-150
lines changed

README.adoc

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,18 @@ This repo should be considered a wiki, into which all developers can push docs.
2727
** link:building/export_plugin_from_eclipse.adoc[Exporting plugins from eclipse]
2828
** link:building/tycho.adoc[All about Tycho]
2929
*** link:building/how_to_test_tycho.adoc[How to test new versions of Tycho]
30+
3031
* Testing & Debugging
31-
** link:debugging/runtime_workbench.adoc[Debugging via Runtime Workbench]
32-
** link:debugging/install_a_local_build.adoc[Installing a local build]
32+
** link:debugging/runtime_workbench.adoc[Debugging via Eclipse runtime workbench]
33+
** link:debugging/how_to_install_a_build.adoc[Installing a local build to Eclipse]
3334
** link:debugging/how_to_test_a_build.adoc[Testing an installed build]
34-
** link:debugging/remote_debugging.adoc#Using-the-Eclipse-debugger[Debugging Surefire Tests w/ Eclipse Remote Debugger]
35+
** link:debugging/tracing_logging_in_eclipse.adoc[Tracing and logging in Eclipse]
36+
*** link:tracing_logging_in_eclipse.adoc#How-to-gather-eclipse-logs-and-system-configuration-details[How to gather Eclipse logs and system configuration details]
37+
*** link:tracing_logging_in_eclipse.adoc#How-to-enable-tracing-in-eclipse[How to enable tracing in Eclipse]
38+
** link:debugging/remote_debugging.adoc[Using the Eclipse remote debugger]
39+
** link:debugging/debug_tycho_tests.adoc[Debugging maven (surefire) tests]
40+
** link:debugging/debug_remote_console.adoc[Debugging on a remote server] (via SSH or VNC)
41+
3542
* Source and Project Management
3643
** link:source/new_project_process.adoc[Adding a new module / repository to JBoss Tools or JBDS]
3744
** link:source/how_to_add_a_plugin_or_feature_to_an_existing_project.adoc[Adding a new plugin or feature to an existing JBoss Tools 4.x module]

debugging/README.adoc

Lines changed: 0 additions & 5 deletions
This file was deleted.

debugging/debug_on_ci.md

Lines changed: 0 additions & 34 deletions
This file was deleted.

debugging/debug_remote_console.adoc

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
= Debugging on a remote server
2+
3+
If a UI-based test running on a remote server stalls, it it often useful to be able to see that server's GUI to determine what caused the test to stall or fail.
4+
5+
JBoss Tools' Jenkins jobs will often capture a screenshot of the last thing the slave's GUI saw before the test was terminated, which will appear in the job's workspace. But if this is insufficient, or if you need to interact with the UI, you need to connect directly.
6+
7+
== SSH access (commandline)
8+
9+
In case you need to access something on a Jenkins slave that you can't access through Jenkins itself, you can request ssh access to the Jenkins slaves. This will give you filesystem access as the same user running your job's builds, but will not give you a GUI, only commandline filesystem access.
10+
11+
Contact the JBoss Tools release engineering team (Nick, Denis, Mickael, Max) to learn how to get access. You will also require Red Hat VPN access as the Jenkins servers are firewalled.
12+
13+
== VNC access (GUI)
14+
15+
JBoss Tools' Jenkins jobs use Xvnc so it's easy to monitor their progress or see why a UI test has stalled, using a vncviewer.
16+
17+
Assuming you have been given access, here's what you need to do:
18+
19+
1. Go to the job's current build page and look at the top of the console log to get the hostname (such as _vmg39.somewhere.redhat.com_) and DISPLAY variable (such as _12_).
20+
21+
2. Run `xvncviewer host:port` where:
22+
23+
* *port* is 5900 + DISPLAY
24+
* host is the fully-qualified server name (or its IP address)
25+
26+
Thus, in this example:
27+
28+
`vncviewer -passwd ~/.vnc/passwd_hudson vmg39.somewhere.redhat.com:5912`
29+
30+
Contact the JBoss Tools release engineering team (Nick, Denis, Mickael, Max) to get the vncserver password for your job. You will also require Red Hat VPN access as the Jenkins servers are firewalled.

debugging/debug_tycho_tests.adoc

Lines changed: 6 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
# Debugging Surefire Tests
1+
= Debugging maven (surefire) tests
22

3-
## Useful debug files in Jenkins workspace
3+
== Useful debug files in workspace
44

5-
Maven _target/_ folder actually contains all the files related to your build and tests. Assuming a test is failing in the *org.jboss.tools.acme.test* suite, here are a set of interesting locations to help debugging:
5+
Maven _target/_ folders actually contains all the files related to your build and tests. Assuming a test is failing in the *org.jboss.tools.acme.test* suite, here are a set of interesting locations to help debugging:
66

77
* _tests/org.jboss.tools.acme.test/target/work/configuration/config.ini_ contains the main configuration of the plugin. The most interesting part is the `osgi.bundles` property which lists all bundles that are installed in the application which runs test. It's the right place to check for a missing dependency
88
* _tests/org.jboss.tools.acme.test/target/work/data_ is the test workspace, where you can access create projects, and
99
* _tests/org.jboss.tools.acme.test/target/work/data/.metadata/.log_ contains the log of the test execution
1010
* _tests/org.jboss.tools.acme.test/target/work/data/.metadata_ contains all other Eclipse runtime metadata (such as workbench state, preferences...)
1111

12-
## Useful input in maven build log
12+
== Useful input in maven build log
1313

1414
Maven's build log shows a very interesting commandline while running surefire tests. It looks like:
1515
```
@@ -22,34 +22,6 @@ This commandline is the actual command used to run your tests. You can copy and
2222

2323
Reading the parameters in the commandline could also explain differences between expected and actual behavior of tests.
2424

25-
## Using the Eclipse debugger
26-
27-
Instead of running a `mvn clean verify` to simply see your Surefire/JUnit tests run in a console, you can also debug them interactively using http://www.eclipse.org/tycho/sitedocs/tycho-surefire/tycho-surefire-plugin/test-mojo.html#debugPort[-DdebugPort=8000], or any port number you'd like:
28-
29-
```
30-
mvn clean verify -DdebugPort=8000
31-
```
32-
33-
Then, from Eclipse, create a Launch Configuration using "Debug Remote Java Application".
34-
35-
To begin, click on `Run -> Debug Configurations...`
36-
37-
image::../images/remote_Debugging_1.PNG[Remote Debugging 1]
38-
39-
Right click `Remote Java Application` and select `New`
40-
41-
image::../images/remote_Debugging_2.PNG[Remote Debugging 2]
42-
43-
Set the port to `8000`, or whatever port you used above, and select the workspace project you want to debug.
44-
45-
The only necessary inputs are the project you want to test, and the port on which the debugger will listen (8000 for this example).
46-
47-
image::../images/remote_Debugging_4.PNG[Remote Debugging 3]
48-
49-
Click `Apply` then `Close`.
50-
51-
Set a breakpoint in your code, then from the `Run` menu, you can launch the debugger to trace through the code to find the source of the problem.
52-
53-
When the maven build completes, the debugPort will be dropped. If you start the build again, you can then reconnect the debugger as needed.
54-
25+
## Remote debugging w/ breakpoints
5526

27+
See: link:remote_debugging.adoc[Using the Eclipse Remote Debugger]

debugging/install_a_local_build.adoc renamed to debugging/how_to_install_a_build.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
= How to install a local build of JBoss Tools components
1+
= How to install a JBoss Tools component build
22

33
If you've already built a component, such as `jbosstools-base` or `jbosstools-server`, you may want to
44
install it into a new clean eclipse to test it out properly. It is highly suggested to do this

debugging/how_to_test_a_build.adoc

Lines changed: 5 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
= How to test a build of JBoss Tools components
1+
= How to test a JBoss Tools component build
22

3-
If you haven't yet gotten your local build installed, please see link:install_a_local_build.adoc[How to Install a Local Build].
3+
If you haven't yet gotten your local build installed, please see link:how_to_install_a_build.adoc[How to Install a Local Build].
44

55
== Everything's Installed, Now what?
66

@@ -12,50 +12,13 @@ There are, however, three options you have to get more information:
1212
* Tracing
1313
* Debugging via a second eclipse instance
1414

15-
=== Logs
15+
=== Logging
1616

17-
When using eclipse the main place to look for logging is in the workspace log file located at `<workspace>/.metadata/.log`.
18-
19-
==== How to gather eclipse log and other in JBoss Tools
20-
21-
If you have JBoss Tools installed the simplest way to gather logs and system configuration is to go to:
22-
23-
Help > Report Problem
24-
25-
This will open up a dialog where you can put in a name and description.
26-
27-
When pressing Finish a .zip file is created that you open or share with others (for example in Jira)
17+
See link:tracing_logging_in_eclipse.adoc#How-to-gather-eclipse-logs-and-system-configuration-details[How to gather Eclipse logs and system configuration details]
2818

2919
=== Tracing
3020

31-
Eclipse comes with a tracing mechanism to allow various messages to be displayed in the console's output based on what tracing flags you pass in. This does require some knowledge of what tracing flags individual plugins expose, and you can usually discover this by browsing through the plugin's source code to see what they expose.
32-
33-
To enable tracing, two things are required:
34-
35-
* A .options file must live in your eclipse base directory
36-
* You must run your eclipse with the -debug flag.
37-
38-
An example of a .options file, for org.jboss.ide.eclipse.as.server.core would look something like:
39-
40-
```
41-
org.jboss.ide.eclipse.as.core/debug=true
42-
org.jboss.ide.eclipse.as.core/config=true
43-
org.jboss.ide.eclipse.as.core/info=true
44-
org.jboss.ide.eclipse.as.core/warning=true
45-
org.jboss.ide.eclipse.as.core/severe=true
46-
org.jboss.ide.eclipse.as.core/finer=true
47-
org.jboss.ide.eclipse.as.core/finest=true
48-
org.jboss.ide.eclipse.as.core/resources=true
49-
org.jboss.ide.eclipse.as.core/extension_point=true
50-
org.jboss.ide.eclipse.as.core/listeners=true
51-
org.jboss.ide.eclipse.as.core/runtime_target=true
52-
org.jboss.ide.eclipse.as.core/performance=true
53-
org.jboss.ide.eclipse.as.core/publishing=true
54-
```
55-
56-
Each plugin can declare its own trace keys specific to their needs. To discover what trace options are available for a given plugin,
57-
you can look for a file named 'Trace.java' or similar. For example, in the `jbosstools-server` repository, you may look at
58-
`jbosstools-server/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/Trace.java`
21+
See link:tracing_logging_in_eclipse.adoc#How-to-enable-tracing-in-eclipse[How to enable tracing in Eclipse]
5922

6023

6124
== Debugging via a second eclipse instance

debugging/index.adoc

Lines changed: 0 additions & 3 deletions
This file was deleted.

debugging/remote_debugging.adoc

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,35 @@
1-
= Remote Debugging
1+
= Using the Eclipse remote debugger
22

3-
If you need to attach an Eclipse instance to a running Maven build, you can do so easily.
3+
Instead of running a `mvn clean verify` to simply see your tests run in a console, you can also debug them interactively using http://www.eclipse.org/tycho/sitedocs/tycho-surefire/tycho-surefire-plugin/test-mojo.html#debugPort[-DdebugPort=8000].
4+
5+
To attach an Eclipse instance to a running Maven build, do this:
46

57
```
68
mvn verify -DdebugPort=8000
79
```
810

911
Then launch Eclipse, browse to the project in your workspace, and create a new Remote Java Application from the Debug Configurations menu. This will allow you to set breakpoints in your Eclipse workspace project and step through them as the maven build runs on the debug port.
1012

11-
For more details, see: link:debug_tycho_tests.adoc[Debugging Surefire Tests].
13+
Create a Launch Configuration using "Debug Remote Java Application".
14+
15+
To begin, click on `Run -> Debug Configurations...`
16+
17+
image::../images/remote_Debugging_1.PNG[Remote Debugging 1]
18+
19+
Right click `Remote Java Application` and select `New`
20+
21+
image::../images/remote_Debugging_2.PNG[Remote Debugging 2]
22+
23+
Set the port to `8000`, or whatever port you used above, and select the workspace project you want to debug.
24+
25+
The only necessary inputs are the project you want to test, and the port on which the debugger will listen (8000 for this example).
26+
27+
image::../images/remote_Debugging_4.PNG[Remote Debugging 3]
28+
29+
Click `Apply` then `Close`.
30+
31+
Set a breakpoint in your code, then from the `Run` menu, you can launch the debugger to trace through the code to find the source of the problem.
32+
33+
When the maven build completes, the debugPort will be dropped. If you start the build again, you can then reconnect the debugger as needed.
34+
35+
See also: link:debug_tycho_tests.adoc[Debugging Maven (Surefire) Unit Tests]

debugging/runtime_workbench.adoc

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1-
= Debugging your code via Runtime Workbench
1+
= Debugging via Eclipse runtime workbench
22

33
It is assumed at this point that you have properly imported the source code for your project, link:../building/target_platforms/target_platforms_for_consumers.adoc[Configured your target platforms] in eclipse, and have a workspace free of errors.
44

55
== Running the plug-in
66

77
To launch a runtime workbench, you can right-click on your project and select `Debug -> Debug As...` This dialog will show you all the different kinds of ways you can launch a program. Choose Eclipse Application, click New and accept all of the default settings. This will cause another instance of the Eclipse workbench, the runtime workbench, to start.
88

9-
The launch configuration will automatically connect to the runtime workbench for the purposes of debugging. You can now go ahead and set breakpoints in your source code, just as you would for any normal Java project you launch from Eclipse. link:http://www.vogella.com/tutorials/EclipseDebugging/article.html[This] tutorial outlines most of the functions of Eclipse JDT for debugging purposes.
9+
The launch configuration will automatically connect to the runtime workbench for the purposes of debugging. You can now go ahead and set breakpoints in your source code, just as you would for any normal Java project you launch from Eclipse.
1010

11-
You may also consider looking at the Plug-in Development Environment's link:http://wiki.eclipse.org/PDE/FAQ[FAQ] for further questions.
11+
See link:http://www.vogella.com/tutorials/EclipseDebugging/article.html[Java Debugging with Eclipse], by Lars Vogel - a tutorial outlining most of the functions of Eclipse JDT debugging.
12+
13+
See also: link:http://wiki.eclipse.org/PDE/FAQ[Plug-in Development Environment (PDE) FAQ].

0 commit comments

Comments
 (0)