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 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301
|
<?xml version="1.0" encoding="utf-8"?>
<appendix id="debugger">
<title>The PHP Debugger</title>
<sect1 id="debugger-using">
<title>디버거 사용기</title>
<para>
PHP의 내부 디버거는 알수없는 다운 버그들에 유용하다.
이 디버거는 PHP가 작동하는 동안 내내 <acronym>TCP</acronym> 포트에 접속해서 작업된다.
요청(Request)는 TCP접속에 보내서 모든 에러 메세지가 나온다.
<acronym>IDE</acronym>나 Progrmmable 에디터 안에서 실행되는 "디버깅 서버(Debugging server"의 강제적인 정보이다(Emacs처럼).
</para>
<para>
디버거 설치하는 방법:
<orderedlist>
<listitem>
<simpara>
디버거를 위한 TCP 포트 설치는 <link linkend="configuration.file">configuration file</link>안에 있다.
(<link linkend="ini.debugger.port">debugger.port</link>)과 가능설정 (<link linkend="ini.debugger.enabled">debugger.enabled</link>)
</simpara>
</listitem>
<listitem>
<simpara>
어딘가의 포트에서 TCP 감시자(lestener) 설치 (예를 들어
<command>socket -l -s 1400</command> on UNIX).
</simpara>
</listitem>
<listitem>
<simpara>
당신의 코드에서 하고,
<acronym>TCP</acronym> 감시자(listener)가 실해되는 동안 <replaceable>host</replaceable>는 IP 숫자와 호스트의 이름을 가진 <replaceable>host</replaceable>에서 "debugger_on(<replaceable>host</replaceable>)"을 실행.
</simpara>
</listitem>
</orderedlist>
모든 경고는 감시자 소켓(listener socket)는 공지된다.
<emphasis>비록 <function>error_reporting</function>에 의해 꺼져있더라도</emphasis>.
</para>
<note>
<para>
디버거를 위한 코드 PHP4에서는 제공되지 않는다. 이것은 PHP3에서만 제공된다.
</para>
</note>
</sect1>
<sect1 id="debugger-protocol">
<title>디버거 프로토콜(Debugger Protocl)</title>
<para>
디버거 프로코톨은 라인 기반이다. 각 라인은 <emphasis>type</emphasis>과 <emphasis>message</emphasis>로 이루어진 몇몇 라인들을 가진다.
각 메세지는 <literal>start</literal>타입의 라인으로 시작되고, <literal>end</literal>타입의 라인으로 의해 중지된다.
PHP는 아마 일제히 다른 메세지들의 라인들을 보낼것이다.
</para>
<para>
각 라인은 다음의 포맷을 가진다:
<informalexample>
<literallayout>
<replaceable>date</replaceable>
<replaceable>time</replaceable>
<replaceable>host</replaceable>(<replaceable>pid</replaceable>)
<replaceable>type</replaceable>:
<replaceable>message-data</replaceable>
</literallayout>
</informalexample>
<variablelist>
<varlistentry>
<term>
<replaceable>date</replaceable>
</term>
<listitem>
<simpara>
ISO 8601 포멧의 날짜
(<replaceable>yyyy</replaceable>-<replaceable>mm</replaceable>-<replaceable>dd</replaceable>)
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<replaceable>time</replaceable>
</term>
<listitem>
<simpara>
마이크로초(100만분의 1초) 타임:
<replaceable>hh</replaceable>:<replaceable>mm</replaceable>:<replaceable>uuuuuu</replaceable>
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<replaceable>host</replaceable>
</term>
<listitem>
<simpara>
스크립트 에러발생된 DNS name 이나 host의 IP.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<replaceable>pid</replaceable>
</term>
<listitem>
<simpara>
PID (process id) on <replaceable>host</replaceable> of the
process with the PHP script that generated this error.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<replaceable>type</replaceable>
</term>
<listitem>
<para>
Type of line. Tells the receiving program about what it
should treat the following data as:
<table>
<title>Debugger Line Types</title>
<tgroup cols="2">
<thead>
<row>
<entry>Name</entry>
<entry>Meaning</entry>
</row>
</thead>
<tbody>
<row>
<entry>
<literal>start</literal>
</entry>
<entry>
Tells the receiving program that a debugger message
starts here. The contents of
<replaceable>data</replaceable> will be the type of error
message, listed below.
</entry>
</row>
<row>
<entry>
<literal>message</literal>
</entry>
<entry>The PHP error message.</entry>
</row>
<row>
<entry>
<literal>location</literal>
</entry>
<entry>
File name and line number where the error occured. The
first <literal>location</literal> line will always
contain the top-level location.
<replaceable>data</replaceable> will contain
<literal>
<replaceable>file</replaceable>:<replaceable>line</replaceable>
</literal>.
There will always be a <literal>location</literal> line
after <literal>message</literal> and after every
<literal>function</literal>.
</entry>
</row>
<row>
<entry>
<literal>frames</literal>
</entry>
<entry>Number of frames
in the following stack dump. If there are four frames,
expect information about four levels of called functions.
If no "frames" line is given, the depth should be assumed
to be 0 (the error occured at top-level).
</entry>
</row>
<row>
<entry>
<literal>function</literal>
</entry>
<entry>
Name of function where the error occured. Will be
repeated once for every level in the function call
stack.
</entry>
</row>
<row>
<entry>
<literal>end</literal>
</entry>
<entry>
Tells the receiving program that a debugger message ends
here.
</entry>
</row>
</tbody>
</tgroup>
</table>
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<replaceable>data</replaceable>
</term>
<listitem>
<simpara>Line data.</simpara>
</listitem>
</varlistentry>
</variablelist>
<table>
<title>Debugger Error Types</title>
<tgroup cols="2">
<thead>
<row>
<entry>Debugger</entry>
<entry>PHP Internal</entry>
</row>
</thead>
<tbody>
<row>
<entry>
<errortype>warning</errortype>
</entry>
<entry>
<errortype>E_WARNING</errortype>
</entry>
</row>
<row>
<entry>
<errortype>error</errortype>
</entry>
<entry>
<errortype>E_ERROR</errortype>
</entry>
</row>
<row>
<entry>
<errortype>parse</errortype>
</entry>
<entry>
<errortype>E_PARSE</errortype>
</entry>
</row>
<row>
<entry>
<errortype>notice</errortype>
</entry>
<entry>
<errortype>E_NOTICE</errortype>
</entry>
</row>
<row>
<entry>
<errortype>core-error</errortype>
</entry>
<entry>
<errortype>E_CORE_ERROR</errortype>
</entry>
</row>
<row>
<entry>
<errortype>core-warning</errortype>
</entry>
<entry>
<errortype>E_CORE_WARNING</errortype>
</entry>
</row>
<row>
<entry>
<errortype>unknown</errortype>
</entry>
<entry>(any other)</entry>
</row>
</tbody>
</tgroup>
</table>
<example>
<title>Example Debugger Message</title>
<literallayout>
1998-04-05 23:27:400966 lucifer.guardian.no(20481) start: notice
1998-04-05 23:27:400966 lucifer.guardian.no(20481) message: Uninitialized variable
1998-04-05 23:27:400966 lucifer.guardian.no(20481) location: (&null;):7
1998-04-05 23:27:400966 lucifer.guardian.no(20481) frames: 1
1998-04-05 23:27:400966 lucifer.guardian.no(20481) function: display
1998-04-05 23:27:400966 lucifer.guardian.no(20481) location: /home/ssb/public_html/test.php3:10
1998-04-05 23:27:400966 lucifer.guardian.no(20481) end: notice
</literallayout>
</example>
</para>
</sect1>
</appendix>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
-->
|