Table of Contents
For this quick start we will provide an example of gathering exception information for a very basic C++ program shown below.
The source code for this program can be found in Example Project:
<example-project>/src/apps/simple/main.cpp
<example-project>/src/apps/simple/extra.cpp
<example-project>/src/apps/simple/extra.h
// main.cpp #include "extra.h" void Function2() { Function1(); throw FileException(); } void Function3() { FuncPtr fp = &Function1; throw 3.0f; fp(); try { Function2(); } catch(FileException& fe) { throw; } } int main() { try { Function3(); } catch(...) { } return 0; }
// extra.h #ifndef EXAMPLE_EXTRA_H #define EXAMPLE_EXTRA_H class Exception{}; class FileException : public Exception{}; typedef void(*FuncPtr)(); void Function1(); #endif // EXAMPLE_EXTRA_H
// extra.cpp #include "extra.h" void Function1() { throw Exception(); throw FileException(); throw 2; }
Following are a set of stages that break down the sequence in which EDoc++ would generally be used. Each stage and its various options are described in order to teach how best to use EDoc++
Here we will list the commands to perform in order to analyze the above source code. The various commands are then explained in later sections. For the impatient this will give a succicnt example of using EDoc++
EDOC -> EDOC -> $ start_edoc.sh g++ -fedoc-embed -c main.cpp -o main.o g++ -fedoc-embed -c extra.cpp -o extra.o g++ main.o extra.o -o simple edoc --format simple simple Logs going to file: /tmp/edoc_BRTRUR F: Function1() O: Exception O: FileException O: int F: Function2() O: FileException E: Exception - Function1() E: FileException - Function1() E: int - Function1() F: Function3() O: float P: Exception - Function1() P: FileException - Function1() P: int - Function1() E: FileException - Function2() E: FileException - Function2() E: Exception - Function2() E: int - Function2()