Ðåôåðàò: Àäìèíèñòðèðîâàíèå ëîêàëüíûõ ñåòåé
apm old_path [new_path] Add (prefix) path map for source files.
dpm [index | *] Delete path map(s) for source files.
lpm List path maps in order of precedence.
D "dir" Add a directory search path for source files.
ld List all directories.
lf [string] List all (or matching) files.
lsl List all shared libraries.
lp [[class]::][string] List all (or matching) procedures.
lo [[class]::][string] List all (or matching) overloaded functions.
lcl [string] List all (or matching) classes.
lct [string] List all (or matching) class templates.
ltf [string] List all (or matching) function expansions.
lft [string] List all (or matching) function templates.
View and modify data:
p expr [\format] Print value of expression using format.
p expr?format Print address of expression using format.
p -[\format] Print value of prev memory location using format.
p +[\format] Print value of next memory location using format.
p class:: Print static members of class.
l [[class]::][proc[:depth]] List all parameters and locals of proc.
t [depth] Trace stack.
T [depth] Trace stack and show local variables.
tst Toggle stub visibility. (PA-RISC only)
lr [string] List all (or matching) registers.
lc [string] List all (or matching) commons. (PA-RISC only)
lg [string] List all (or matching) globals.
ls [string] List all (or matching) special variables.
mm [string] Show memory-map of all (or matching) loaded shared -libraries.
f ["printf-style-format"] Set address printing format.
disp item [\format] Display Cobol data item value using format.(MPE-only)
move val to item Move value "val" to cobol data item "item" (MPE-only)
pq <<same as p>> Print quietly. Evaluate without printing.
ll [string] List all (or matching) labels.
lz List all signals.
z [number] [i][r][s][Q] Toggle flags (ignore, report, stop, Quiet) for signal.
Screen modes:
am Activate more (turn on pagination).
sm Suspend more (turn off pagination).
w number Set size of source window.
td Toggle disassembly mode.
ts Toggle split-screen mode.
fr Display floating point registers.
gr Display general registers.
tf Toggle float register display precision (PA-RISC only).
sr Display special registers. (PA-RISC only)
u Update screen.
U Refresh source & location windows on screen.
+r Scroll floating point registers forward.
-r Scroll floating point registers backward.
Assertions:
a commands Create a new assertion with a command list.
aa (number | *) Activate one or all assertions.
da (number | *) Delete one or all assertions.
la List all assertions.
sa (number | *) Suspend one or all assertions.
ta Toggle overall assertions state.
x [expr] Exit assertion mode, possibly aborting the assertion command list.
Macros:
def name [replacement-text] Define a macro name.
lm [string] List all (or matching) macros.
tm Toggle the macro substitution mechanism.
undef (name | *) Remove the macro definition for name or all.
Record and playback:
tr [@] Toggle the record [record-all] mechanism.
< file Playback from file.
<< file Playback from file with single stepping.
> file Record commands to file.
>> file Append commands to file.
>@ file Record-all debugger commands & output to file.
>>@ file Append all debugger commands & output to file.
">>" is equivalent to ">" for the next four commands.
> Show status of current recording file.
>@ Show status of current record-all file.
>(t | f | c) Turn recording on (t), or off (f), or close the recording file (c).
>@(t | f | c) Turn record-all on (t), or off (f), or close the record-all file (c).
Misc:
ss file Save (breakpoint, macro, assertion) state.
tc Toggle case sensitivity in searches.
<carriage-return> Repeat previous command.
~ Repeat previous command.
! [command-line] Execute shell (with or without commands).
q Quit debugger.
$addr Unary operator, address of object.
$sizeof Unary operator, size of object.
$in Unary boolean operator, execution in procedure.
# [text] A comment.
I Print debugger status.
M [(t | c) [expr [; expr ...]]] Print or set (text or core) maps.
tM Toggle between default and modifiable core maps.
VARIABLES
var Search current procedure and globals.
class::var Search class for variable.
[[class]::]proc:[class::]var Search procedure for variable.
[[class]::]proc:depth:[class::]var Search procedure at depth on stack.
:var or ::var Search for global variable only.
. Shorthand for last thing you looked at.
$var Define or use special variable.
$result Return value of last cmd line procedure call.
$signal Current child process signal number.
$lang Current language for expression evaluation.
$depth Default stack depth for local variables.
$print Display mode for character data.
$line Current source line number.
$malloc Debugger memory allocation (bytes).
$step Instr. count in non-debug before free-run.
$cplusplus C++ feature control flags.
$regname Hardware registers.
$fpa Treat fpa sequence as one instruction.(S300 only)
$fpa_reg Address register for fpa sequences. (S300 only)
LOCATIONS
line source line & code address (if any)
#label "
file[:line] "
[file:]proc[:proc[...]][:line|#label] "
[class]::proc[:line|#label] "
proc#line code address (if any)
[class]::proc#line "
name@shared_lib Address of name in shared library
FORMATS
A format has the form [count]formchar[size]. formchar's are:
a String at address.
(b | B) Byte in decimal (either way).
(c | C) (Wide) character.
(d | D) (Long) decimal.
(e | E) E floating point notation (as double).
(f | F) F floating point notation (as double).
(g | G) G floating point notation (as double).
i Machine instruction (disassembly).
(k | K) Formatted structure display (with base classes).
n "Normal" format, based on type.
(o | O) (Long) octal.
p Print name of procedure containing address.
(r | R) Print template of object (with base classes).
s String from pointer.
S Formatted structure display.
(t | T) Print type of object (with base classes).
(u | U) (Long) unsigned decimal.
(w | W) Wide character string (at address).
(x | X) (Long) hexadecimal.
(z | Z) (Long) binary.
Size can be a number or one of the following:
b 1 byte (char)
s 2 bytes (short)
l 4 bytes (long)
D 8 bytes (double - floating point formats only)
L 16 bytes (long double - floating point only)
6. Ñèñòåìíûå âûçîâû è âçàèìîäåéñòâèå ñ UNIX. ýòîé ãëàâå ðå÷ü ïîéäåò î ïðîöåññàõ. Ñêîìïèëèðîâàííàÿ ïðîãðàììà õðàíèòñÿ íà äèñêå êàê îáû÷íûé íåòåêñòîâûé ôàéë. Êîãäà îíà áóäåò çàãðóæåíà â ïàìÿòü êîìïüþòåðà è íà÷íåò âûïîëíÿòüñÿ - îíà ñòàíåò ïðîöåññîì.
UNIX - ìíîãîçàäà÷íàÿ ñèñòåìà (ìóëüòèïðîãðàììíàÿ). Ýòî îçíà÷àåò, ÷òî îäíîâðåìåííî ìîæåò áûòü çàïóùåíî ìíîãî ïðîöåññîâ. Ïðîöåññîð âûïîëíÿåò èõ â ðåæèìå ðàçäåëåíèÿ âðåìåíè - âûäåëÿÿ ïî î÷åðåäè êâàíò âðåìåíè îäíîìó ïðîöåññó, çàòåì äðóãîìó, òðåòüåìó...  ðåçóëüòàòå ñîçäàåòñÿ âïå÷àòëåíèå ïàðàëëåëüíîãî âûïîëíåíèÿ âñåõ ïðîöåññîâ (íà ìíîãîïðîöåññîðíûõ ìàøèíàõ ïàðàëëåëüíîñòü èñòèííàÿ). Ïðîöåññàì, îæèäàþùèì íåêîòîðîãî ñîáûòèÿ, âðåìÿ ïðîöåññîðà íå âûäåëÿåòñÿ. Áîëåå òîãî, "ñïÿùèé" ïðîöåññ ìîæåò áûòü âðåìåííî îòêà÷àí (ò.å. ñêîïèðîâàí èç ïàìÿòè ìàøèíû) íà äèñê, ÷òîáû îñâîáîäèòü ïàìÿòü äëÿ äðóãèõ ïðîöåññîâ. Êîãäà "ñïÿùèé" ïðîöåññ äîæäåòñÿ ñîáûòèÿ, îí áóäåò "ðàçáóæåí" ñèñòåìîé, ïåðåâåäåí â ðàíã "ãîòîâûõ ê âûïîëíåíèþ" è, åñëè áûë îòêà÷àí áóäåò âîçâðàùåí ñ äèñêà â ïàìÿòü (íî, ìîæåò áûòü, íà äðóãîå ìåñòî â ïàìÿòè!). Ýòà ïðîöåäóðà íîñèò íàçâàíèå "ñâîïïèíã" (swapping).
Ìîæíî çàïóñòèòü íåñêîëüêî ïðîöåññîâ, âûïîëíÿþùèõ ïðîãðàììó èç îäíîãî è òîãî æå ôàéëà; ïðè ýòîì âñå îíè áóäóò (åñëè òîëüêî ñïåöèàëüíî íå áûëî ïðåäóñìîòðåíî èíà÷å) íåçàâèñèìûìè äðóã îò äðóãà. Òàê, ó êàæäîãî ïîëüçîâàòåëÿ, ðàáîòàþùåãî â ñèñòåìå, èìååòñÿ ñâîé ñîáñòâåííûé ïðîöåññ-èíòåðïðåòàòîð êîìàíä (ñâîÿ êîïèÿ), âûïîëíÿþùèé ïðîãðàììó èç ôàéëà /bin/csh (èëè /bin/sh).
Ïðîöåññ ïðåäñòàâëÿåò ñîáîé èçîëèðîâàííûé "ìèð", îáùàþùèéñÿ ñ äðóãèìè "ìèðàìè" âî Âñåëåííîé ïðè ïîìîùè:
a) Àðãóìåíòîâ ôóíêöèè main:
void main(int argc, char *argv[], char *envp[]);
Åñëè ìû íàáåðåì êîìàíäó
$ a.out a1 a2 a3
òî ôóíêöèÿ main ïðîãðàììû èç ôàéëà a.out âûçîâåòñÿ ñ
argc = 4 /* êîëè÷åñòâî àðãóìåíòîâ */
argv[0] = "a.out" argv[1] = "a1"
argv[2] = "a2" argv[3] = "a3"
argv[4] = NULL
Ïî ñîãëàøåíèþ argv[0] ñîäåðæèò èìÿ âûïîëíÿåìîãî ôàéëà èç êîòîðîãî çàãðóæåíà ýòà ïðîãðàììà*.
b) Òàê íàçûâàåìîãî "îêðóæåíèÿ" (èëè "ñðåäû") char *envp[], ïðîäóáëèðîâàííîãî òàêæå â ïðåäîïðåäåëåííîé ïåðåìåííîé
extern char **environ;
Îêðóæåíèå ñîñòîèò èç ñòðîê âèäà
"ÈÌßÏÅÐÅÌÅÍÍÎÉ=çíà÷åíèå"
Ìàññèâ ýòèõ ñòðîê çàâåðøàåòñÿ NULL (êàê è argv). Äëÿ ïîëó÷åíèÿ çíà÷åíèÿ ïåðåìåííîé ñ èìåíåì ÈÌß ñóùåñòâóåò ñòàíäàðòíàÿ ôóíêöèÿ
char *getenv( char *ÈÌß );
Îíà âûäàåò ëèáî çíà÷åíèå, ëèáî NULL åñëè ïåðåìåííîé ñ òàêèì èìåíåì íåò.
c) Îòêðûòûõ ôàéëîâ. Ïî óìîë÷àíèþ (íåÿâíî) âñåãäà îòêðûòû 3 êàíàëà:
ÂÂÎÄ Â Û Â Î Ä
FILE * stdin stdout stderr
Ñòðàíèöû: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31