HPMC User Guide v 1.00
© 2026 Bassem W. Jamaleddine


2-5

   DDD - Data Display Debugger for the MIC


GNU DDD (Data Display Debugger) is a graphical front end for the command-line debuggers GDB. DDD is a graphical user interface (using the Motif toolkit) for the command-line debugger GDB.

To use ddd, you must edit the file ddd's init file (~/.ddd/init) and add
the following as the first line:
Ddd*rshCommand: ssh -t



The following figure shows the first line of ~/.ddd/init on the HPMC for the root user.
full view

Image File

 Fig. 2.5.1   [The first line in the ddd init file]
HPMC 2026 by Bassem Jamaleddine
The diffusion_base.c is an OpenMP program that we compile to be offloaded to the MIC. For the program to be debugged with GNU GDB, the option -ggdb must be included. In addition the $ORIGIN must be specified for the RPATH.

#  icc -ggdb -openmp -O3 -std=c99 -mmic diffusion_base.c -o diffusion_base_xphi_O3g -Wl,--rpath='$ORIGIN'

When compiling an OpenMP program for the MIC, include the following two
options: -ggdb -Wl,--rpath='$ORIGIN' to make sure it can debugged with ddd.

The following command invokes the ddd debugger on the program diffusion_base_xphi_O3g.

#  ddd --host root@mic0 --no-exec-window --debugger gdb diffusion_base_xphi_O3g



You can also type the following at the command prompt to start debugging

#  xphiddd /MIC_PROG/TESTDDD/diffusion_base_xphi_O3g



The xphiddd is available in your /tools directory, the following listing shows its contents.

 -LIS- Listing. 2.5.1   [xphiddd Program to Launch the ddd Data Display Debugger]
(raw text)
1.     #!/usr/bin/perl
2.     use strict;
3.     print "   $0 must be followed by xphi program name\n" unless @ARGV == 
      1; 
4.     my $prog = shift @ARGV;
5.     print "   Cannot read $prog\n" unless -r $prog;
6.     
7.     system("ddd --host root\@mic0 --no-exec-window --debugger gdb $prog");

HPMC 2026


The following figure shows the ddd front end to the GNU GDB to debug the diffusion_base_xphi_O3g program.
full view

Image File

 Fig. 2.5.2   [ddd Debugger for Xphi Programs]
HPMC 2026 by Bassem Jamaleddine