Debugging Rockhopper by GDB.


To debug Rockhopper by GDB, you can use rockhopper-dbg.run script. This script invokes Rockhopper(/usr/sbin/rockhopperd) in debug mode by gdb command.

  1. % sudo su (Ubuntu)

  2. % /etc/init.d/rockhopper stop (Ubuntu)

  3. % cd <install_dir>/rockhopper-<version>/debug_tools

  4. Before debugging Rockhopper by gdb, you should confirm that all Rockhopper's processes are already killed.
    (pgrep -f rockhopper -l)

    When debugging the main process, run it like this:
    % ./rockhopper-dbg.run

    When debugging the protected process, run it like this:
    % ./rockhopper-dbg.run syspxy


If you want to build Rockhopper with no optimization (gcc -O0), please install like this:

   % cd rockhopper-<version> (installed-dir)
   % sudo ./debug_tools/install_dbg_no_optmz.sh

In addition, if you want to enable most debug flags (gcc -DRHP_XXX), please install like this:

   % cd rockhopper-<version> (installed-dir)
   % sudo ./debug_tools/install_dbg_all.sh



When debugging rockhopperd by gdb on Eclipse CDT, specify the argumetns like this:

- Eclipse CDT:
   Run > Debug Configurations...
    Debug Configurations(Dialog) > C/C++ Applications > rockhopperd (Project Name)
     Arguments(tab) > Program arguments

- When debugging the main process, specify like this:
-m /home/rhpmain/config/main.xml -p /home/rhpprotected/config/protected.xml -u rhpmain -s rhpprotected -c -d main_foreground -i /var/run/rockhopper

- When debugging the protected process, specify like this:
-m /home/rhpmain/config/main.xml -p /home/rhpprotected/config/protected.xml -u rhpmain -s rhpprotected -c -d default -i /var/run/rockhopper

Similarly, before debugging Rockhopper by gdb, you should confirm that all Rockhopper's processes are already killed.
Back to Top