디버거 프로토콜(Debugger Protocl)

디버거 프로코톨은 라인 기반이다. 각 라인은 typemessage로 이루어진 몇몇 라인들을 가진다. 각 메세지는 start타입의 라인으로 시작되고, end타입의 라인으로 의해 중지된다. PHP는 아마 일제히 다른 메세지들의 라인들을 보낼것이다.

각 라인은 다음의 포맷을 가진다:


date
time
host(pid)
type:
message-data

date

ISO 8601 포멧의 날짜 (yyyy-mm-dd)

time

마이크로초(100만분의 1초) 타임: hh:mm:uuuuuu

host

스크립트 에러발생된 DNS name 이나 host의 IP.

pid

PID (process id) on host of the process with the PHP script that generated this error.

type

Type of line. Tells the receiving program about what it should treat the following data as:

표 C-1. Debugger Line Types

NameMeaning
start Tells the receiving program that a debugger message starts here. The contents of data will be the type of error message, listed below.
message The PHP error message.
location File name and line number where the error occured. The first location line will always contain the top-level location. data will contain file:line . There will always be a location line after message and after every function.
frames 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).
function Name of function where the error occured. Will be repeated once for every level in the function call stack.
end Tells the receiving program that a debugger message ends here.

data

Line data.

표 C-2. Debugger Error Types

DebuggerPHP Internal
warning E_WARNING
error E_ERROR
parse E_PARSE
notice E_NOTICE
core-error E_CORE_ERROR
core-warning E_CORE_WARNING
unknown (any other)

예 C-1. Example Debugger Message


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