ctrace(1)


ctrace -- C Ñ╫ÑφÑ░ÑΘÑαÑ╟Ñ╨Ñ├Ѽ

╖┴╝░

 
   ctrace [options] [file] 

╡í╟╜└Γ╠└

ctrace Ñ│Ñ▐Ñ≤Ñ╔ñ╦ñΦñ├ñ╞íóC Ñ╫ÑφÑ░ÑΘÑαñ╬╝┬╣╘ñ≥╠┐╬ß╩╕ñ╟─╔└╫ñ╟ñ¡ñ▐ñ╣íúñ╜ñ╬╕·▓╠ñ╧íó-x ѬÑ╫Ñ╖ÑτÑ≤ñ≥╗╪─Ωñ╖ñ┐Ñ╖ѺÑδ╝Ω┬│ñ¡ñ╬╝┬╣╘ñ╦╗≈ñ╞ñññ▐ñ╣íúctrace ñ╧ file ñ╬ C Ñ╫ÑφÑ░ÑΘÑαñ≥╞╔ñ▀╣■ñ▀(ñóñδñññ╧íófile ñ≥╗╪─Ωñ╖ñ╩ñ½ñ├ñ┐╛∞╣τñ╧╔╕╜α╞■╬╧ñ½ñΘ)íó╝┬╣╘▓─╟╜ñ╩│╞╠┐╬ß╩╕ñ╬Ñ╞Ñ¡Ñ╣Ñ╚íó╗▓╛╚ñóñδñññ╧╩╤╣╣ñ╡ñ∞ñ╞ñññδñ╣ñ┘ñ╞ñ╬╩╤┐⌠├═ñ≥╜╨╬╧ñ╣ñδñ┐ñßñ╬╠┐╬ß╩╕ñ≥┴▐╞■ñ╖íó╜ñ└╡ñ╡ñ∞ñ┐Ñ╫ÑφÑ░ÑΘÑαñ≥╔╕╜α╜╨╬╧ñ╦╜╨╬╧ñ╖ñ▐ñ╣íúcc(1) Ñ│Ñ▐Ñ≤Ñ╔ñ╟ñ╧Ñ╤ÑñÑ╫ñ≥╗╚═╤ñ╟ñ¡ñ╩ñññ┐ñßíóctrace ñ╬╜╨╬╧ñ≥░∞╗■Ñ╒ÑíÑñÑδñ╦│╩╟╝ñ╖ñ╩ñ▒ñ∞ñ╨ñ╩ñΩñ▐ñ╗ñ≤íúñ╜ñ╬╕σíóñ│ñ╬Ñ╒ÑíÑñÑδñ≥Ñ│Ñ≤Ñ╤ÑñÑδñ╖╝┬╣╘ñ╖ñ▐ñ╣íú

Ñ╫ÑφÑ░ÑΘÑαñ╬│╞╠┐╬ß╩╕ñ¼╝┬╣╘ñ╡ñ∞ñδñ┤ñ╚ñ╦íóñ╜ñ∞ñ¼├╝╦÷ñ╦ÑΩÑ╣Ñ╚ñ╡ñ∞íóñ╜ñ╬╕σñ╦ñ╜ñ╬╠┐╬ß╩╕ñ╟╗▓╛╚ñ▐ñ┐ñ╧╩╤╣╣ñ╡ñ∞ñ┐ñ╣ñ┘ñ╞ñ╬╩╤┐⌠ñ╬╠╛┴░ñ╚├═ñ¼┬│ñ¡íóñ╡ñΘñ╦ñ╜ñ╬╠┐╬ß╩╕ñ½ñΘñ╬╜╨╬╧ñ¼┬│ñ¡ñ▐ñ╣íúÑ╚Ñ∞í╝Ñ╣╜╨╬╧╞Γñ╬Ñδí╝Ñ╫ñ¼╕í╜╨ñ╡ñ∞íóÑδí╝Ñ╫ñ½ñΘ╚┤ñ▒╜╨ñ╣ñ½íóÑδí╝Ñ╫╞Γñ╬╠┐╬ß╩╕ñ╬╩╠ñ╬Ñ╖í╝Ñ▒Ñ≤Ñ╣ñ¼╝┬╣╘ñ╡ñ∞ñδñ▐ñ╟íóÑ╚Ñ∞í╝Ñ╣ñ╧─Σ╗▀ñ╡ñ∞ñ▐ñ╣íúѵí╝Ñ╢ñ¼╠╡╕┬Ñδí╝Ñ╫ñ≥╕í╜╨ñ╟ñ¡ñδñΦñªíóÑδí╝Ñ╫ñ≥ 1000 ▓≤╖½ñΩ╩╓ñ╣ñ┤ñ╚ñ╦ 1 ▓≤╖┘╣≡ÑßÑ├Ñ╗í╝Ñ╕ñ¼╜╨╬╧ñ╡ñ∞ñ▐ñ╣íúÑ╚Ñ∞í╝Ñ╣╜╨╬╧ñ╧╔╕╜α╜╨╬╧ñ╦╣╘ñ∩ñ∞ñδñ┐ñßíóѵí╝Ñ╢ñ╧ñ╜ñ∞ñ≥Ñ╒ÑíÑñÑδñ╦╞■ñ∞ñ╞íóÑ¿Ñ╟ÑúÑ┐ñΣ bfs(1) ñ▐ñ┐ñ╧ tail(1) Ñ│Ñ▐Ñ≤Ñ╔ñ≥═╤ñññ╞╕í║║ñ╟ñ¡ñ▐ñ╣íú

░∞╚╠ñ╦╗╚═╤ñ╡ñ∞ñδѬÑ╫Ñ╖ÑτÑ≤ñ╧▓╝╡¡ñ╬ñ╚ñ¬ñΩñ╟ñ╣íú

-f functions
╗╪─Ωñ╖ñ┐ functions ñ└ñ▒ñ≥Ñ╚Ñ∞í╝Ñ╣ñ╖ñ▐ñ╣íú

-v functions
╗╪─Ωñ╖ñ┐ functions ░╩│░ñ≥ñ╣ñ┘ñ╞Ñ╚Ñ∞í╝Ñ╣ñ╖ñ▐ñ╣íú

╩╤┐⌠ñ≥╜╨╬╧ñ╣ñδñ┐ñßñ╬íó╛╩╬¼╗■ñ╬╜±╝░ñ╦┬╛ñ╬╜±╝░ñ≥─╔▓├ñ╣ñδñ│ñ╚ñΓñ╟ñ¡ñ▐ñ╣íúlong ╖┐ñ¬ñΦñ╙Ñ▌ÑñÑ≤Ñ┐╖┐╩╤┐⌠ñ╧íó╛∩ñ╦╔Σ╣µ╔╒ñ¡└░┐⌠ñ╚ñ╖ñ╞╜╨╬╧ñ╡ñ∞ñ▐ñ╣íú╩╕╗·╟█╬≤ñ╬Ñ▌ÑñÑ≤Ñ┐ñ╧ñ╜ñ∞ñ¼└╡ñ╖ññ└╡╩╕╗·╬≤ñ≥╝¿ñ╣ñΓñ╬ñ╟ñóñ∞ñ╨╩╕╗·╬≤ñ╚ñ╖ñ╞╜╨╬╧ñ╡ñ∞ñ▐ñ╣íúchar ╖┐íóshort ╖┐íóint ╖┐ñ╬╩╤┐⌠ñ╧╔Σ╣µ╔╒ñ¡└░┐⌠ñ╚ñ╖ñ╞╜╨╬╧ñ╡ñ∞íóñ╜ñ∞ñ¼╩╕╗·ñ╚ñ╖ñ╞┼¼└┌ñ╩╛∞╣τñ╧╩╕╗·ñ╟╜╨╬╧ñ╡ñ∞ñ▐ñ╣íúfloat ╖┐íódouble ╖┐íólong double ╖┐╩╤┐⌠ñ╧íó▓╩│╪╔╜╡¡╦íñ╬╔Γ╞░╛»┐⌠┼└┐⌠ñ╚ñ╖ñ╞╜╨╬╧ñ╡ñ∞ñ▐ñ╣íú│║┼÷ñ╣ñδ╛∞╣τíó▓╝╡¡ñ╬ѬÑ╫Ñ╖ÑτÑ≤ñ╟ñ│ñ∞ñΘñ╬╩╤┐⌠ñ≥─╔▓├ñ╖ñ┐╜±╝░ñ╟ñΓ╜╨╬╧ñ╣ñδñΦñª═╫╡ßñ╟ñ¡ñ▐ñ╣íú

-o
8 ┐╩

-x
16 ┐╩

-u
╔Σ╣µñ╩ñ╖

-e
╔Γ╞░╛«┐⌠┼└

▓╝╡¡ñ╬ѬÑ╫Ñ╖ÑτÑ≤ñ╧╞├─Ωñ╬╛⌡╢╖ñ╟ñ╬ñ▀╗╚═╤ñ╡ñ∞ñ▐ñ╣íú

-l n
Ñδí╝Ñ╫ñ╖ñ╞ñññδÑ╚Ñ∞í╝Ñ╣╜╨╬╧ñ╬ñ┐ñßñ╦íó╛╩╬¼├═ñ╬ 20 ñ╦┬σñ∩ñ├ñ╞ n ▓≤╧ó┬│ñ╖ñ╞╝┬╣╘ñ╡ñ∞ñ┐╠┐╬ß╩╕ñ≥╕í║║ñ╖ñ▐ñ╣íú0 ñ≥╗╚═╤ñ╣ñδñ╚íóÑδí╝Ñ╫ñ½ñΘñ╣ñ┘ñ╞ñ╬Ñ╚Ñ∞í╝Ñ╣╜╨╬╧ñ≥╝ΦñΩ╜╨ñ╖ñ▐ñ╣íú

-s
├▒╜πñ╩┬σ╞■╩╕ñΣ╩╕╗·╬≤ñ≥Ñ│Ñ╘í╝ñ╣ñδ┤╪┐⌠╕╞ñ╙╜╨ñ╖ñ½ñΘñ╬═╛╩¼ñ╩Ñ╚Ñ∞í╝Ñ╣╜╨╬╧ñ≥╩▌╬▒ñ╖ñ▐ñ╣íúñ│ñ╬ѬÑ╫Ñ╖ÑτÑ≤ñ≥╗╚═╤ñ╖ñ┐╛∞╣τíó== ▒Θ╗╗╗╥ñ╬╛∞╜Ωñ╦ = ▒Θ╗╗╗╥ñ≥╗╚═╤ñ╣ñδñ│ñ╚ñ╟╡»ñ│ñδÑ╨Ñ░ñ≥╚»╕½ñ╟ñ¡ñ╩ñ»ñ╩ñΩñ▐ñ╣íú

-t n
╛╩╬¼╗■ñ╬ 10 ñ╦┬σñ├ñ╞íó1 ╠┐╬ß╩╕ñóñ┐ñΩ n ╕─ñ╬╩╤┐⌠ñ≥Ñ╚Ñ∞í╝Ñ╣ñ╖ñ▐ñ╣(║╟┬τ├═ñ╧ 20 ñ╟ñ╣)íúñ│ñ╬ѬÑ╫Ñ╖ÑτÑ≤ñ≥ñññ─╗╚═╤ñ╣ñδñ½ñ╧íó▓╝╡¡ñ╬í╓┐╟├╟í╫ñ╬╣αñ╟└Γ╠└ñ╖ñ╞ñññ▐ñ╣íú

-P
Ñ╚Ñ∞í╝Ñ╣ñ╣ñδ┴░ñ╦╞■╬╧ñ≥ñóñΘñ½ñ╕ñß╜Φ═²ñ╖ñ▐ñ╣íúñ▐ñ┐íó-Díó-Iíó-U ñ¬ñΦñ╙ cc(1) ѬÑ╫Ñ╖ÑτÑ≤ñ≥╗╚═╤ñ╣ñδñ│ñ╚ñΓñ╟ñ¡ñ▐ñ╣íú

-p string
Ñ╚Ñ∞í╝Ñ╣╜╨╬╧┤╪┐⌠ñ≥╛╩╬¼╗■ñ╬ printf ñ½ñΘ╩╤╣╣ñ╖ñ▐ñ╣íú╬πñ¿ñ╨íófprintf(stderr ñ╧╔╕╜αÑ¿ÑΘí╝╜╨╬╧ñ╦Ñ╚Ñ∞í╝Ñ╣ñ≥┴≈ñΩñ▐ñ╣íú

-r f
runtime.c Ñ╚Ñ∞í╝Ñ╣┤╪┐⌠Ñ╤Ñ├Ñ▒í╝Ñ╕ñ╬┬σñΩñ╦íóÑ╒ÑíÑñÑδ f ñ≥╗╚═╤ñ╖ñ▐ñ╣íúñ│ñ∞ñ╦ñΦñ├ñ╞íó├▒ñ╦╠╛┴░ñΣ└Φ╣╘░·ñ¡┐⌠(-p ѬÑ╫Ñ╖ÑτÑ≤╗▓╛╚)ñ└ñ▒ñ╟ñ╩ñ»íó╜╨╬╧┤╪┐⌠┴┤┬╬ñ≥╩╤╣╣ñ╟ñ¡ñδñΦñªñ╦ñ╩ñΩñ▐ñ╣íú

-V
╔╕╜αÑ¿ÑΘí╝╜╨╬╧ñ╦Ñ╨í╝Ñ╕ÑτÑ≤╛≡╩≤ñ≥╜╨╬╧ñ╖ñ▐ñ╣íú

-Qarg
arg ñ¼``y''ñ╬╛∞╣τíóctrace ñ╦┤╪ñ╣ñδ╝▒╩╠╛≡╩≤ñ¼╜╨╬╧Ñ╒ÑíÑñÑδñ╦─╔▓├ñ╡ñ∞ñ▐ñ╣íúñ│ñ∞ñ╧Ñ╜Ñ╒Ñ╚ѪѺÑóñ≥┤╔═²ñ╣ñδ╛σñ╟═¡═╤ñ╟ñ╣íúarg ñ╦``n''ñ≥╗╪─Ωñ╖ñ┐╛∞╣τíó╠└╝¿┼¬ñ╦ñ│ñ╬ñΦñªñ╩╛≡╩≤ñ≥╡ßñßñ▐ñ╗ñ≤íúñ│ñ∞ñ╧╛╩╬¼╗■ñ╬╞░║εñ╟ñ╣íú

╗╚═╤╬π

Ñ╒ÑíÑñÑδ lc.c ñ╦▓╝╡¡ñ╬ C Ñ╫ÑφÑ░ÑΘÑαñ¼╝²ñßñΘñ∞ñ╞ñññδ╛∞╣τñ╟ñ╣íú
 
    1 #include <stdio.h> 
    2 main()	/ASTERISK OPERATOR count lines in input ASTERISK OPERATOR/ 
    3 { 
    4 	int c, nl; 
    5 
    6 	nl = 0; 
    7 	while ((c = getchar()) != EOF) 
    8 		if (c = '\n') 
    9 			++nl; 
   10 	printf("%d\n", nl); 
   11 }  

▓╝╡¡ñ╬Ñ│Ñ▐Ñ≤Ñ╔ñ¬ñΦñ╙Ñ╞Ñ╣Ñ╚Ñ╟í╝Ñ┐ñ≥╞■╬╧ñ╖ñ┐ñ╚ñ╖ñ▐ñ╣íú

cc lc.c
a.out
1
<Ctrl>-d

ñ│ñ╬Ñ╫ÑφÑ░ÑΘÑαñ╧Ñ│Ñ≤Ñ╤ÑñÑδñ╡ñ∞íó╝┬╣╘ñ╡ñ∞ñ▐ñ╣íúÑ╫ÑφÑ░ÑΘÑαñ╬╜╨╬╧ñ╧íó┐⌠├═ 2 ñ╦ñ╩ñΩñ▐ñ╣ñ¼íóñ│ñ∞ñ╧Ñ╞Ñ╣Ñ╚Ñ╟í╝Ñ┐ñ╬├µñ╦ñ╧ 1 ╣╘ñ╖ñ½ñ╩ñññ┐ñß└╡ñ╖ññ├═ñ╟ñ╧ñóñΩñ▐ñ╗ñ≤íúñ│ñ╬Ñ╫ÑφÑ░ÑΘÑαñ╟ñ╬Ñ¿ÑΘí╝ñ╧íóñΦñ»╡»ñ│ñΩñ▐ñ╣ñ¼íó╜┼┬τñ╩ñΓñ╬ñ╟ñ╧ñóñΩñ▐ñ╗ñ≤íú▓╝╡¡ñ╬Ñ│Ñ▐Ñ≤Ñ╔ñ≥╗╚ñ├ñ╞ ctrace ñ≥╕╞ñ╙╜╨ñ╖ñ┐ñ╚ñ╖ñ▐ñ╖ñτñªíú

ctrace lc.c >temp.c
cc temp.c
a.out

ñ╜ñ╬╜╨╬╧ñ╧▓╝╡¡ñ╬ñΦñªñ╦ñ╩ñΩñ▐ñ╣íú

 
    2 main() 
    6 	nl = 0; 
       	/ASTERISK OPERATOR nl == 0 ASTERISK OPERATOR/ 
    7 	while ((c = getchar()) != EOF)  

Ñ╫ÑφÑ░ÑΘÑαñ╧íóñ│ñ│ñ╟╞■╬╧┬╘ñ┴ñ╬╛⌡┬╓ñ╚ñ╩ñΩñ▐ñ╣íúñΓñ╖┴░ñ╚╞▒ñ╕Ñ╞Ñ╣Ñ╚Ñ╟í╝Ñ┐ñ≥╞■╬╧ñ╣ñδñ╚íóñ╜ñ╬╜╨╬╧ñ╧▓╝╡¡ñ╬ñΦñªñ╦ñ╩ñΩñ▐ñ╣íú

 
      	/ASTERISK OPERATOR c == 49 or '1' ASTERISK OPERATOR/ 
     8             if (c = '\n') 
                   /* c  == 10 or '\n' */ 
     9                     ++nl; 
                           /* nl == 1 */ 
     7     while ((c = getchar()) != EOF) 
           /* c  == 10 or '\n' */ 
     8             if (c = '\n') 
                   /* c  == 10 or '\n' */ 
     9                     ++nl; 
                           /* nl == 2 */ 
       /* repeating */ 

ñ│ñ│ñ╟íóÑ¿Ñ≤Ñ╔ѬÑ╓Ñ╒ÑíÑñÑδ╩╕╗·(<Ctrl>-d)ñ≥╞■╬╧ñ╣ñδñ╚íó║╟╜¬╜╨╬╧ñ╧▓╝╡¡ñ╬ñΦñªñ╦ñ╩ñΩñ▐ñ╣íú

 
       /* repeated < 1 time */ 
     7     while ((c = getchar()) != EOF) 
           /* c  == -1 */ 
    10     printf("%d\n", nl); 
           /* nl == 2 */2 
   

/* return */

╛≡╩≤ñ¼íó╣╘ 10 ñ╦┬│ñ»╩╤┐⌠ nl ñ╬Ñ╚Ñ∞í╝Ñ╣╣╘ñ╬╜¬ñ∩ñΩñ╦╜╨╬╧ñ╡ñ∞ñδñ│ñ╚ñ╦├φ░╒ñ╖ñ╞ñ»ñ└ñ╡ññíúñ▐ñ┐íóÑ╚Ñ∞í╝Ñ╣╜╨╬╧ñ╬╜¬ñ∩ñΩñ╦ ctrace ñ╦ñΦñ├ñ╞ return ñ╬├φ╝ßñ¼╔╒▓├ñ╡ñ∞ñδñ│ñ╚ñ╦ñΓ├φ░╒ñ╖ñ╞ñ»ñ└ñ╡ññíúñ│ñ∞ñ╧íó┤╪┐⌠ñ╬├µ│τ╕╠ñ╦ñΦñδ░┼╠█ñ╬ÑΩÑ┐í╝Ñ≤ñ≥╝¿ñ╣ñΓñ╬ñ╟ñ╣íú

ñ│ñ╬Ñ╚Ñ∞í╝Ñ╣╜╨╬╧ñ╧íó╩╤┐⌠ c ñ╧╣╘ 7 ñ╟├═ 1 ñ¼┬σ╞■ñ╡ñ∞ñ╞ñññδñ¼íó╣╘ 8 ñ╟ñ╧``\n''ñ╬├═ñ╦ñ╩ñδñ│ñ╚ñ≥╝¿ñ╖ñ╞ñññ▐ñ╣íúѵí╝Ñ╢ñ¼ñ│ñ╬ if ╩╕ñ╦├σ╠▄ñ╣ñδñ╚íó┼∙╣µ▒Θ╗╗╗╥(==)ñ╬┬σñΩñ╦┬σ╞■▒Θ╗╗╗╥(=)ñ≥╗╚ñ├ñ┐ñ│ñ╚ñ╦╡ñ╔╒ñ»ñ╧ñ║ñ╟ñ╣íúÑ│í╝Ñ╔ñ≥╞╔ñ≤ñ╟ñññδñ╚ñ¡ñ╦ñ╧íó┤╩├▒ñ╦ñ│ñ╬Ñ¿ÑΘí╝ñ≥╕½╞¿ñ╖ñ╞ñ╖ñ▐ñª▓─╟╜└¡ñ¼ñóñΩñ▐ñ╣íú

╝┬╣╘╗■ñ╬Ñ╚Ñ∞í╝Ñ╣└⌐╕µ

ctrace ñ╧íó╞├─Ωñ╬┤╪┐⌠ñ≥Ñ╚Ñ∞í╝Ñ╣ñ╣ñδñ┐ñßñ╦ -f ñ▐ñ┐ñ╧ -v ѬÑ╫Ñ╖ÑτÑ≤ñ≥╗╚ñ∩ñ╩ññ╕┬ñΩíó╛╩╬¼╗■ñ╬ѬÑ┌Ñ∞í╝Ñ╖ÑτÑ≤ñ╚ñ╖ñ╞íóÑ╫ÑφÑ░ÑΘÑαÑ╒ÑíÑñÑδ┴┤┬╬ñ≥Ñ╚Ñ∞í╝Ñ╣ñ╖ñ▐ñ╣íú╛╩╬¼╗■ñ╬ѬÑ┌Ñ∞í╝Ñ╖ÑτÑ≤ñ╟ñ╧íóѵí╝Ñ╢ñ¼ 1 ╠┐╬ß╩╕ñ┤ñ╚ñ╦Ñ╚Ñ∞í╝Ñ╣ñ≥└⌐╕µñ╖ñ┐ñΩíóÑ╚Ñ∞í╝Ñ╣ñ╡ñ∞ñ┐Ñ╫ÑφÑ░ÑΘÑαñ╬╝┬╣╘╗■ñ╦Ñ╚Ñ∞í╝Ñ╣ñ≥ѬÑ≤ñ▐ñ┐ñ╧ѬÑ╒ñ╣ñδñ│ñ╚ñ╧ñ╟ñ¡ñ▐ñ╗ñ≤íú

╝┬╣╘╗■ñ╦Ñ╚Ñ∞í╝Ñ╣ñ≥ѬÑ≤ñ▐ñ┐ñ╧ѬÑ╒ñ╦└┌ñΩ┬╪ñ¿ñδñ╦ñ╧íóÑ╫ÑφÑ░ÑΘÑαñ╦┤╪┐⌠╕╞ñ╙╜╨ñ╖ ctroff() ñ╚ ctron() ñ≥ñ╜ñ∞ñ╛ñ∞─╔▓├ñ╖ñ▐ñ╣íúñ│ñ∞ñ╦ñΦñ├ñ╞íóif ╩╕ñ≥╗╚ñ├ñ╞╩ú╗¿ñ╦Ñ╚Ñ∞í╝Ñ╣└⌐╕µñ≥╣╘ñªñΦñªñ╩Ñ╫ÑφÑ░ÑΘÑαñΓ╝½═│ñ╦┴╚ñαñ│ñ╚ñ¼ñ╟ñ¡íó╔¼═╫ñ╦▒■ñ╕ñ╞ñ│ñ╬Ñ│í╝Ñ╔ñ≥┴▐╞■ñ╣ñδñ│ñ╚ñ¼ñ╟ñ¡ñ▐ñ╣íúñ╩ñ╝ñ╩ñΘ ctrace ñ¼Ñ╫ÑΩÑ╫ÑφÑ╗Ñ├Ñ╡╩╤┐⌠ CTRACE ñ≥─Ω╡┴ñ╖ñ╞ñññδñ½ñΘñ╟ñ╣íú╗╚═╤╬πñ╧▓╝╡¡ñ╬ñ╚ñ¬ñΩñ╟ñ╣íú

 
   #ifdef CTRACE 
   	if (c == '!' && i > 1000) 
   		ctron(); 
   #endif 

-g ѬÑ╫Ñ╖ÑτÑ≤ñ≥╗╪─Ωñ╖ñ╞Ñ│Ñ≤Ñ╤ÑñÑδñ╣ñ∞ñ╨íódebug(1) ñ½ñΘñ│ñ∞ñΘñ╬┤╪┐⌠ñ≥╕╞ñ╙╜╨ñ╣ñ│ñ╚ñΓñ╟ñ¡ñ▐ñ╣íú╬πñ¿ñ╨íó┤╪┐⌠ñ╬ 7 ñ½ñΘ 10 ╣╘ñ≥╜ⁿñ»ñ╣ñ┘ñ╞ñ╬╣╘ñ≥Ñ╚Ñ∞í╝Ñ╣ñ╣ñδñ╦ñ╧íó▓╝╡¡ñ╬ñΦñªñ╦╞■╬╧ñ╖ñ▐ñ╣íú

 
   debug a.out 
   debug> stop lc.c @7  {set ctroff();} 
   EVENT [1] assigned 
   debug> stop lc.c @11  {set ctron();} 
   EVENT [2] assigned 
   debug> run 

ñ▐ñ┐íó└┼┼¬╩╤┐⌠ tr_ct_ ñ≥ñ╜ñ∞ñ╛ñ∞ 0 ñ╚ 1 ñ╦└▀─Ωñ╣ñ∞ñ╨íóÑ╚Ñ∞í╝Ñ╣ñ≥ѬÑ╒ñ¬ñΦñ╙ѬÑ≤ñ╦ñ╟ñ¡ñ▐ñ╣íúñ│ñ∞ñ╧íóñ│ñ∞ñΘñ╬┤╪┐⌠ñ≥─╛└▄ñ╦╕╞ñ╙╜╨ñ╗ñ╩ññÑ╟Ñ╨Ñ├Ѽñ≥╗╚═╤ñ╖ñ╞ñññδ╛∞╣τñ╦╠≥╬⌐ñ┴ñ▐ñ╣íú

Ñ╒ÑíÑñÑδ

/usr/ccs/lib/ctrace/runtime.c ╝┬╣╘╗■Ñ╚Ñ∞í╝Ñ╣Ñ╤Ñ├Ñ▒í╝Ñ╕

┤╪╧ó╣α╠▄

cc(1), ctype(3C), debug(1), fclose(3S), fprintf(3S)

┐╟├╟

Ñ╚Ñ∞í╝Ñ╣ñ╡ñ∞ñ┐Ñ│í╝Ñ╔ñ¼ñññ»ñ─ñ½ñ╬ cc ╖┘╣≡ÑßÑ├Ñ╗í╝Ñ╕ñ≥╝⌡ñ▒╝Φñδñ│ñ╚ñΓñΦñ»ñóñδñ┐ñßíóñ│ñ│ñ╟ñ╧íóctrace ñ╚ cc(1) ñ╬╬╛╩²ñ½ñΘñ╬┐╟├╟ÑßÑ├Ñ╗í╝Ñ╕ñ≥└Γ╠└ñ╖ñ▐ñ╣íúñ▐ñ∞ñ╦íócc Ñ¿ÑΘí╝ÑßÑ├Ñ╗í╝Ñ╕ñ≥╝⌡ñ▒╝Φñδñ│ñ╚ñΓñóñΩñ▐ñ╣ñ¼íóñ╜ñ∞ñΘñ╧ñ╣ñ┘ñ╞▓≤╚≥ñ╟ñ¡ñ▐ñ╣íú

ctrace ┐╟├╟

warning: some variables are not traced in this statement
C Ñ│Ñ≤Ñ╤ÑñÑΘñ¼ "out of tree space;simplify expression" ñ╚ñññªÑ¿ÑΘí╝ñ≥╜╨ñ╡ñ╩ñññΦñªñ╦ñ╣ñδñ┐ñßñ╦íó1 ñ─ñ╬╠┐╬ß╩╕ñ╟ñ╧ 10 ╕─ñ╬╩╤┐⌠ñ└ñ▒ñ¼Ñ╚Ñ∞í╝Ñ╣ñ╡ñ∞ñδñΦñªñ╦ñ╩ñ├ñ╞ñññ▐ñ╣íúñ│ñ╬┐⌠ñ≥┴²ñΣñ╣ñ╦ñ╧íó-t ѬÑ╫Ñ╖ÑτÑ≤ñ≥╗╚═╤ñ╖ñ╞ñ»ñ└ñ╡ññíú

warning: statement too long to trace
ñ│ñ╬╠┐╬ß╩╕ñ╧─╣ñ╡ñ¼ 400 ╩╕╗·ñ≥─╢ñ¿ñ▐ñ╣íúÑ╣Ñ┌í╝Ñ╣ñ╟ñ╧ñ╩ñ»Ñ┐Ñ╓ñ≥╗╚ñ├ñ╞íóÑ│í╝Ñ╔ñ╬╗·▓╝ñ▓ñ≥╣╘ñ├ñ╞ñññδñ½│╬╟ºñ╖ñ╞ñ»ñ└ñ╡ññíú

cannot handle preprocessor code, use -P option
ñ│ñ∞ñ╧─╠╛∩íóC ╠┐╬ß╩╕├µñ╬ #ifdef/#endif Ñ╫ÑΩÑ╫ÑφÑ╗Ñ├Ñ╡╠┐╬ß╩╕ñ╦ñΦñ├ñ╞íóñóñδñññ╧ñ▐ñ┐íó#define Ñ╫ÑΩÑ╫ÑφÑ╗Ñ├Ñ╡╠┐╬ß╩╕ñ╬║╟╕σñ╬Ñ╗Ñ▀Ñ│ÑφÑ≤ñ╦ñΦñ├ñ╞░·ñ¡╡»ñ│ñ╡ñ∞ñ▐ñ╣íú

'if . . . else if' sequence too long
┼╙├µñ½ñΘ else ñ≥╝ΦñΩ╜ⁿñññ╞Ñ╖í╝Ñ▒Ñ≤Ñ╣ñ≥╩¼│Σñ╖ñ╞ñ»ñ└ñ╡ññíú

possible syntax error, try -P option
┼¼└┌ñ╩ -Díó-I ñ¬ñΦñ╙ -U Ñ╫ÑΩÑ╫ÑφÑ╗Ñ├Ñ╡ѬÑ╫Ñ╖ÑτÑ≤ñ╚ñ╚ñΓñ╦íó-P ѬÑ╫Ñ╖ÑτÑ≤ñ≥╗╚═╤ñ╖ñ╞íóctrace ╞■╬╧ñ≥ñóñΘñ½ñ╕ñß╜Φ═²ñ╖ñ╞ñ»ñ└ñ╡ññíú

├φ░╒

Ñ╖Ñ╣Ñ╞Ñα┤╪┐⌠ñ╚╞▒ñ╕╠╛┴░ñ≥╗²ñ─┤╪┐⌠ñ≥─Ω╡┴ñ╣ñδñ╚íó░·ñ¡┐⌠ñ╬┐⌠ñ¼╩╤ñ├ñ┐╛∞╣τñ╦╣╜╩╕Ñ¿ÑΘí╝ñ¼╚»└╕ñ╖ñ▐ñ╣íú░πñª╠╛┴░ñ≥╗╚═╤ñ╖ñ╞ñ»ñ└ñ╡ññíú

ctrace ñ╧íóBADMAG ñ¼Ñ╫ÑΩÑ╫ÑφÑ╗Ñ├Ñ╡ñ╬Ñ▐Ñ»Ñφñ╟ñóñδñ│ñ╚íóñ╜ñ╖ñ╞ EOF ñ¬ñΦñ╙ NULL ñ¼ #define ñ╦ñΦñ├ñ╞─Ω╡┴ñ╡ñ∞ñ┐─Ω┐⌠ñ╟ñóñδñ│ñ╚ñ╚┴█─Ωñ╖ñ╞ñññ▐ñ╣íúñ│ñ∞ñΘñ╬ñªñ┴ñ╔ñ∞ñ½ñ≥
"int EOF;" ñ╬ñΦñªñ╦╩╤┐⌠ñ╚ñ╖ñ╞└δ╕└ñ╣ñδñ╚íó╣╜╩╕Ñ¿ÑΘí╝ñ≥░·ñ¡╡»ñ│ñ╖ñ▐ñ╣íú

Ñ▌ÑñÑ≤Ñ┐├═ñ╧╛∩ñ╦íó╩╕╗·╬≤ñ≥╗╪ñ╣Ñ▌ÑñÑ≤Ñ┐ñ╚ñ╖ñ╞░╖ñ∩ñ∞ñ▐ñ╣íú

ctrace ñ╧íó╣╜┬ñ┬╬ñΣ╢ª═╤┬╬ñΣ╟█╬≤ñ╩ñ╔ñ╬╜╕╣τ┬╬ñ╬╣╜└«═╫┴╟ñ╦ñ─ñññ╞ñ╧╛≡╩≤ñ≥═┐ñ¿ñΘñ∞ñ╞ñññ▐ñ╗ñ≤íúñ╜ñ╬ñ┐ñßíóñ│ñ╬ñΦñªñ╩╜╕╣τ┬╬┴┤┬╬ñ╦┬╨ñ╖ñ╞┬σ╞■ñ¼╣╘ñ∩ñ∞ñ┐╛∞╣τíóñ╜ñ∞ñΘñ╬┴┤╣╜└«═╫┴╟ñ≥╜╨╬╧ñ╣ñδ╜±╝░ñ≥┴¬┬≥ñ╣ñδñ│ñ╚ñ╧ñ╟ñ¡ñ▐ñ╗ñ≤íúctrace ñ╧ñ│ñ╬ñΦñªñ╩╜╕╣τ┬╬ñ╬├═ñ≥╜╨╬╧ñ╣ñδñ╚ñ¡ñ╦íóñ╜ñ╬╜╕╣τ┬╬ñ╬ÑóÑ╔Ñ∞Ñ╣ñ≥╜╨╬╧ñ╣ñδñ╬ñ½íóñ╜ñ∞ñ╚ñΓ╕φñ├ñ┐╜±╝░ñ≥╗╚ñª(╬πñ¿ñ╨íó2 ñ─ñ╬└░┐⌠ñ≥ñΓñ─╣╜┬ñ┬╬ñ╦┬╨ñ╖ñ╞ 3.149050e-311 ñ≥╗╚═╤ñ╣ñδ)ñ╬ñññ║ñ∞ñ½ñ≥┴¬┬≥ñ╖ñ▐ñ╣íú

Ñδí╝Ñ╫Ñ╚Ñ∞í╝Ñ╣╜╨╬╧ñ╬╜ⁿ╡εñ╧íó╩ú┐⌠Ñ╒ÑíÑñÑδñ½ñΘñ╩ñδÑ╫ÑφÑ░ÑΘÑαñ╬│╞Ñ╒ÑíÑñÑδñ╜ñ∞ñ╛ñ∞ñ╦┬╨ñ╖ñ╞╞╚╬⌐ñ╦╣╘ñ∩ñ∞ñ▐ñ╣íúñ│ñ╬╖δ▓╠íóÑδí╝Ñ╫ñ½ñΘ╕╞ñ╙╜╨ñ╡ñ∞ñ┐┤╪┐⌠ñ¼Ñ╚Ñ∞í╝Ñ╣ñ╡ñ∞ñ┐ñΩíóñ╜ñ╬Ñ╒ÑíÑñÑδ╞Γñ╬╩╠ñ╬┤╪┐⌠ñ¼╕╞ñ╙╜╨ñ╡ñ∞ñδñ▐ñ╟ñóñδÑ╒ÑíÑñÑδñ╬ 1 ñ─ñ╬┤╪┐⌠ñ╬Ñ╚Ñ∞í╝Ñ╣╜╨╬╧ñ╬╜ⁿ╡εñ¼└╕ñ╕ñ▐ñ╣íú


SCO UnixWare Forum Beta Release (BL12) -- September 1997
© 1997 The Santa Cruz Operation, Inc. All rights reserved.