The DIGen component of Diagnosys implements a tool named Dgen responsible for generating interface wrappers. Dgen is used in conjunction with Dmake which automates generation and compilation processes when developers frequently change their code.
1. Generation
dgen is a tool that takes as input the name of symbols, then checks whether they are exported and expose some known safety safety holes. The tool relies on the results of kernel analysis by SHAna stored in a database. Once the relevant symbols have been identified, Dgen generates the appropriate wrappers and stores them in a header file.
2. Compilation
To automate the compilation steps of the out-of-tree driver that requires the services of Diagnosis, the use of the dmake script is suggested.
This script, checks that the driver developer has prepared his driver for Diagnosis by including the dlog.h header which will be generated by the dgen tool. First, the script compiles the driver without the wrappers and analyzes the resulting object file to collect the symbols that are used by the driver but are not defined in the driver source code. These symbols are labeled *UND* in the output of objdump. Once dgen has filled the dlog.h header, a second compilation is carried out to produce a driver module that integrates the debugging interface.