Next: , Up: Examples of gnatxref Usage


7.3.5.1 General Usage

For the following examples, we will consider the following units:

    main.ads:
    1: with Bar;
    2: package Main is
    3:     procedure Foo (B : in Integer);
    4:     C : Integer;
    5: private
    6:     D : Integer;
    7: end Main;
    
    main.adb:
    1: package body Main is
    2:     procedure Foo (B : in Integer) is
    3:     begin
    4:        C := B;
    5:        D := B;
    6:        Bar.Print (B);
    7:        Bar.Print (C);
    8:     end Foo;
    9: end Main;
    
    bar.ads:
    1: package Bar is
    2:     procedure Print (B : Integer);
    3: end bar;

The first thing to do is to recompile your application (for instance, in that case just by doing a gnatmake main, so that GNAT generates the cross-referencing information. You can then issue any of the following commands: