From 370ea01149b20b686f7e4f664e1f6633875a5c97 Mon Sep 17 00:00:00 2001 From: David Pilato Date: Fri, 13 Jan 2017 14:42:27 +0100 Subject: [PATCH 1/3] gradle run --debug-jvm is explained twice We are already explaining how to debug remotely in `Debugging from an IDE` section. We can remove one. --- TESTING.asciidoc | 6 ------ 1 file changed, 6 deletions(-) diff --git a/TESTING.asciidoc b/TESTING.asciidoc index aa5431ed69b..13f8ca3ca71 100644 --- a/TESTING.asciidoc +++ b/TESTING.asciidoc @@ -25,12 +25,6 @@ run it using Gradle: gradle run ------------------------------------- -or to attach a remote debugger, run it as: - -------------------------------------- -gradle run --debug-jvm -------------------------------------- - === Test case filtering. - `tests.class` is a class-filtering shell-like glob pattern, From 812f6e30f577ae1fae8b4d6a356653b8eac110aa Mon Sep 17 00:00:00 2001 From: David Pilato Date: Fri, 13 Jan 2017 14:57:40 +0100 Subject: [PATCH 2/3] Add documentation on remote debugging For a node which is launched outside the context of Gradle. --- TESTING.asciidoc | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/TESTING.asciidoc b/TESTING.asciidoc index 13f8ca3ca71..83fe27a963e 100644 --- a/TESTING.asciidoc +++ b/TESTING.asciidoc @@ -474,7 +474,7 @@ Combined (Unit+Integration) coverage: mvn -Dtests.coverage verify jacoco:report --------------------------------------------------------------------------- -== Debugging from an IDE +== Launching and debugging from an IDE If you want to run elasticsearch from your IDE, the `gradle run` task supports a remote debugging option: @@ -483,6 +483,23 @@ supports a remote debugging option: gradle run --debug-jvm --------------------------------------------------------------------------- +== Debugging remotely from an IDE + +If you want to run elasticsearch and be able to remotely attach the process +for debugging purposes from your IDE, you need to add the following line in +`config/jvm.options`: + +--------------------------------------------------------------------------- +-Xdebug -Xrunjdwp:server=y,transport=dt_socket,address=4000,suspend=n +--------------------------------------------------------------------------- + +Then start elasticsearch with `bin/elasticsearch` as usual. + +If you are using IntelliJ, create a new Run/Debug configuration, choose `Remote` +and define the same port you defined in `config/jvm.options`. Then start the +remote debug session from IntelliJ. + + == Building with extra plugins Additional plugins may be built alongside elasticsearch, where their dependency on elasticsearch will be substituted with the local elasticsearch From 4019cbb2222d7026b88540ee63917e4d968a42a9 Mon Sep 17 00:00:00 2001 From: David Pilato Date: Mon, 16 Jan 2017 10:26:12 +0100 Subject: [PATCH 3/3] Update doc after review --- TESTING.asciidoc | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/TESTING.asciidoc b/TESTING.asciidoc index 83fe27a963e..a1a01a8f231 100644 --- a/TESTING.asciidoc +++ b/TESTING.asciidoc @@ -485,20 +485,14 @@ gradle run --debug-jvm == Debugging remotely from an IDE -If you want to run elasticsearch and be able to remotely attach the process -for debugging purposes from your IDE, you need to add the following line in -`config/jvm.options`: +If you want to run Elasticsearch and be able to remotely attach the process +for debugging purposes from your IDE, can start Elasticsearch using `ES_JAVA_OPTS`: --------------------------------------------------------------------------- --Xdebug -Xrunjdwp:server=y,transport=dt_socket,address=4000,suspend=n +ES_JAVA_OPTS="-Xdebug -Xrunjdwp:server=y,transport=dt_socket,address=4000,suspend=y" ./bin/elasticsearch --------------------------------------------------------------------------- -Then start elasticsearch with `bin/elasticsearch` as usual. - -If you are using IntelliJ, create a new Run/Debug configuration, choose `Remote` -and define the same port you defined in `config/jvm.options`. Then start the -remote debug session from IntelliJ. - +Read your IDE documentation for how to attach a debugger to a JVM process. == Building with extra plugins Additional plugins may be built alongside elasticsearch, where their