aboutsummaryrefslogtreecommitdiffhomepage
path: root/site
diff options
context:
space:
mode:
authorGravatar Thiago Farina <tfarina@chromium.org>2015-06-02 15:52:15 +0000
committerGravatar Kristina Chodorow <kchodorow@google.com>2015-06-03 13:48:24 +0000
commit3234b2be02472e6715945344d6f4077d49e1974b (patch)
tree00b6882e877a488ab13dd1ce9817616daa42b06b /site
parent0191cc837f4282ca6297042f9dd222b560d32698 (diff)
Update the debugging instructions for the C++ client.
This was reported on the bazel-discuss mailing list and was also the only way I could get it to work under gdb. https://groups.google.com/d/msgid/bazel-discuss/df72971c-db75-4e05-97d6-0b98ca054e5c%40googlegroups.com -- Change-Id: I0b37a6bdee48febb35631ead3f76e419b08810bd Reviewed-on: https://bazel-review.googlesource.com/#/c/1430/ MOS_MIGRATED_REVID=95011401
Diffstat (limited to 'site')
-rw-r--r--site/contributing.md21
1 files changed, 12 insertions, 9 deletions
diff --git a/site/contributing.md b/site/contributing.md
index d37c81282e..224f072d25 100644
--- a/site/contributing.md
+++ b/site/contributing.md
@@ -124,12 +124,19 @@ When modifying Bazel, you want to make sure that the following still works:
### Debugging Bazel
-Bazel has support for debugging its Java code:
+Start creating a debug configuration for both C++ and Java in your bazelrc with the following:
+
+build:debug -c dbg
+build:debug --javacopt="-g"
+build:debug --copt="-g"
+build:debug --strip="never"
+
+Then you can rebuild Bazel with `bazel build --config debug //src:bazel` and use your favorite
+debugger to start debugging.
+
+For debugging the C++ client you can just fire it from gdb or lldb as you normally would.
+But if you want to debug the Java code, you must attach to the server with the following:
-* Make sure you compile it with debugging enabled by adding the
- `misc = ["-g"]` attributes to the `toolchain` rule of the
- `tools/jdk/BUILD` file or by using the `--javacopt="-g"` option
- on the Bazel command-line.
* Run Bazel with debugging option `--host_jvm_debug` before the
command (e.g., `bazel --batch --host_jvm_debug build //src:bazel`).
* Attach a debugger to the port 5005. With `jdb` for instance,
@@ -137,10 +144,6 @@ Bazel has support for debugging its Java code:
[remote Java application launch
configuration](http://help.eclipse.org/luna/index.jsp?topic=%2Forg.eclipse.jdt.doc.user%2Ftasks%2Ftask-remotejava_launch_config.htm).
-If you want to debug the C++ client, ensure that you have the `-g`
-option activated for C++ build, rebuild Bazel and use your favorite C++
-debugger.
-
## Bazel's code description
Bazel is organized in several parts: