Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Ensure proper ptrace settings. On Ubuntu edit /etc/sysctl.d/10-ptrace.conf and set kernel.yama.ptrace_scope = 0.
  2. Ensure appropriate .gdbinit in your home directory. It must contain at least the following two lines:

    Code Block
    handle SIGSEGV nostop noprint pass
    handle SIGPIPE nostop noprint pass


  3. In Eclipse go to Run->Debug Configurations->C/C++ Attach To Application. Use "build/debug/service/impalad" as the application and your BE project.
  4. At the bottom of this menu, click on "Select other..." to switch the "Attach to Process Launcher".
    1. The default GDB DSF launcher does not workwith Impala.
    2. Enable "Use Configuration Specific Settings" and select the Standard Attach To Process Launcher. Click OK.
  5. On the "Debug" panel of the debug configuration, select the gdb/mi debugger.
    1. As "GDB Command Set" use Standard (Linux)
    2. As "Protocol" use mi/2

      Note

      If GDB of impala toolchain cause errors,  you main try use system GDB. At "GDB debugger" use /usr/bin/gdb


  6. When you click "Debug" a menu will pop up listing the processes you can attach to. Search for "impalad" and select the one you want to debug.

You may want to enable pretty printing in gdb as described here Eclipse Setup for Impala Development.

Note: the above is for Eclipse Juno. The described 

Python Tests

To develop and debug Python in Eclipse I recommend the PyDev plugin. Follow these steps to setup Eclipse for developing/debugging most Impala Python components:

...

  • In Eclipse go to Run->Debug Configurations. Select "Python unittest".
  • Select "tests" as the project and query_test/test_explain.py as the "Main Module".
  • In the arguments tab, enable "Override PyUnit preference for this launch?". Select the the Py.test runner.
  • Remove the default "–verbosity 0" argument (if present).
  • Add an environment variable “LD_LIBRARY_PATH” (via the tab of ENVIRONMENT, then add a new environment variable by clicking on the New button) and then put the following value: “$IMPALA_HOME/toolchain/cdh_components-1009254/kudu-1.10.0-cdh6.x-SNAPSHOT/debug/lib”.
  • Debug!

Combined FE/BE Debugging

...