@@ -38,11 +38,10 @@ $ g++ -shared -Wall -g -std=c++11 -O0 \
38
38
To run a single test from CLI one can:
39
39
40
40
```
41
- ./sbt " testOnly org.bblfsh.client.v2.libuast.IteratorNativeTest -- -z \ "Native UAST iterator should return non-empty results on decoded objects\""
41
+ ./sbt ' testOnly org.bblfsh.client.v2.libuast.IteratorNativeTest -- -z "Native UAST iterator should return non-empty results on decoded objects"'
42
42
```
43
43
44
- When using ` lldb ` , this would become a bit more involved as the classpath needs to be
45
- manually setup for ` java ` executable:
44
+ When using ` lldb ` , the classpath needs to be manually set for the ` java ` executable:
46
45
47
46
```
48
47
PATH="/usr/bin:$PATH" lldb -- java -ea -Xcheck:jni -Djava.library.path=src/main/resources -cp "target/classes:target/test-classes:src/main/resources:${HOME}/.ivy2/cache/org.scalatest/scalatest_2.11/bundles/scalatest_2.11-3.0.1.jar:${HOME}/.ivy2/cache/org.scala-lang/scala-library/jars/scala-library-2.11.11.jar:${HOME}/.ivy2/cache/org.scala-lang.modules/scala-xml_2.11/bundles/scala-xml_2.11-1.0.5.jar:${HOME}/.ivy2/cache/org.scalactic/scalactic_2.11/bundles/scalactic_2.11-3.0.1.jar:${HOME}/.ivy2/cache/commons-io/commons-io/jars/commons-io-2.5.jar:build/bblfsh-client-assembly-2.0.0-SNAPSHOT.jar:target/*" \
@@ -55,7 +54,7 @@ Actual test output will be saved in `iterator-native-test.txt`.
55
54
56
55
## When inside the debugger
57
56
58
- This is somhow ` lldb ` specific , but the idea will be the same in GDB .
57
+ These instructions are for ` lldb ` , but the steps should be similar in ` gdb ` .
59
58
To load the debug symbols do:
60
59
61
60
```
@@ -65,10 +64,10 @@ continue
65
64
target symbols add src/main/resources/lib/libscalauast.dylib.dSYM
66
65
```
67
66
68
- If that does not load the symbols, you have to make sure libscalauast library has
67
+ If that does not load the symbols, you have to make sure ` libscalauast ` library has
69
68
already been loaded to the process by ` target modules list ` .
70
- On rare occasions, the library can be loaded but the symbols will still refuse
71
- to load, it most probably mean that the library is from a different fs path.
69
+ If the library loads but symbols are not correctly displayed, it probably means
70
+ the library is at the wrong filesystem path.
72
71
Stop the debugger and do ` rm -rf ./target/classes/lib/libscalauast.dylib* `
73
72
74
73
To actually debug, set a breakpoint like:
@@ -96,7 +95,7 @@ A small curated list of really useful resources on Go&JNI debugging:
96
95
97
96
## JNI details
98
97
99
- Here are some resources to understand the JNI machinery and it's best practices:
98
+ Here are some resources to understand the JNI machinery and its best practices:
100
99
- https://docs.oracle.com/javase/8/docs/technotes/guides/jni/spec/design.html
101
100
- https://docs.oracle.com/javase/8/docs/technotes/guides/jni/spec/functions.html
102
101
- https://developer.android.com/training/articles/perf-jni
0 commit comments