The Pascal Compiler
39
3
–p
and
–pg
The
–p
and
–pg
options instruct the compiler to produce code that counts the
number of times each routine is called. The profiling is based on a periodic
sample taken by the system, rather than by line counters.
Using the
-p
Option
To generate an execution profile using the
–p
option:
1. Compile with the
–p
option.
2. Run
a.out
, which produces a
mon.out
executable file.
3. Type
prof a.out
. The program prints a profile.
Using the
-pg
Option
To generate an execution profile using the
–pg
option:
1. Compile with the
–pg
option.
2. Run
a.out
, which produces a
gmon.out
executable file, a more
sophisticated profiling tool than
mon.out
.
3. Type
gprof a.out
. The program prints a profile.
–pic
,
-Kpic
and
–PIC
,
-KPIC
The
-pic
and
-PIC
options cause the compiler to generate position-
independent code (PIC). One of these options should be used for objects
which are then put into shared libraries. With PIC, each reference to a global
datum is generated as a dereference of a pointer in the global offset table. Each
function call is generated in
pc
-relative addressing mode through a procedure
linkage table.
The size of the global offset table is limited to 8Kbytes with
-pic
. The
-PIC
option expands the global offset table to handle 32-bit addresses for those rare
cases where there are too many data objects for
-pic
.
For more information on
PIC
, see the section on shared libraries in the Solaris
documentation.
Содержание SunSoft Pascal 4.0
Страница 14: ...xiv Pascal 4 0 User s Guide ...
Страница 16: ...xvi Pascal 4 0 User s Guide ...
Страница 30: ...6 Pascal 4 0 User s Guide 1 ...
Страница 160: ...136 Pascal 4 0 User s Guide 6 ...
Страница 268: ...244 Pascal 4 0 User s Guide 11 ...
Страница 320: ...296 Pascal 4 0 User s Guide B ...
Страница 331: ...Index 307 ...
Страница 333: ......