<commit_before>This document describes how to debug the ImageJ launcher.

# Build the launcher

1.  Build using the debug profile, which passes `-g` to the compiler.

1.  Copy the executable from:
    ```
    target/nar/imagej-launcher-<version>-<AOL>-executable/bin/<AOL>/imagej-launcher
    ```
    Where:
    * `<version>` is the current version in the POM; and
    * `<AOL>` is your NAR Architecture-OS-Linker identifier.
    And rename it to `debug`.

The following shell script will do the job:
```shell
#!/bin/sh
mvn -Pdebug clean package &&
cp target/nar/*/bin/*/imagej-launcher debug
```

# Run the launcher using a debugger

You can debug the launcher using `gdb` (on Linux) or `lldb` (on OS X).

Here is a sample shell script for OS X:
```shell
#!/bin/sh
lldb -a x86_64 -f ./debug -- --ij-dir=/Applications/Fiji.app
```

You can also add on any other flags you wish to use; e.g.:
```shell
#!/bin/sh
JAVA_DIR="/Library/Java/JavaVirtualMachines/jdk1.7.0_21.jdk/Contents/Home"
lldb -a x86_64 -f ./debug -- --ij-dir=/Applications/Fiji.app --java-home "$JAVA_DIR"
```

See also this [GDB and LLDB cheat sheet](http://lldb.llvm.org/lldb-gdb.html).
<commit_msg>DEBUG.md: fix numbering<commit_after>This document describes how to debug the ImageJ launcher.

# Build the launcher

1.  Build using the debug profile, which passes `-g` to the compiler.

2.  Copy the executable from:
    ```
    target/nar/imagej-launcher-<version>-<AOL>-executable/bin/<AOL>/imagej-launcher
    ```
    Where:
    * `<version>` is the current version in the POM; and
    * `<AOL>` is your NAR Architecture-OS-Linker identifier.
    And rename it to `debug`.

The following shell script will do the job:
```shell
#!/bin/sh
mvn -Pdebug clean package &&
cp target/nar/*/bin/*/imagej-launcher debug
```

# Run the launcher using a debugger

You can debug the launcher using `gdb` (on Linux) or `lldb` (on OS X).

Here is a sample shell script for OS X:
```shell
#!/bin/sh
lldb -a x86_64 -f ./debug -- --ij-dir=/Applications/Fiji.app
```

You can also add on any other flags you wish to use; e.g.:
```shell
#!/bin/sh
JAVA_DIR="/Library/Java/JavaVirtualMachines/jdk1.7.0_21.jdk/Contents/Home"
lldb -a x86_64 -f ./debug -- --ij-dir=/Applications/Fiji.app --java-home "$JAVA_DIR"
```

See also this [GDB and LLDB cheat sheet](http://lldb.llvm.org/lldb-gdb.html).

{'fraction_non_alphanumeric': 0.14358974358974358, 'fraction_numerical': 0.01282051282051282, 'mean_word_length': 3.3513011152416357, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6751035', 'n_tokens_mistral': 899, 'n_tokens_neox': 834, 'n_words': 276}