PageRenderTime 70ms CodeModel.GetById 13ms RepoModel.GetById 1ms app.codeStats 0ms

/html/docs-dbgp.php

https://github.com/WouterJ/xdebug.org
PHP | 2872 lines | 2867 code | 5 blank | 0 comment | 124 complexity | ce24263add14c081cf51441a69d630ea MD5 | raw file
  1. <?php $title = "Xdebug: Documentation - Protocol - DBGp"; include "include/header.php"; hits ('xdebug-docs-protocol'); ?>
  2. <tr>
  3. <td>&nbsp;</td>
  4. <td>
  5. <!-- MAIN FEATURE START -->
  6. <span class="sans">XDEBUG EXTENSION FOR PHP | DOCUMENTATION - PROTOCOL - DBGP</span><br />
  7. <?php include "include/menu-docs.php"; ?>
  8. <h1 class="title">DBGP - A common debugger protocol for languages and debugger UI communication</h1>
  9. <table class="docinfo" frame="void" rules="none">
  10. <col class="docinfo-name" />
  11. <col class="docinfo-content" />
  12. <tbody valign="top">
  13. <tr><th class="docinfo-name">Version:</th>
  14. <td>1.0</td></tr>
  15. <tr><th class="docinfo-name">Status:</th>
  16. <td>draft 17</td></tr>
  17. <tr><th class="docinfo-name">Authors:</th>
  18. <td>Shane Caraveo, ActiveState &lt;<a class="reference external" href="mailto:shanec&#64;ActiveState.com">shanec&#64;ActiveState.com</a>&gt;
  19. <br />Derick Rethans &lt;<a class="reference external" href="mailto:derick&#64;derickrethans.nl">derick&#64;derickrethans.nl</a>&gt;</td></tr>
  20. </tbody>
  21. </table>
  22. <div class="contents topic" id="contents">
  23. <p class="topic-title first">Contents</p>
  24. <ul class="simple">
  25. <li><a class="reference internal" href="#description" id="id11">1. Description</a></li>
  26. <li><a class="reference internal" href="#issues" id="id12">1.1 Issues</a></li>
  27. <li><a class="reference internal" href="#requirements" id="id13">2. Requirements</a></li>
  28. <li><a class="reference internal" href="#terminology" id="id14">3. Terminology</a></li>
  29. <li><a class="reference internal" href="#security" id="id15">4. Security</a></li>
  30. <li><a class="reference internal" href="#initiating-a-debugging-session" id="id16">5. Initiating a debugging session</a><ul>
  31. <li><a class="reference internal" href="#standard-dbgp-port" id="id17">5.1 Standard DBGP port</a></li>
  32. <li><a class="reference internal" href="#connection-initialization" id="id18">5.2 Connection Initialization</a></li>
  33. <li><a class="reference internal" href="#just-in-time-debugging-and-debugger-proxies" id="id19">5.3 Just in time debugging and debugger proxies</a><ul>
  34. <li><a class="reference internal" href="#init-packet-handling" id="id20">5.3.1 Init Packet Handling</a></li>
  35. <li><a class="reference internal" href="#proxy-errors" id="id21">5.3.2 Proxy Errors</a></li>
  36. <li><a class="reference internal" href="#proxy-ports" id="id22">5.3.3 Proxy Ports</a></li>
  37. </ul>
  38. </li>
  39. <li><a class="reference internal" href="#multiple-processes-or-threads" id="id23">5.4 Multiple Processes or Threads</a></li>
  40. <li><a class="reference internal" href="#feature-negotiation" id="id24">5.5 Feature Negotiation</a><ul>
  41. <li><a class="reference internal" href="#data-packet-negotiation" id="id25">Data packet negotiation</a></li>
  42. <li><a class="reference internal" href="#asynchronous-communications" id="id26">Asynchronous Communications</a></li>
  43. </ul>
  44. </li>
  45. </ul>
  46. </li>
  47. <li><a class="reference internal" href="#message-packets" id="id27">6. Message Packets</a><ul>
  48. <li><a class="reference internal" href="#why-not-xml-both-ways" id="id28">6.1 Why not XML both ways?</a></li>
  49. <li><a class="reference internal" href="#packet-communications" id="id29">6.2 Packet Communications</a></li>
  50. <li><a class="reference internal" href="#ide-to-debugger-engine-communications" id="id30">6.3 IDE to debugger engine communications</a></li>
  51. <li><a class="reference internal" href="#debugger-engine-to-ide-communications" id="id31">6.4 debugger engine to IDE communications</a></li>
  52. <li><a class="reference internal" href="#debugger-engine-errors" id="id32">6.5 debugger engine errors</a></li>
  53. <li><a class="reference internal" href="#error-codes" id="id33">6.5.1 Error Codes</a></li>
  54. <li><a class="reference internal" href="#file-paths" id="id34">6.6 file paths</a></li>
  55. <li><a class="reference internal" href="#dynamic-code-and-virtual-files" id="id35">6.7 Dynamic code and virtual files</a></li>
  56. </ul>
  57. </li>
  58. <li><a class="reference internal" href="#core-commands" id="id36">7. Core Commands</a><ul>
  59. <li><a class="reference internal" href="#status" id="id37">7.1 status</a></li>
  60. <li><a class="reference internal" href="#options-and-configuration" id="id38">7.2 Options and Configuration</a><ul>
  61. <li><a class="reference internal" href="#feature-names" id="id39">7.2.1 Feature Names</a></li>
  62. <li><a class="reference internal" href="#feature-get" id="id40">7.2.2 feature_get</a></li>
  63. <li><a class="reference internal" href="#feature-set" id="id41">7.2.3 feature_set</a></li>
  64. </ul>
  65. </li>
  66. <li><a class="reference internal" href="#continuation-commands" id="id42">7.5 continuation commands</a></li>
  67. <li><a class="reference internal" href="#breakpoints" id="id43">7.6 breakpoints</a><ul>
  68. <li><a class="reference internal" href="#id1" id="id44">7.6.1 breakpoint_set</a></li>
  69. <li><a class="reference internal" href="#id2" id="id45">7.6.2 breakpoint_get</a></li>
  70. <li><a class="reference internal" href="#id3" id="id46">7.6.3 breakpoint_update</a></li>
  71. <li><a class="reference internal" href="#id4" id="id47">7.6.4 breakpoint_remove</a></li>
  72. <li><a class="reference internal" href="#id5" id="id48">7.6.5 breakpoint_list</a></li>
  73. </ul>
  74. </li>
  75. <li><a class="reference internal" href="#stack-depth" id="id49">7.7 stack_depth</a></li>
  76. <li><a class="reference internal" href="#stack-get" id="id50">7.8 stack_get</a></li>
  77. <li><a class="reference internal" href="#context-names" id="id51">7.9 context_names</a></li>
  78. <li><a class="reference internal" href="#context-get" id="id52">7.10 context_get</a></li>
  79. <li><a class="reference internal" href="#properties-variables-and-values" id="id53">7.11 Properties, variables and values</a></li>
  80. <li><a class="reference internal" href="#data-types" id="id54">7.12 Data Types</a><ul>
  81. <li><a class="reference internal" href="#common-data-types" id="id55">7.12.1 Common Data Types</a></li>
  82. <li><a class="reference internal" href="#typemap-get" id="id56">7.12.2 typemap_get</a></li>
  83. </ul>
  84. </li>
  85. <li><a class="reference internal" href="#property-get-property-set-property-value" id="id57">7.13 property_get, property_set, property_value</a></li>
  86. <li><a class="reference internal" href="#source" id="id58">7.14 source</a></li>
  87. <li><a class="reference internal" href="#stdout-stderr" id="id59">7.15 stdout, stderr</a></li>
  88. </ul>
  89. </li>
  90. <li><a class="reference internal" href="#extended-commands" id="id60">8. Extended Commands</a><ul>
  91. <li><a class="reference internal" href="#stdin" id="id61">8.1 stdin</a></li>
  92. <li><a class="reference internal" href="#break" id="id62">8.2 break</a></li>
  93. <li><a class="reference internal" href="#eval" id="id63">8.3 eval</a><ul>
  94. <li><a class="reference internal" href="#expr" id="id64">8.3.1 expr</a></li>
  95. <li><a class="reference internal" href="#exec" id="id65">8.3.2 exec</a></li>
  96. </ul>
  97. </li>
  98. <li><a class="reference internal" href="#spawnpoints" id="id66">8.4 spawnpoints</a><ul>
  99. <li><a class="reference internal" href="#id6" id="id67">8.4.1 spawnpoint_set</a></li>
  100. <li><a class="reference internal" href="#id7" id="id68">8.4.2 spawnpoint_get</a></li>
  101. <li><a class="reference internal" href="#id8" id="id69">8.4.3 spawnpoint_update</a></li>
  102. <li><a class="reference internal" href="#id9" id="id70">8.4.4 spawnpoint_remove</a></li>
  103. <li><a class="reference internal" href="#id10" id="id71">8.4.5 spawnpoint_list</a></li>
  104. </ul>
  105. </li>
  106. <li><a class="reference internal" href="#notifications" id="id72">8.5 Notifications</a><ul>
  107. <li><a class="reference internal" href="#standard-notifications" id="id73">8.5.1 Standard Notifications</a></li>
  108. </ul>
  109. </li>
  110. <li><a class="reference internal" href="#interact-interactive-shell" id="id74">8.6 interact - Interactive Shell</a></li>
  111. </ul>
  112. </li>
  113. <li><a class="reference internal" href="#a-changelog" id="id75">A. ChangeLog</a></li>
  114. </ul>
  115. </div>
  116. <div class="section" id="description">
  117. <h1><a class="toc-backref" href="#id11">1. Description</a></h1>
  118. <p>This document describes a simple protocol for use with language tools
  119. and engines for the purpose of debugging applications. It does not
  120. describe user interfaces or interactions with the debugger. The
  121. protocol provides a means of communication between a debugger
  122. engine (scripting engine, vm, etc.) and a debugger IDE (IDE, etc.).
  123. Any references to the debugger IDE UI are recommendations only, and are
  124. provided for additional explanation or as reasoning for specific
  125. design decisions.</p>
  126. </div>
  127. <div class="section" id="issues">
  128. <h1><a class="toc-backref" href="#id12">1.1 Issues</a></h1>
  129. <p>1. The handling of proxy errors needs to be clarified. Without both
  130. IDE and debugger engine supporting commands to be received at
  131. arbitrary times, the proxy may have problems sending error or status
  132. information to either one. See section 5.3.2. We should think a bit
  133. more about what a proxy might need to do.</p>
  134. </div>
  135. <div class="section" id="requirements">
  136. <h1><a class="toc-backref" href="#id13">2. Requirements</a></h1>
  137. <ul class="simple">
  138. <li>extensibility, allow for vendor or language specific features</li>
  139. <li>backwards and forwards compatibility</li>
  140. <li>firewall and tunneling support</li>
  141. <li>support for multiple languages</li>
  142. <li>support for multiple processes or threads</li>
  143. <li>support for dynamic and possibly for compiled languages</li>
  144. </ul>
  145. </div>
  146. <div class="section" id="terminology">
  147. <h1><a class="toc-backref" href="#id14">3. Terminology</a></h1>
  148. <dl class="docutils">
  149. <dt>IDE</dt>
  150. <dd>An IDE, or other debugger UI IDE or tool.</dd>
  151. <dt>debugger engine</dt>
  152. <dd>The language engine being debugged.</dd>
  153. <dt>proxy</dt>
  154. <dd>An intermediary demon that acts as a proxy, and may also
  155. implement support for other features such as just in time
  156. debugging, ip security, etc.</dd>
  157. <dt>session</dt>
  158. <dd>a single thread in an application. multiple threads in an
  159. application will attach separately.</dd>
  160. <dt>TRUE</dt>
  161. <dd>a value defined as TRUE should be a numeric one.</dd>
  162. <dt>FALSE</dt>
  163. <dd>a value defined as FALSE should be a numeric zero.</dd>
  164. <dt>NUM</dt>
  165. <dd>a base 10 numeric value that is stringified.</dd>
  166. </dl>
  167. </div>
  168. <div class="section" id="security">
  169. <h1><a class="toc-backref" href="#id15">4. Security</a></h1>
  170. <p>It is expected that implementations will provide security, such as ip
  171. filtering, ssh tunneling, etc. This protocol itself does not provide
  172. a means of securing the debugging session.</p>
  173. </div>
  174. <div class="section" id="initiating-a-debugging-session">
  175. <h1><a class="toc-backref" href="#id16">5. Initiating a debugging session</a></h1>
  176. <p>The debugger engine initiates a debugging session. The debugger engine
  177. will make a connection to a listening IDE, then wait for the IDE to
  178. initiate commands. The debugger engine does not step into the first line of
  179. execution until the IDE issues one of the continuation commands.
  180. The first thing that should happen in a debug session is that the IDE
  181. negotiates features using the feature_get and feature_set commands, and sets
  182. any additional data, such as breakpoints. Debugger engine implementations
  183. should store and data it receives if it is unable to process them prior to
  184. compiling and/or executing code. Commands such as stack_get should not be
  185. expected to work during this phase, otherwise known as the 'starting' state (see
  186. section 7.1 for status levels).</p>
  187. <p>Likewise, at the end of a debug session, there is a 'stopping' state. This state
  188. is entered after all execution is complete. For most debugger engine implementations,
  189. only a 'stop' command can be accepted at this point, however some implementations
  190. may provide additional commands for retrieving various data from the engine for
  191. post debug session processing.</p>
  192. <div class="section" id="standard-dbgp-port">
  193. <h2><a class="toc-backref" href="#id17">5.1 Standard DBGP port</a></h2>
  194. <p>The IDE listens on port 9000 for debugger connections, unless the
  195. IDE is using a proxy, in which case it may listen on any port. In
  196. that case, the IDE will tell the proxy which port it is listening on, and the
  197. proxy should listen on port 9000. While this document defines port 9000
  198. as the standard DBGP port, an implementation may support the use of any
  199. port. Current implementations accept various forms of configuration that
  200. allow this port to be defined.</p>
  201. </div>
  202. <div class="section" id="connection-initialization">
  203. <h2><a class="toc-backref" href="#id18">5.2 Connection Initialization</a></h2>
  204. <p>When a debugger engine connects to either a IDE or proxy, it must send an
  205. init packet:</p>
  206. <pre class="literal-block">
  207. &lt;init appid=&quot;APPID&quot;
  208. idekey=&quot;IDE_KEY&quot;
  209. session=&quot;DBGP_COOKIE&quot;
  210. thread=&quot;THREAD_ID&quot;
  211. parent=&quot;PARENT_APPID&quot;
  212. language=&quot;LANGUAGE_NAME&quot;
  213. protocol_version=&quot;1.0&quot;
  214. fileuri=&quot;file://path/to/file&quot;&gt;
  215. </pre>
  216. <p>Attributes in the init element can include:</p>
  217. <blockquote>
  218. <table border="1" class="docutils">
  219. <colgroup>
  220. <col width="22%" />
  221. <col width="78%" />
  222. </colgroup>
  223. <thead valign="bottom">
  224. <tr><th class="head">Attribute</th>
  225. <th class="head">Description</th>
  226. </tr>
  227. </thead>
  228. <tbody valign="top">
  229. <tr><td>appid</td>
  230. <td>defined by the debugger engine</td>
  231. </tr>
  232. <tr><td>idekey</td>
  233. <td>defined by the user. The DBGP_IDEKEY environment
  234. variable SHOULD be used if it is available,
  235. otherwise setting this value is debugger engine
  236. implementation specific. This value may be empty.</td>
  237. </tr>
  238. <tr><td>session</td>
  239. <td>If the environment variable DBGP_COOKIE exists,
  240. then the init packet MUST contain a session
  241. attribute with the value of the variable. This
  242. allows an IDE to execute a debugger engine, and
  243. maintain some state information between the
  244. execution and the protocol connection. This value
  245. should not be expected to be set in 'remote'
  246. debugging situations where the IDE is not in
  247. control of the process.</td>
  248. </tr>
  249. <tr><td>thread</td>
  250. <td>the systems thread id</td>
  251. </tr>
  252. <tr><td>parent</td>
  253. <td>the appid of the application that spawned the
  254. process. When an application is executed, it
  255. should set it's APPID into the environment.
  256. If an APPID already exists, it should first
  257. read that value and use it as the PARENT_APPID.</td>
  258. </tr>
  259. <tr><td>language</td>
  260. <td>debugger engine specific, must not contain
  261. additional information, such as version, etc.</td>
  262. </tr>
  263. <tr><td>protocol_version</td>
  264. <td>The highest version of this protocol supported</td>
  265. </tr>
  266. <tr><td>fileuri</td>
  267. <td>URI of the script file being debugged</td>
  268. </tr>
  269. </tbody>
  270. </table>
  271. </blockquote>
  272. <p>The IDE responds by dropping socket connection, or starting with
  273. debugger commands.</p>
  274. <p>The init packet may have child elements for additional vendor specific
  275. data. These are entirely optional and must not effect behavior
  276. of the debugger interaction. Suggested child elements include:</p>
  277. <pre class="literal-block">
  278. &lt;engine version=&quot;1.abcd&quot;&gt;product title&lt;/engine&gt;
  279. &lt;author&gt;author&lt;/author&gt;
  280. &lt;company&gt;company&lt;/company&gt;
  281. &lt;license&gt;licensing info&lt;/license&gt;
  282. &lt;url&gt;url&lt;/url&gt;
  283. &lt;copyright&gt;xxx&lt;/copyright&gt;
  284. </pre>
  285. </div>
  286. <div class="section" id="just-in-time-debugging-and-debugger-proxies">
  287. <h2><a class="toc-backref" href="#id19">5.3 Just in time debugging and debugger proxies</a></h2>
  288. <p>Proxies are supported to allow multiuser systems work with a defined
  289. port for debugging. Each IDE would listen on a unique port and notify the
  290. proxy what port it is listening on, along with a key value that is used by
  291. the debugger engine to specify which IDE it should be connected with.</p>
  292. <p>With the exception of the init packet, all communications
  293. will be passed through without modifications. A proxy could also implement
  294. support for just in time debugging. In this case, a debugger engine would
  295. break (perhaps on an error or exception) and connect to the proxy. The proxy
  296. would then start the IDE (if it is not already running) and initiate a
  297. debugging session with it.</p>
  298. <p>The method for handling just in time debugging is not defined by the protocol
  299. and is implementation specific. One example of how this may work is that the
  300. proxy has a configuration file that defines key's for each user, along with
  301. the path to the executable that will provide the UI for that user. The debugger
  302. engine would have to know this key value in advance and provide it to the proxy
  303. in the init packet (see IDE_KEY in section 5.2). The proxy would know if the
  304. IDE is running, since the IDE should have communicated with the proxy already,
  305. if it has not, the proxy could execute the IDE directly.</p>
  306. <p>To support proxies and jit deamons, the IDE should be configured with
  307. and ip:port pointing to the proxy/jit. The IDE then makes a
  308. connection to the proxy when it starts and sends the following command:</p>
  309. <blockquote>
  310. <p>IDE command</p>
  311. <pre class="literal-block">
  312. proxyinit -a ip:port -k ide_key -m [0|1]
  313. </pre>
  314. <table border="1" class="docutils">
  315. <colgroup>
  316. <col width="3%" />
  317. <col width="97%" />
  318. </colgroup>
  319. <tbody valign="top">
  320. <tr><td>-p</td>
  321. <td>the port that the IDE listens for debugging on. The address
  322. is retrieved from the connection information.</td>
  323. </tr>
  324. <tr><td>-k</td>
  325. <td>a IDE key, which the debugger engine will also use in it's
  326. debugging init command. this allows the proxy to match
  327. request to IDE. Typically the user will provide the
  328. session key as a configuration item.</td>
  329. </tr>
  330. <tr><td>-m</td>
  331. <td>this tells the demon that the IDE supports (or doesn't)
  332. multiple debugger sessions. if -m is missing, zero or no
  333. support is default.</td>
  334. </tr>
  335. </tbody>
  336. </table>
  337. <p>IDE command</p>
  338. <pre class="literal-block">
  339. proxystop -k ide_key
  340. </pre>
  341. <p>The IDE sends a proxystop command when it wants the proxy
  342. server to stop listening for it.</p>
  343. </blockquote>
  344. <p>The proxy should respond with a simple XML statement alerting the
  345. IDE to an error, or the success of the initialization (see section
  346. 6.5 for more details on the error element).</p>
  347. <pre class="literal-block">
  348. &lt;proxyinit success=&quot;[0|1]&quot;
  349. idekey=&quot;{ID}&quot;
  350. address=&quot;{IP_ADDRESS}&quot;
  351. port=&quot;{NUM}&gt;
  352. &lt;error id=&quot;app_specific_error_code&quot;&gt;
  353. &lt;message&gt;UI Usable Message&lt;/message&gt;
  354. &lt;/error&gt;
  355. &lt;/proxyinit&gt;
  356. </pre>
  357. <p>Once the IDE has sent this command, and received a confirmation, it
  358. disconnects from the proxy. The IDE will only connect to the proxy
  359. when it initially wants to start accepting connections from the proxy,
  360. or when it wants to stop accepting connections from the proxy.</p>
  361. <p>The address and port attributes of the returned proxyinit element are the
  362. address and port that the proxy is configured to listen for DBGP connections on.
  363. This information is returned to the IDE so that it may pass this information on
  364. to build systems or the user via some UI.</p>
  365. <div class="section" id="init-packet-handling">
  366. <h3><a class="toc-backref" href="#id20">5.3.1 Init Packet Handling</a></h3>
  367. <p>If a proxy receives the init packet (see section 5.2), it will use the
  368. idekey attribute to pass the request to the correct IDE, or to do some
  369. other operation such as which may be required to implement security or
  370. initiate just in time debugging. The proxy will add the idekey as a attribute
  371. to the init packet when it passes it through to the IDE. The proxy may
  372. also add child elements with further information, and must add an
  373. attribute to the init element called 'proxied' with the attribute
  374. value being the ip address of the debugger engine. This is the only
  375. time the proxy should modify data being passed to the IDE.</p>
  376. </div>
  377. <div class="section" id="proxy-errors">
  378. <h3><a class="toc-backref" href="#id21">5.3.2 Proxy Errors</a></h3>
  379. <p>If the proxy must send error data to the IDE, it may send an XML
  380. message with the root element named 'proxyerror'. This message will
  381. be in the format of the error packets defined in 6.3 below.</p>
  382. <p>If the proxy must send error data to the debugger engine, it may
  383. send the proxyerror command defined in section 7 below.</p>
  384. </div>
  385. <div class="section" id="proxy-ports">
  386. <h3><a class="toc-backref" href="#id22">5.3.3 Proxy Ports</a></h3>
  387. <p>The proxy listens for IDE connections on port 9001, and for debugger
  388. engine connections on port 9000. As with section 5.1, these ports may
  389. be configurable in the implementation.</p>
  390. </div>
  391. </div>
  392. <div class="section" id="multiple-processes-or-threads">
  393. <h2><a class="toc-backref" href="#id23">5.4 Multiple Processes or Threads</a></h2>
  394. <p>The debugger protocol is designed to use a separate socket connection
  395. for each process or thread. The IDE may or may not support
  396. multiple debugger sessions. If it does not, the debugger engine must
  397. not attempt to start debug sessions for threads, and the IDE should
  398. not accept more than one socket connection for debugging. The
  399. IDE should tell the debugger engine whether it supports multiple
  400. debugger sessions, the debugger engine should assume that the IDE does
  401. not. The IDE can use the feature_set command with the feature name of
  402. 'multiple_sessions' to notify the debugger engine that it supports multiple
  403. session debugging. The IDE may also query the the debugger engine specifically
  404. for multithreaded debugging support by using the feature_get command with
  405. a feature name of 'language_supports_threads'.</p>
  406. </div>
  407. <div class="section" id="feature-negotiation">
  408. <h2><a class="toc-backref" href="#id24">5.5 Feature Negotiation</a></h2>
  409. <p>Although the IDE may at any time during the debugging session send
  410. feature_get or feature_set commands, the IDE should be designed to
  411. negotiate the base set of features up front. Differing languages and
  412. debugger engines may operate in many ways, and the IDE should be
  413. prepared to handle these differences. Likewise, the IDE may dictate
  414. certain features or capabilities be supported by the debugger engine.
  415. In any case, the IDE should strive to work with all debugger engines
  416. that support this protocol. Therefore, this section describes a
  417. minimal set of features the debugger engine must support. These
  418. required features are outlined here in the form of discussion,
  419. actual implementation of feature arguments are detailed in section 7
  420. under the feature_get and feature_set commands.</p>
  421. <div class="section" id="data-packet-negotiation">
  422. <h3><a class="toc-backref" href="#id25">Data packet negotiation</a></h3>
  423. <p>IDE's may want to limit the size of data that is retrieved from
  424. debugger engines. While the debugger engines will define their own
  425. base default values, the IDE should negotiate these terms if it
  426. needs to. The debugger engine must support these requests from the
  427. IDE. This includes limits to the data size of a property or
  428. variable, and the depth limit to arrays, hashes, objects, or other
  429. tree like structures. The data size excludes any the protocol
  430. overhead.</p>
  431. </div>
  432. <div class="section" id="asynchronous-communications">
  433. <h3><a class="toc-backref" href="#id26">Asynchronous Communications</a></h3>
  434. <p>While the protocol does not depend on asynchronous socket support,
  435. certain design considerations may require that the IDE and/or debugger
  436. engine treat incoming and outgoing data in an asynchronous fashion.</p>
  437. <p>For ease of design, some implementations may choose to utilize this
  438. protocol in a completely synchronous fashion, and not implement
  439. optional commands that require the debugger engine to behave in an
  440. asynchronous fashion. One example of this is the break command.</p>
  441. <p>The break command is sent from the IDE while the debugger engine is
  442. in a run state. To support this, the debugger engine must periodically
  443. peek at the socket to see if there are any incoming commands. For
  444. this reason the break command is optional. If a command requires
  445. this type of asynchronous behavior on the part of the debugger
  446. engine it must be optional for the debugger engine to support it.</p>
  447. <p>On the other hand, IDE's MUST at times behave in an asynchronous
  448. fashion. When an IDE tells the debugger engine to enter a 'run' state,
  449. it must watch the socket for incoming packets for stdout or stderr,
  450. if it has requested the data be sent to it from the debugger engine.</p>
  451. <p>The form of asynchronous communications that may occur in this
  452. protocol are defined further in section 6.2 below.</p>
  453. </div>
  454. </div>
  455. </div>
  456. <div class="section" id="message-packets">
  457. <h1><a class="toc-backref" href="#id27">6. Message Packets</a></h1>
  458. <p>The IDE sends simple ASCII commands to the debugger engine. The
  459. debugger engine responds with XML data. The XML data is prepended
  460. with a stringified integer representing the number of bytes in the XML data
  461. packet. The length and XML data are separated by a NULL byte. The
  462. XML data is ended with a NULL byte. Neither the IDE or debugger engine
  463. packets may contain NULL bytes within the packet since it is used as
  464. a separator. Data must be encoded using base64.</p>
  465. <pre class="literal-block">
  466. IDE: command [SPACE] [args] -- data [NULL]
  467. DEBUGGER: [NUMBER] [NULL] XML(data) [NULL]
  468. </pre>
  469. <p>Arguments to the IDE commands are in the same format as common command
  470. line arguments, and should be parseable by common code such as getopt,
  471. or Pythons Cmd module:</p>
  472. <pre class="literal-block">
  473. command -a value -b value ...
  474. </pre>
  475. <p>If a value for an option includes a space, the value needs to be
  476. encoded. You can encode values by encasing them in double quotes:</p>
  477. <pre class="literal-block">
  478. property_get -i 5 -n &quot;$x['a b']&quot; -d 0 -c 0 -p 0
  479. </pre>
  480. <p>It is also possible to use escape characters in quoted strings:</p>
  481. <pre class="literal-block">
  482. property_get -i 6 -n &quot;$x[\&quot;a b\&quot;]&quot; -d 0 -c 0 -p 0
  483. </pre>
  484. <p>All numbers in the protocol are base 10 string representations, unless
  485. the number is noted to be debugger engine specific (eg. the address
  486. attribute on property elements).</p>
  487. <div class="section" id="why-not-xml-both-ways">
  488. <h2><a class="toc-backref" href="#id28">6.1 Why not XML both ways?</a></h2>
  489. <p>The primary reason is to avoid the requirement that a debugger
  490. engine has an XML parser available. XML is easy to generate, but
  491. requires additional libraries for parsing.</p>
  492. </div>
  493. <div class="section" id="packet-communications">
  494. <h2><a class="toc-backref" href="#id29">6.2 Packet Communications</a></h2>
  495. <p>The IDE sends a command, then waits for a response from the
  496. debugger engine. If the command is not received in a reasonable
  497. time (implementation dependent) it may assume the debugger engine
  498. has entered a non-responsive state. The exception to this is when
  499. the IDE sends a 'continuation' command which may not have an immediate response.</p>
  500. <p>'continuation' commands include, but may not be limited to: run, step_into,
  501. step_over, step_out and eval. When the debugger engine
  502. receives such a command, it is considered to have entered a
  503. 'run state'.</p>
  504. <p>During a 'continuation' command, the IDE should expect to possibly receive
  505. stdin and/or stderr packets from the debugger engine prior to
  506. receiving a response to the command itself. It may also possibly
  507. receive error packets from either the debugger engine, or a proxy
  508. if one is in use, either prior to the 'continuation' response, or in response
  509. to any other command.</p>
  510. <p>Stdout and stderr, if requested by the IDE, may only be sent during
  511. commands that have put the debugger engine into a 'run' state.</p>
  512. <p>If the debugger engine supports asynchronous commands, the IDE may also
  513. send commands while the debugger engine is in a 'run' state. These
  514. commands should be limited to commands such as the 'break' or 'status'
  515. commands for performance reasons, but this protocol does not impose
  516. such limitations. The debugger engine MUST respond to these commands
  517. prior to responding to the original 'run' command.</p>
  518. <p>An example of communication between IDE and debugger engines. (this
  519. is not an example of the actual protocol.)</p>
  520. <pre class="literal-block">
  521. IDE: feature_get supports_async
  522. DBG: yes
  523. IDE: stdin redirect
  524. DBG: ok
  525. IDE: stderr redirect
  526. DBG: ok
  527. IDE: run
  528. DBG: stdin data...
  529. DBG: stdin data...
  530. DBG: reached breakpoint, done running
  531. IDE: give me some variables
  532. DBG: ok, here they are
  533. IDE: evaluate this expression
  534. DBG: stderr data...
  535. DBG: ok, done
  536. IDE: run
  537. IDE: break
  538. DBG: ok, breaking
  539. DBG: at breakpoint, done running
  540. IDE: stop
  541. DBG: good bye
  542. </pre>
  543. </div>
  544. <div class="section" id="ide-to-debugger-engine-communications">
  545. <h2><a class="toc-backref" href="#id30">6.3 IDE to debugger engine communications</a></h2>
  546. <p>A debugging IDE (IDE) sends commands to the debugger engine in
  547. the form of command line arguments. One argument that is included in
  548. all commands is the data length. The data itself is the last part of
  549. the command line, after the -- separator. The data must be base64 encoded.</p>
  550. <pre class="literal-block">
  551. command [SPACE] [arguments] [SPACE] -- base64(data) [NULL]
  552. </pre>
  553. <p>Standard arguments for all commands</p>
  554. <pre class="literal-block">
  555. -i Transaction ID
  556. unique numerical ID for each command generated by the IDE
  557. </pre>
  558. </div>
  559. <div class="section" id="debugger-engine-to-ide-communications">
  560. <h2><a class="toc-backref" href="#id31">6.4 debugger engine to IDE communications</a></h2>
  561. <p>The debugger engine always replies or sends XML data. The standard
  562. namespace for the root elements returned from the debugger
  563. engine MUST be &quot;<a class="reference external" href="urn:debugger_protocol_v1">urn:debugger_protocol_v1</a>&quot;. Namespaces have been left
  564. out in the examples in this document. The messages sent by the
  565. debugger engine must always be NULL terminated. The XML document tag
  566. must always be present to provide XML version and encoding information.</p>
  567. <p>Two base tags are used for the root tags:</p>
  568. <pre class="literal-block">
  569. data_length
  570. [NULL]
  571. &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
  572. &lt;response command=&quot;command_name&quot;
  573. transaction_id=&quot;transaction_id&quot;/&gt;
  574. [NULL]
  575. data_length
  576. [NULL]
  577. &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
  578. &lt;stream type=&quot;stdout|stderr&quot;&gt;...Base64 Data...&lt;/stream&gt;
  579. [NULL]
  580. </pre>
  581. <p>For simplification, data length and NULL bytes will be left out of the
  582. rest of the examples in this document.</p>
  583. </div>
  584. <div class="section" id="debugger-engine-errors">
  585. <h2><a class="toc-backref" href="#id32">6.5 debugger engine errors</a></h2>
  586. <p>A debugger engine may need to relay error information back to the IDE in
  587. response to any command. The debugger engine may add an error element
  588. as a child of the response element. Note that this is not the same
  589. as getting language error messages, such as exception data. This is
  590. specifically a debugger engine error in response to a IDE
  591. command. IDEs and debugger engines may elect to support additional
  592. child elements in the error element, but should namespace the elements
  593. to avoid conflicts with other implementations.</p>
  594. <pre class="literal-block">
  595. &lt;response command=&quot;command_name&quot;
  596. transaction_id=&quot;transaction_id&quot;&gt;
  597. &lt;error code=&quot;error_code&quot; apperr=&quot;app_specific_error_code&quot;&gt;
  598. &lt;message&gt;UI Usable Message&lt;/message&gt;
  599. &lt;/error&gt;
  600. &lt;/response&gt;
  601. </pre>
  602. </div>
  603. <div class="section" id="error-codes">
  604. <h2><a class="toc-backref" href="#id33">6.5.1 Error Codes</a></h2>
  605. <p>The following are predefined error codes for the response to commands:</p>
  606. <p>000 Command parsing errors</p>
  607. <pre class="literal-block">
  608. 0 - no error
  609. 1 - parse error in command
  610. 2 - duplicate arguments in command
  611. 3 - invalid options (ie, missing a required option, invalid value for a
  612. passed option)
  613. 4 - Unimplemented command
  614. 5 - Command not available (Is used for async commands. For instance
  615. if the engine is in state &quot;run&quot; then only &quot;break&quot; and &quot;status&quot;
  616. are available).
  617. </pre>
  618. <p>100 File related errors</p>
  619. <pre class="literal-block">
  620. 100 - can not open file (as a reply to a &quot;source&quot; command if the
  621. requested source file can't be opened)
  622. 101 - stream redirect failed
  623. </pre>
  624. <p>200 Breakpoint, or code flow errors</p>
  625. <pre class="literal-block">
  626. 200 - breakpoint could not be set (for some reason the breakpoint
  627. could not be set due to problems registering it)
  628. 201 - breakpoint type not supported (for example I don't support
  629. 'watch' yet and thus return this error)
  630. 202 - invalid breakpoint (the IDE tried to set a breakpoint on a
  631. line that does not exist in the file (ie &quot;line 0&quot; or lines
  632. past the end of the file)
  633. 203 - no code on breakpoint line (the IDE tried to set a breakpoint
  634. on a line which does not have any executable code. The
  635. debugger engine is NOT required to return this type if it
  636. is impossible to determine if there is code on a given
  637. location. (For example, in the PHP debugger backend this
  638. will only be returned in some special cases where the current
  639. scope falls into the scope of the breakpoint to be set)).
  640. 204 - Invalid breakpoint state (using an unsupported breakpoint state
  641. was attempted)
  642. 205 - No such breakpoint (used in breakpoint_get etc. to show that
  643. there is no breakpoint with the given ID)
  644. 206 - Error evaluating code (use from eval() (or perhaps
  645. property_get for a full name get))
  646. 207 - Invalid expression (the expression used for a non-eval()
  647. was invalid)
  648. </pre>
  649. <p>300 Data errors</p>
  650. <pre class="literal-block">
  651. 300 - Can not get property (when the requested property to get did
  652. not exist, this is NOT used for an existing but uninitialized
  653. property, which just gets the type &quot;uninitialised&quot; (See:
  654. PreferredTypeNames)).
  655. 301 - Stack depth invalid (the -d stack depth parameter did not
  656. exist (ie, there were less stack elements than the number
  657. requested) or the parameter was &lt; 0)
  658. 302 - Context invalid (an non existing context was requested)
  659. </pre>
  660. <p>900 Protocol errors</p>
  661. <pre class="literal-block">
  662. 900 - Encoding not supported
  663. 998 - An internal exception in the debugger occurred
  664. 999 - Unknown error
  665. </pre>
  666. </div>
  667. <div class="section" id="file-paths">
  668. <h2><a class="toc-backref" href="#id34">6.6 file paths</a></h2>
  669. <p>All file paths passed between the IDE and debugger engine must be in
  670. the URI format specified by IETF RFC 1738 and 2396, and must be
  671. absolute paths.</p>
  672. </div>
  673. <div class="section" id="dynamic-code-and-virtual-files">
  674. <h2><a class="toc-backref" href="#id35">6.7 Dynamic code and virtual files</a></h2>
  675. <p>The protocol reserves the URI scheme 'dbgp' for all virtual
  676. files generated and maintained by language engines. Such
  677. virtual files are usually managed by a language engine for
  678. dynamic code blocks, i.e. code created at runtime, without
  679. an association with a regular file. Any IDE seeing an URI
  680. with the 'dbgp' scheme has to use the 'source' command (See
  681. section 7.14) to obtain the contents of the file from the
  682. engine responsible for that URI.</p>
  683. <p>All URIs in that scheme have the form:</p>
  684. <blockquote>
  685. dbgp:engine-specific-identifier</blockquote>
  686. <p>The engine-specific-identifier is some string which the debugger engine
  687. uses to keep track of the specific virtual file. The IDE must return
  688. the URI to the debugger engine unchanged through the source command to
  689. retrieve the virtual file.</p>
  690. </div>
  691. </div>
  692. <div class="section" id="core-commands">
  693. <h1><a class="toc-backref" href="#id36">7. Core Commands</a></h1>
  694. <p>Both IDE and debugger engine must support all core commands.</p>
  695. <div class="section" id="status">
  696. <h2><a class="toc-backref" href="#id37">7.1 status</a></h2>
  697. <p>The status command is a simple way for the IDE to find out from
  698. the debugger engine whether execution may be continued or not.
  699. no body is required on request. If async support has been
  700. negotiated using feature_get/set the status command may be sent
  701. while the debugger engine is in a 'run state'.</p>
  702. <p>The status attribute values of the response may be:</p>
  703. <blockquote>
  704. <dl class="docutils">
  705. <dt>starting:</dt>
  706. <dd>State prior to execution of any code</dd>
  707. <dt>stopping:</dt>
  708. <dd>State after completion of code execution. This typically
  709. happens at the end of code execution, allowing the IDE to
  710. further interact with the debugger engine (for example, to
  711. collect performance data, or use other extended commands).</dd>
  712. <dt>stopped:</dt>
  713. <dd>IDE is detached from process, no further interaction is
  714. possible.</dd>
  715. <dt>running:</dt>
  716. <dd>code is currently executing. Note that this
  717. state would only be seen with async support
  718. turned on, otherwise the typical state during
  719. IDE/debugger interaction would be 'break'</dd>
  720. <dt>break:</dt>
  721. <dd>code execution is paused, for whatever reason
  722. (see below), and the IDE/debugger can pass
  723. information back and forth.</dd>
  724. </dl>
  725. </blockquote>
  726. <p>The reason attribute value may be:</p>
  727. <blockquote>
  728. <ul class="simple">
  729. <li>ok</li>
  730. <li>error</li>
  731. <li>aborted</li>
  732. <li>exception</li>
  733. </ul>
  734. </blockquote>
  735. <p>IDE</p>
  736. <pre class="literal-block">
  737. status -i transaction_id
  738. </pre>
  739. <p>debugger engine</p>
  740. <pre class="literal-block">
  741. &lt;response command=&quot;status&quot;
  742. status=&quot;starting&quot;
  743. reason=&quot;ok&quot;
  744. transaction_id=&quot;transaction_id&quot;&gt;
  745. message data
  746. &lt;/response&gt;
  747. </pre>
  748. </div>
  749. <div class="section" id="options-and-configuration">
  750. <h2><a class="toc-backref" href="#id38">7.2 Options and Configuration</a></h2>
  751. <p>The feature commands are used to request feature support from the debugger
  752. engine. This includes configuration options, some of which may be changed via
  753. feature_set, the ability to discover support for implemented commands, and to
  754. discover values for various features, such as the language version or name.</p>
  755. <p>An example of usage would be to send a feature request with the string 'stdin'
  756. to find out if the engine supports redirection of the stdin stream through the
  757. debugger socket. The debugger engine must consider all commands as keys for this
  758. command, but may also have keys that are for features that do not map directly
  759. to commands.</p>
  760. <div class="section" id="feature-names">
  761. <h3><a class="toc-backref" href="#id39">7.2.1 Feature Names</a></h3>
  762. <p>The following features strings MUST be available:</p>
  763. <blockquote>
  764. <table border="1" class="docutils">
  765. <colgroup>
  766. <col width="34%" />
  767. <col width="9%" />
  768. <col width="57%" />
  769. </colgroup>
  770. <tbody valign="top">
  771. <tr><td>language_supports_threads</td>
  772. <td>get</td>
  773. <td>[0|1]</td>
  774. </tr>
  775. <tr><td>language_name</td>
  776. <td>get</td>
  777. <td>{eg. PHP, Python, Perl}</td>
  778. </tr>
  779. <tr><td>language_version</td>
  780. <td>get</td>
  781. <td>{version string}</td>
  782. </tr>
  783. <tr><td>encoding</td>
  784. <td>get</td>
  785. <td>current encoding in use by the debugger
  786. session. The encoding can either be
  787. (7-bit) ASCII, or a code set which
  788. contains ASCII (Ex: ISO-8859-X, UTF-8)</td>
  789. </tr>
  790. <tr><td>protocol_version</td>
  791. <td>get</td>
  792. <td>{for now, always 1}</td>
  793. </tr>
  794. <tr><td>supports_async</td>
  795. <td>get</td>
  796. <td>{for commands such as break}</td>
  797. </tr>
  798. <tr><td>data_encoding</td>
  799. <td>get</td>
  800. <td>optional, allows to turn off
  801. the default base64 encoding of data. This
  802. should only be used for development and
  803. debugging of the debugger engines
  804. themselves, and not for general use. If
  805. implemented the value 'base64' must be
  806. supported to turn back on regular
  807. encoding. the value 'none' means no
  808. encoding is in use. all elements that use
  809. encoding must include an encoding
  810. attribute.</td>
  811. </tr>
  812. <tr><td>breakpoint_languages</td>
  813. <td>get</td>
  814. <td>some engines may support more than one
  815. language. This feature returns a string
  816. which is a comma separated list of
  817. supported languages. <strong>If the engine does
  818. not provide this feature, then it is
  819. assumed that the engine only supports the
  820. language defined in the feature
  821. language_name.</strong> One example of this is an
  822. XSLT debugger engine which supports XSLT,
  823. XML, HTML and XHTML. An IDE may need this
  824. information to to know what types of
  825. breakpoints an engine will accept.</td>
  826. </tr>
  827. <tr><td>breakpoint_types</td>
  828. <td>get</td>
  829. <td>returns a space separated list with all
  830. the breakpoint types that are supported.
  831. See <a class="reference internal" href="#breakpoints">7.6 breakpoints</a> for a list of the
  832. 6 defined breakpoint types.</td>
  833. </tr>
  834. <tr><td>multiple_sessions</td>
  835. <td>get|set</td>
  836. <td>{0|1}</td>
  837. </tr>
  838. <tr><td>encoding</td>
  839. <td>get|set</td>
  840. <td>{ISO8859-15, UTF-8, etc.}</td>
  841. </tr>
  842. <tr><td>max_children</td>
  843. <td>get|set</td>
  844. <td>max number of array or object
  845. children to initially retrieve</td>
  846. </tr>
  847. <tr><td>max_data</td>
  848. <td>get|set
  849. get|set</td>
  850. <td>max amount of variable data to
  851. initially retrieve.</td>
  852. </tr>
  853. <tr><td>max_depth</td>
  854. <td>get|set</td>
  855. <td>maximum depth that the debugger
  856. engine may return when sending arrays,
  857. hashs or object structures to the IDE.</td>
  858. </tr>
  859. </tbody>
  860. </table>
  861. </blockquote>
  862. <p>The following features strings MAY be available, if they are not, the IDE should
  863. assume that the feature is not available:</p>
  864. <blockquote>
  865. <table border="1" class="docutils">
  866. <colgroup>
  867. <col width="34%" />
  868. <col width="9%" />
  869. <col width="57%" />
  870. </colgroup>
  871. <tbody valign="top">
  872. <tr><td>supports_postmortem</td>
  873. <td>get</td>
  874. <td>[0|1] This feature lets an IDE know that
  875. there is benefit to continuing interaction
  876. during the STOPPING state (sect. 7.1).</td>
  877. </tr>
  878. <tr><td>show_hidden</td>
  879. <td>get|set</td>
  880. <td>[0|1] This feature can get set by the IDE
  881. if it wants to have more detailed internal
  882. information on properties (eg. private
  883. members of classes, etc.) Zero means that
  884. hidden members are not shown to the IDE.</td>
  885. </tr>
  886. <tr><td>notify_ok</td>
  887. <td>get|set</td>
  888. <td>[0|1] See section 8.5</td>
  889. </tr>
  890. </tbody>
  891. </table>
  892. </blockquote>
  893. <p>Additionally, all protocol commands supported must have a string,
  894. such as the following examples:</p>
  895. <pre class="literal-block">
  896. breakpoint_set
  897. break
  898. eval
  899. </pre>
  900. </div>
  901. <div class="section" id="feature-get">
  902. <h3><a class="toc-backref" href="#id40">7.2.2 feature_get</a></h3>
  903. <p>arguments for feature_get include:</p>
  904. <blockquote>
  905. <table border="1" class="docutils">
  906. <colgroup>
  907. <col width="5%" />
  908. <col width="95%" />
  909. </colgroup>
  910. <tbody valign="top">
  911. <tr><td>-n</td>
  912. <td>feature_name</td>
  913. </tr>
  914. </tbody>
  915. </table>
  916. </blockquote>
  917. <p>IDE</p>
  918. <pre class="literal-block">
  919. feature-get -i transaction_id -n feature_name
  920. </pre>
  921. <p>debugger engine</p>
  922. <pre class="literal-block">
  923. &lt;response command=&quot;feature_get&quot;
  924. feature_name=&quot;feature_name&quot;
  925. supported=&quot;0|1&quot;
  926. transaction_id=&quot;transaction_id&quot;&gt;
  927. feature setting or available options, such as a list of
  928. supported encodings
  929. &lt;/response&gt;
  930. </pre>
  931. <p>The 'supported' attribute does NOT mean that the feature is supported, this
  932. is encoded in the text child of the response tag. The 'supported' attribute
  933. informs whether the feature with 'feature_name' is supported by feature_get
  934. in the engine, or when the command with name 'feature_get' is supported by the
  935. engine.</p>
  936. <p>Example: Xdebug does not understand the 'breakpoint_languages' feature
  937. and will therefore set the supported attribute to '0'. It does however
  938. understand the feature 'language_supports_threads' and the 'supported'
  939. attribute is therefore set to '1', but as PHP does not support threads,
  940. the returned value is in this case &quot;0&quot;.</p>
  941. </div>
  942. <div class="section" id="feature-set">
  943. <h3><a class="toc-backref" href="#id41">7.2.3 feature_set</a></h3>
  944. <p>The feature set command allows a IDE to tell the debugger engine what additional
  945. capabilities it has. One example of this would be telling the debugger engine
  946. whether the IDE supports multiple debugger sessions (for threads, etc.). The
  947. debugger engine responds with telling the IDE whether it has enabled the feature
  948. or not.</p>
  949. <p>Note: The IDE does not have to listen for additional debugger connections if it
  950. does not support debugging multiple sessions. debugger engines must handle
  951. connection failures gracefully.</p>
  952. <p>arguments for feature_set include:</p>
  953. <blockquote>
  954. <table border="1" class="docutils">
  955. <colgroup>
  956. <col width="5%" />
  957. <col width="95%" />
  958. </colgroup>
  959. <tbody valign="top">
  960. <tr><td>-n</td>
  961. <td>feature_name</td>
  962. </tr>
  963. <tr><td>-v</td>
  964. <td>value to be set</td>
  965. </tr>
  966. </tbody>
  967. </table>
  968. </blockquote>
  969. <p>feature_set can be called at any time during a debug session to
  970. change values previously set. This allows a IDE to change
  971. encodings.</p>
  972. <p>IDE</p>
  973. <pre class="literal-block">
  974. feature_set -i transaction_id -n feature-name -v value
  975. </pre>
  976. <p>debugger engine</p>
  977. <pre class="literal-block">
  978. &lt;response command=&quot;feature_set&quot;
  979. feature=&quot;feature_name&quot;
  980. success=&quot;0|1&quot;
  981. transaction_id=&quot;transaction_id&quot;/&gt;
  982. </pre>
  983. </div>
  984. </div>
  985. <div class="section" id="continuation-commands">
  986. <h2><a class="toc-backref" href="#id42">7.5 continuation commands</a></h2>
  987. <p>resume the execution of the application.</p>
  988. <dl class="docutils">
  989. <dt>run:</dt>
  990. <dd>starts or resumes the script until a new breakpoint is reached,
  991. or the end of the script is reached.</dd>
  992. <dt>step_into:</dt>
  993. <dd>steps to the next statement, if there is a function call
  994. involved it will break on the first statement in that function</dd>
  995. <dt>step_over:</dt>
  996. <dd>steps to the next statement, if there is a function call on the
  997. line from which the step_over is issued then the debugger engine
  998. will stop at the statement after the function call in the same
  999. scope as from where the command was issued</dd>
  1000. <dt>step_out:</dt>
  1001. <dd>steps out of the current scope and breaks on the statement after
  1002. returning from the current function. (Also called 'finish' in
  1003. GDB)</dd>
  1004. <dt>stop:</dt>
  1005. <dd>ends execution of the script immediately, the debugger engine may
  1006. not respond, though if possible should be designed to do so.
  1007. The script will be terminated right away and be followed by a
  1008. disconnection of the network connection from the IDE (and debugger
  1009. engine if required in multi request apache processes).</dd>
  1010. <dt>detach (optional):</dt>
  1011. <dd>stops interaction with the debugger engine. Once this command
  1012. is executed, the IDE will no longer be able to communicate with
  1013. the debugger engine. This does not end execution of the script
  1014. as does the stop command above, but rather detaches from debugging.
  1015. Support of this continuation command is optional, and the IDE should
  1016. verify support for it via the feature_get command. If the IDE has
  1017. created stdin/stdout/stderr pipes for execution of the script
  1018. (eg. an interactive shell or other console to catch script output),
  1019. it should keep those open and usable by the process until the process
  1020. has terminated normally.</dd>
  1021. </dl>
  1022. <p>The response to a continue command is a status response (see
  1023. status above). The debugger engine does not send this response
  1024. immediately, but rather when it reaches a breakpoint, or ends
  1025. execution for any other reason.</p>
  1026. <p>IDE</p>
  1027. <pre class="literal-block">
  1028. run -i transaction_id
  1029. </pre>
  1030. <p>debugger engine</p>
  1031. <pre class="literal-block">
  1032. &lt;response command=&quot;run&quot;
  1033. status=&quot;starting&quot;
  1034. reason=&quot;ok&quot;
  1035. transaction_id=&quot;transaction_id&quot;/&gt;
  1036. </pre>
  1037. </div>
  1038. <div class="section" id="breakpoints">
  1039. <h2><a class="toc-backref" href="#id43">7.6 breakpoints</a></h2>
  1040. <p>Breakpoints are locations or conditions at which a debugger engine
  1041. pauses execution, responds to the IDE, and waits for further commands
  1042. from the IDE. A failure in any breakpoint commands results in an
  1043. error defined in <a class="reference internal" href="#debugger-engine-errors">section 6.5</a>.</p>
  1044. <p>The following DBGP commands relate to breakpoints:</p>
  1045. <blockquote>
  1046. <table border="1" class="docutils">
  1047. <colgroup>
  1048. <col width="27%" />
  1049. <col width="73%" />
  1050. </colgroup>
  1051. <tbody valign="top">
  1052. <tr><td><a class="reference internal" href="#id1">breakpoint_set</a></td>
  1053. <td>Set a new breakpoint on the session.</td>
  1054. </tr>
  1055. <tr><td><a class="reference internal" href="#id2">breakpoint_get</a></td>
  1056. <td>Get breakpoint info for the given breakpoint id.</td>
  1057. </tr>
  1058. <tr><td><a class="reference internal" href="#id3">breakpoint_update</a></td>
  1059. <td>Update one or more attributes of a breakpoint.</td>
  1060. </tr>
  1061. <tr><td><a class="reference internal" href="#id4">breakpoint_remove</a></td>
  1062. <td>Remove the given breakpoint on the session.</td>
  1063. </tr>
  1064. <tr><td><a class="reference internal" href="#id5">breakpoint_list</a></td>
  1065. <td>Get a list of all of the session's breakpoints.</td>
  1066. </tr>
  1067. </tbody>
  1068. </table>
  1069. </blockquote>
  1070. <p>There are six different breakpoints <em>types</em>:</p>
  1071. <blockquote>
  1072. <table border="1" class="docutils">
  1073. <colgroup>
  1074. <col width="21%" />
  1075. <col width="17%" />
  1076. <col width="62%" />
  1077. </colgroup>
  1078. <thead valign="bottom">
  1079. <tr><th class="head">Type</th>
  1080. <th class="head">Req'd Attrs</th>
  1081. <th class="head">Description</th>
  1082. </tr>
  1083. </thead>
  1084. <tbody valign="top">
  1085. <tr><td>line</td>
  1086. <td>filename,
  1087. lineno</td>
  1088. <td>break on the given lineno in the given
  1089. file</td>
  1090. </tr>
  1091. <tr><td>call</td>
  1092. <td>function</td>
  1093. <td>break on entry into new stack for
  1094. function name</td>
  1095. </tr>
  1096. <tr><td>return</td>
  1097. <td>function</td>
  1098. <td>break on exit from stack for function
  1099. name</td>
  1100. </tr>
  1101. <tr><td>exception</td>
  1102. <td>exception</td>
  1103. <td>break on exception of the given name</td>
  1104. </tr>
  1105. <tr><td>conditional</td>
  1106. <td>expression,
  1107. filename</td>
  1108. <td>break when the given expression is true
  1109. at the given filename and line number or
  1110. just in given filename</td>
  1111. </tr>
  1112. <tr><td>watch</td>
  1113. <td>expression</td>
  1114. <td>break on write of the variable or address
  1115. defined by the expression argument</td>
  1116. </tr>
  1117. </tbody>
  1118. </table>
  1119. </blockquote>
  1120. <p>A breakpoint has the following attributes. Note that some attributes are only
  1121. applicable for some breakpoint types.</p>
  1122. <blockquote>
  1123. <table border="1" class="docutils">
  1124. <colgroup>
  1125. <col width="24%" />
  1126. <col width="76%" />
  1127. </colgroup>
  1128. <tbody valign="top">
  1129. <tr><td>type</td>
  1130. <td>breakpoint type (see table above for valid types)</td>
  1131. </tr>
  1132. <tr><td>filename</td>
  1133. <td>The file the breakpoint is effective in. This must be
  1134. a &quot;<a class="reference external" href="file://">file://</a>&quot; or &quot;dbgp:&quot; (See <a class="reference internal" href="#dynamic-code-and-virtual-files">6.7 Dynamic code and
  1135. virtual files</a>) URI.</td>
  1136. </tr>
  1137. <tr><td>lineno</td>
  1138. <td>Line number on which breakpoint is effective. Line
  1139. numbers are 1-based. If an implementation requires a
  1140. numeric value to indicate that <em>lineno</em> is not set,
  1141. it is suggested that -1 be used, although this is not
  1142. enforced.</td>
  1143. </tr>
  1144. <tr><td>state</td>
  1145. <td>Current state of the breakpoint. This must be one of
  1146. <em>enabled</em>, <em>disabled</em>.</td>
  1147. </tr>
  1148. <tr><td>function</td>
  1149. <td>Function name for <em>call</em> or <em>return</em> type
  1150. breakpoints.</td>
  1151. </tr>
  1152. <tr><td>temporary</td>
  1153. <td>Flag to define if breakpoint is temporary. A
  1154. temporary breakpoint is one that is deleted after its
  1155. first use. This is useful for features like &quot;Run to
  1156. Cursor&quot;. Once the debugger engine uses a temporary
  1157. breakpoint, it should automatically remove the breakpoint
  1158. from it's list of valid breakpoints.</td>
  1159. </tr>
  1160. <tr><td>hit_count</td>
  1161. <td>Number of effective hits for the breakpoint in the
  1162. current session. This value is maintained by the
  1163. debugger engine (a.k.a. DBGP client). A
  1164. breakpoint's hit count should be increment whenever
  1165. it is considered to break execution (i.e. whenever
  1166. debugging comes to this line). If the breakpoint is
  1167. <em>disabled</em> then the hit count should NOT be
  1168. incremented.</td>
  1169. </tr>
  1170. <tr><td>hit_value</td>
  1171. <td>A numeric value used together with the
  1172. <em>hit_condition</em> to determine if the breakpoint should
  1173. pause execution or be skipped.</td>
  1174. </tr>
  1175. <tr><td>hit_condition</td>
  1176. <td><p class="first">A string indicating a condition to use to compare
  1177. <em>hit_count</em> and <em>hit_value</em>. The following values are
  1178. legal:</p>
  1179. <dl class="last docutils">
  1180. <dt><cite>&gt;=</cite></dt>
  1181. <dd>break if hit_count is greater than or equal to
  1182. hit_value [default]</dd>
  1183. <dt><cite>==</cite></dt>
  1184. <dd>break if hit_count is equal to hit_value</dd>
  1185. <dt><cite>%</cite></dt>
  1186. <dd>break if hit_count is a multiple of hit_value</dd>
  1187. </dl>
  1188. </td>
  1189. </tr>
  1190. <tr><td>exception</td>
  1191. <td>Exception name for <em>exception</em> type breakpoints.</td>
  1192. </tr>
  1193. <tr><td>expression</td>
  1194. <td>The expression used for <em>conditional</em> and <em>watch</em> type
  1195. breakpoints</td>
  1196. </tr>
  1197. </tbody>
  1198. </table>
  1199. </blockquote>
  1200. <p>Breakpoints should be maintained in the debugger engine at an application
  1201. level, not the thread level. Debugger engines that support thread debugging
  1202. MUST provide breakpoint id's that are global for the application, and must
  1203. use all breakpoints for all threads where applicable.</p>
  1204. <p>As for any other commands, if there is error the debugger engine should
  1205. return an error response as described in <a class="reference internal" href="#debugger-engine-errors">section 6.5</a>.</p>
  1206. <div class="section" id="id1">
  1207. <h3><a class="toc-backref" href="#id44">7.6.1 breakpoint_set</a></h3>
  1208. <p>This command is used by the IDE to set a breakpoint for the session.</p>
  1209. <p>IDE to debugger engine:</p>
  1210. <pre class="literal-block">
  1211. breakpoint_set -i TRANSACTION_ID [&lt;arguments...&gt;] -- base64(expression)
  1212. </pre>
  1213. <p>where the arguments are:</p>
  1214. <blockquote>
  1215. <table border="1" class="docutils">
  1216. <colgroup>
  1217. <col width="25%" />
  1218. <col width="75%" />
  1219. </colgroup>
  1220. <tbody valign="top">
  1221. <tr><td>-t TYPE</td>
  1222. <td>breakpoint <em>type</em>, see above for valid values
  1223. [required]</td>
  1224. </tr>
  1225. <tr><td>-s STATE</td>
  1226. <td>breakpoint <em>state</em> [optional, defaults to &quot;enabled&quot;]</td>
  1227. </tr>
  1228. <tr><td>-f FILENAME</td>
  1229. <td>the <em>filename</em> to which the breakpoint belongs
  1230. [optional]</td>
  1231. </tr>
  1232. <tr><td>-n LINENO</td>
  1233. <td>the line number (<em>lineno</em>) of the breakpoint
  1234. [optional]</td>
  1235. </tr>
  1236. <tr><td>-m FUNCTION</td>
  1237. <td><em>function</em> name [required for <em>call</em> or <em>return</em>
  1238. breakpoint types]</td>
  1239. </tr>
  1240. <tr><td>-x EXCEPTION</td>
  1241. <td><em>exception</em> name [required for <em>exception</em> breakpoint
  1242. types]</td>
  1243. </tr>
  1244. <tr><td>-h HIT_VALUE</td>
  1245. <td>hit value (<em>hit_value</em>) used with the hit condition
  1246. to determine if should break; a value of zero
  1247. indicates hit count processing is disabled for this
  1248. breakpoint [optional, defaults to zero (i.e.
  1249. disabled)]</td>
  1250. </tr>
  1251. <tr><td>-o HIT_CONDITION</td>
  1252. <td>hit condition string (<em>hit_condition</em>); see
  1253. hit_condition documentation above; BTW 'o' stands for
  1254. 'operator' [optional, defaults to '&gt;=']</td>
  1255. </tr>
  1256. <tr><td>-r 0|1</td>
  1257. <td>Boolean value indicating if this breakpoint is
  1258. <em>temporary</em>. [optional, defaults to false]</td>
  1259. </tr>
  1260. <tr><td>-- EXPRESSION</td>
  1261. <td>code <em>expression</em>, in the language of the debugger
  1262. engine. The breakpoint should activate when the
  1263. evaluated code evaluates to <em>true</em>. [required for
  1264. <em>conditional</em> breakpoint types]</td>
  1265. </tr>
  1266. </tbody>
  1267. </table>
  1268. </blockquote>
  1269. <p>An example breakpoint_set command for a conditional breakpoint could look
  1270. like this:</p>
  1271. <pre class="literal-block">
  1272. breakpoint_set -i 1 -t line -f test.pl -n 20 -- base64($x &gt; 3)
  1273. </pre>
  1274. <p>A unique id for this breakpoint for this session is returned by the debugger
  1275. engine. This <em>session breakpoint id</em> is used by the IDE to identify the
  1276. breakpoint in other breakpoint commands. It is up to the engine on how
  1277. to handle multiple &quot;similar&quot; breakpoints, such as a double breakpoint
  1278. on a specific file/line combination - even if other parameters such as
  1279. hit_value/hit_condition are different.</p>
  1280. <p>debugger engine to IDE:</p>
  1281. <pre class="literal-block">
  1282. &lt;response command=&quot;breakpoint_set&quot;
  1283. transaction_id=&quot;TRANSACTION_ID&quot;
  1284. state=&quot;STATE&quot;
  1285. id=&quot;BREAKPOINT_ID&quot;/&gt;
  1286. </pre>
  1287. <p>where,</p>
  1288. <blockquote>
  1289. <table border="1" class="docutils">
  1290. <colgroup>
  1291. <col width="25%" />
  1292. <col width="75%" />
  1293. </colgroup>
  1294. <tbody valign="top">
  1295. <tr><td>BREAKPOINT_ID</td>
  1296. <td>is an arbitrary string that uniquely identifies this
  1297. breakpoint in the debugger engine.</td>
  1298. </tr>
  1299. <tr><td>STATE</td>
  1300. <td>the initial state of the breakpoint as set by the
  1301. debugger engine</td>
  1302. </tr>
  1303. </tbody>
  1304. </table>
  1305. </blockquote>
  1306. </div>
  1307. <div class="section" id="id2">
  1308. <h3><a class="toc-backref" href="#id45">7.6.2 breakpoint_get</a></h3>
  1309. <p>This command is used by the IDE to get breakpoint information from the
  1310. debugger engine.</p>
  1311. <p>IDE to debugger engine:</p>
  1312. <pre class="literal-block">
  1313. breakpoint_get -i TRANSACTION_ID -d BREAKPOINT_ID
  1314. </pre>
  1315. <p>where,</p>
  1316. <blockquote>
  1317. <table border="1" class="docutils">
  1318. <colgroup>
  1319. <col width="25%" />
  1320. <col width="75%" />
  1321. </colgroup>
  1322. <tbody valign="top">
  1323. <tr><td>BREAKPOINT_ID</td>
  1324. <td>is the unique <em>session breakpoint id</em> returned by
  1325. <em>breakpoint_set</em>.</td>
  1326. </tr>
  1327. </tbody>
  1328. </table>
  1329. </blockquote>
  1330. <p>debugger engine to IDE:</p>
  1331. <pre class="literal-block">
  1332. &lt;response command=&quot;breakpoint_get&quot;
  1333. transaction_id=&quot;TRANSACTION_ID&quot;&gt;
  1334. &lt;breakpoint id=&quot;BREAKPOINT_ID&quot;
  1335. type=&quot;TYPE&quot;
  1336. state=&quot;STATE&quot;
  1337. filename=&quot;FILENAME&quot;
  1338. lineno=&quot;LINENO&quot;
  1339. function=&quot;FUNCTION&quot;
  1340. exception=&quot;EXCEPTION&quot;
  1341. expression=&quot;EXPRESSION&quot;
  1342. hit_value=&quot;HIT_VALUE&quot;
  1343. hit_condition=&quot;HIT_CONDITION&quot;
  1344. hit_count=&quot;HIT_COUNT&quot;&gt;
  1345. &lt;expression&gt;EXPRESSION&lt;/expression&gt;
  1346. &lt;/breakpoint&gt;
  1347. &lt;/response&gt;
  1348. </pre>
  1349. <p>where each breakpoint attribute is only required if its value is relevant.
  1350. E.g., the &lt;expression/&gt; child element need only be included if there is an
  1351. expression defined, the <em>function</em> attribute need only be included if this is
  1352. a <em>function</em> breakpoint.</p>
  1353. </div>
  1354. <div class="section" id="id3">
  1355. <h3><a class="toc-backref" href="#id46">7.6.3 breakpoint_update</a></h3>
  1356. <p>This command is used by the IDE to update one or more attributes of a
  1357. breakpoint that was already set on the debugger engine via <em>breakpoint_set</em>.</p>
  1358. <p>IDE to debugger engine:</p>
  1359. <pre class="literal-block">
  1360. breakpoint_update -i TRANSACTION_ID -d BREAKPOINT_ID [&lt;arguments...&gt;]
  1361. </pre>
  1362. <p>where the arguments are as follows. All arguments are optional, however
  1363. at least one argument should be present. See <a class="reference internal" href="#id1">breakpoint_set</a> for a description of
  1364. each argument:</p>
  1365. <blockquote>
  1366. <table border="1" class="docutils">
  1367. <colgroup>
  1368. <col width="12%" />
  1369. <col width="88%" />
  1370. </colgroup>
  1371. <tbody valign="top">
  1372. <tr><td>-s</td>
  1373. <td>STATE</td>
  1374. </tr>
  1375. <tr><td>-n</td>
  1376. <td>LINENO</td>
  1377. </tr>
  1378. <tr><td>-h</td>
  1379. <td>HIT_VALUE</td>
  1380. </tr>
  1381. <tr><td>-o</td>
  1382. <td>HIT_CONDITION</td>
  1383. </tr>
  1384. </tbody>
  1385. </table>
  1386. </blockquote>
  1387. <p>debugger engine to IDE:</p>
  1388. <pre class="literal-block">
  1389. &lt;response command=&quot;breakpoint_update&quot;
  1390. transaction_id=&quot;TRANSACTION_ID&quot;/&gt;
  1391. </pre>
  1392. </div>
  1393. <div class="section" id="id4">
  1394. <h3><a class="toc-backref" href="#id47">7.6.4 breakpoint_remove</a></h3>
  1395. <p>This command is used by the IDE to remove the given breakpoint. The
  1396. debugger engine can optionally embed the remove breakpoint as child
  1397. element.</p>
  1398. <p>IDE to debugger engine:</p>
  1399. <pre class="literal-block">
  1400. breakpoint_remove -i TRANSACTION_ID -d BREAKPOINT_ID
  1401. </pre>
  1402. <p>debugger engine to IDE:</p>
  1403. <pre class="literal-block">
  1404. &lt;response command=&quot;breakpoint_remove&quot;
  1405. transaction_id=&quot;TRANSACTION_ID&quot;/&gt;
  1406. </pre>
  1407. </div>
  1408. <div class="section" id="id5">
  1409. <h3><a class="toc-backref" href="#id48">7.6.5 breakpoint_list</a></h3>
  1410. <p>This command is used by the IDE to get breakpoint information for all
  1411. breakpoints that the debugger engine has.</p>
  1412. <p>IDE to debugger engine:</p>
  1413. <pre class="literal-block">
  1414. breakpoint_list -i TRANSACTION_ID
  1415. </pre>
  1416. <p>debugger engine to IDE:</p>
  1417. <pre class="literal-block">
  1418. &lt;response command=&quot;breakpoint_list&quot;
  1419. transaction_id=&quot;TRANSACTION_ID&quot;&gt;
  1420. &lt;breakpoint id=&quot;BREAKPOINT_ID&quot;
  1421. type=&quot;TYPE&quot;
  1422. state=&quot;STATE&quot;
  1423. filename=&quot;FILENAME&quot;
  1424. lineno=&quot;LINENO&quot;
  1425. function=&quot;FUNCTION&quot;
  1426. exception=&quot;EXCEPTION&quot;
  1427. hit_value=&quot;HIT_VALUE&quot;
  1428. hit_condition=&quot;HIT_CONDITION&quot;
  1429. hit_count=&quot;HIT_COUNT&quot;&gt;
  1430. &lt;expression&gt;EXPRESSION&lt;/expression&gt;
  1431. &lt;/breakpoint&gt;
  1432. &lt;breakpoint ...&gt;...&lt;/breakpoint&gt;
  1433. ...
  1434. &lt;/response&gt;
  1435. </pre>
  1436. </div>
  1437. </div>
  1438. <div class="section" id="stack-depth">
  1439. <h2><a class="toc-backref" href="#id49">7.7 stack_depth</a></h2>
  1440. <p>IDE</p>
  1441. <pre class="literal-block">
  1442. stack-depth -i transaction_id
  1443. </pre>
  1444. <p>debugger engine</p>
  1445. <pre class="literal-block">
  1446. &lt;response command=&quot;stack_depth&quot;
  1447. depth=&quot;{NUM}&quot;
  1448. transaction_id=&quot;transaction_id&quot;/&gt;
  1449. </pre>
  1450. </div>
  1451. <div class="section" id="stack-get">
  1452. <h2><a class="toc-backref" href="#id50">7.8 stack_get</a></h2>
  1453. <p>Returns stack information for a given stack depth. For extended
  1454. debuggers, multiple file/line's may be returned by having
  1455. child elements of the stack element. This is to allow
  1456. for debuggers, such as XSLT, that have execution and data files.
  1457. The filename returned should always be the local file
  1458. system path translated into a file URI, and should include the
  1459. system name if the engine is not connecting to an ip on the local
  1460. box: <a class="reference external" href="file://systemname">file://systemname</a>/c|/path. If the stack depth is
  1461. specified, only one stack element is returned, for the depth
  1462. requested, though child elements may be returned also. The
  1463. current context is stack depth of zero, the 'oldest' context
  1464. (in some languages known as 'main') is the highest numbered
  1465. context.</p>
  1466. <blockquote>
  1467. <table border="1" class="docutils">
  1468. <colgroup>
  1469. <col width="5%" />
  1470. <col width="95%" />
  1471. </colgroup>
  1472. <tbody valign="top">
  1473. <tr><td>-d</td>
  1474. <td>stack depth (optional)</td>
  1475. </tr>
  1476. </tbody>
  1477. </table>
  1478. </blockquote>
  1479. <p>IDE</p>
  1480. <pre class="literal-block">
  1481. stack_get -d {NUM} -i transaction_id
  1482. </pre>
  1483. <p>debugger engine</p>
  1484. <pre class="literal-block">
  1485. &lt;response command=&quot;stack_get&quot;
  1486. transaction_id=&quot;transaction_id&quot;&gt;
  1487. &lt;stack level=&quot;{NUM}&quot;
  1488. type=&quot;file|eval|?&quot;
  1489. filename=&quot;...&quot;
  1490. lineno=&quot;{NUM}&quot;
  1491. where=&quot;&quot;
  1492. cmdbegin=&quot;line_number:offset&quot;
  1493. cmdend=&quot;line_number:offset&quot;/&gt;
  1494. &lt;stack level=&quot;{NUM}&quot;
  1495. type=&quot;file|eval|?&quot;
  1496. filename=&quot;...&quot;
  1497. lineno=&quot;{NUM}&quot;&gt;
  1498. &lt;input level=&quot;{NUM}&quot;
  1499. type=&quot;file|eval|?&quot;
  1500. filename=&quot;...&quot;
  1501. lineno=&quot;{NUM}&quot;/&gt;
  1502. &lt;/stack&gt;
  1503. &lt;/response&gt;
  1504. </pre>
  1505. <p>Attributes for the stack element can include:</p>
  1506. <blockquote>
  1507. <table border="1" class="docutils">
  1508. <colgroup>
  1509. <col width="14%" />
  1510. <col width="86%" />
  1511. </colgroup>
  1512. <thead valign="bottom">
  1513. <tr><th class="head">Attribute</th>
  1514. <th class="head">Description</th>
  1515. </tr>
  1516. </thead>
  1517. <tbody valign="top">
  1518. <tr><td>level</td>
  1519. <td>stack depth for this stack element</td>
  1520. </tr>
  1521. <tr><td>type</td>
  1522. <td>the type of stack frame. Valid values are file or eval.</td>
  1523. </tr>
  1524. <tr><td>filename</td>
  1525. <td>file URI</td>
  1526. </tr>
  1527. <tr><td>lineno</td>
  1528. <td>1-based line offset into the buffer</td>
  1529. </tr>
  1530. <tr><td>where</td>
  1531. <td>current command name (optional)</td>
  1532. </tr>
  1533. <tr><td>cmdbegin</td>
  1534. <td>line number and text offset from beginning of line
  1535. for the current instruction (optional)</td>
  1536. </tr>
  1537. <tr><td>cmdend</td>
  1538. <td>same as cmdbegin, denotes end of current instruction</td>
  1539. </tr>
  1540. </tbody>
  1541. </table>
  1542. </blockquote>
  1543. <p>The attributes where, cmdbegin and cmdlength are primarily used
  1544. for relaying visual information in the IDE. cmdbegin and cmdend
  1545. can be used by the IDE for high lighting the command that is
  1546. currently being debugged. The where attribute contains the name
  1547. of the current stack. This could be the current function name
  1548. that the user is stepping through.</p>
  1549. </div>
  1550. <div class="section" id="context-names">
  1551. <h2><a class="toc-backref" href="#id51">7.9 context_names</a></h2>
  1552. <p>The names of currently available contexts at a given stack depth,
  1553. typically Local, Global and Class. These SHOULD be UI friendly
  1554. names. The numerical id attribute returned with the names is used in other
  1555. commands such as context_get to identify the context. The context
  1556. id zero is always considered to be the 'default' context is no
  1557. context id is provided. In most languages, this will the be
  1558. 'local' context.</p>
  1559. <blockquote>
  1560. <table border="1" class="docutils">
  1561. <colgroup>
  1562. <col width="3%" />
  1563. <col width="97%" />
  1564. </colgroup>
  1565. <tbody valign="top">
  1566. <tr><td>-d</td>
  1567. <td>stack depth (optional)</td>
  1568. </tr>
  1569. </tbody>
  1570. </table>
  1571. </blockquote>
  1572. <p>IDE</p>
  1573. <pre class="literal-block">
  1574. context_names -d {NUM} -i transaction_id
  1575. </pre>
  1576. <p>debugger engine</p>
  1577. <pre class="literal-block">
  1578. &lt;response command=&quot;context_names&quot;
  1579. transaction_id=&quot;transaction_id&quot;&gt;
  1580. &lt;context name=&quot;Local&quot; id=&quot;0&quot;/&gt;
  1581. &lt;context name=&quot;Global&quot; id=&quot;1&quot;/&gt;
  1582. &lt;context name=&quot;Class&quot; id=&quot;2&quot;/&gt;
  1583. &lt;/response&gt;
  1584. </pre>
  1585. </div>
  1586. <div class="section" id="context-get">
  1587. <h2><a class="toc-backref" href="#id52">7.10 context_get</a></h2>
  1588. <p>Returns an array of properties in a given context at a given
  1589. stack depth. If the stack depth is omitted, the current
  1590. stack depth is used. If the context name is omitted, the context
  1591. with an id zero is used (generally the 'locals' context).</p>
  1592. <blockquote>
  1593. <table border="1" class="docutils">
  1594. <colgroup>
  1595. <col width="3%" />
  1596. <col width="97%" />
  1597. </colgroup>
  1598. <tbody valign="top">
  1599. <tr><td>-d</td>
  1600. <td>stack depth (optional)</td>
  1601. </tr>
  1602. <tr><td>-c</td>
  1603. <td>context id (optional, retrieved by context-names)</td>
  1604. </tr>
  1605. </tbody>
  1606. </table>
  1607. </blockquote>
  1608. <p>IDE</p>
  1609. <pre class="literal-block">
  1610. context_get -d {NUM} -i transaction_id
  1611. </pre>
  1612. <p>debugger engine</p>
  1613. <pre class="literal-block">
  1614. &lt;response command=&quot;context_get&quot;
  1615. context=&quot;context_id&quot;
  1616. transaction_id=&quot;transaction_id&quot;&gt;
  1617. &lt;property ... /&gt;
  1618. &lt;/response&gt;
  1619. </pre>
  1620. </div>
  1621. <div class="section" id="properties-variables-and-values">
  1622. <h2><a class="toc-backref" href="#id53">7.11 Properties, variables and values</a></h2>
  1623. <p>Properties that have children may return an arbitrary depth of
  1624. children, as defaulted by the debugger engine. A maximum depth
  1625. may be defined by the IDE using the feature_set command with the
  1626. max_depth argument. The IDE may then use the fullname attribute of
  1627. a property to dig further into the tree. Data types are defined
  1628. further in section 7.12 below.</p>
  1629. <p>The number of children sent is defined by the debugger engine unless
  1630. otherwise defined by sending the feature_set command with the
  1631. max_children argument. If max_depth &gt; 1, irregardless of the page
  1632. argument, the childrens pages are always the first page. Children are
  1633. only returned if max_depth &gt; 0 and max_children &gt; 0.</p>
  1634. <pre class="literal-block">
  1635. &lt;property
  1636. name=&quot;short_name&quot;
  1637. fullname=&quot;long_name&quot;
  1638. type=&quot;data_type&quot;
  1639. classname=&quot;name_of_object_class&quot;
  1640. constant=&quot;0|1&quot;
  1641. children=&quot;0|1&quot;
  1642. size=&quot;{NUM}&quot;
  1643. page=&quot;{NUM}&quot;
  1644. pagesize=&quot;{NUM}&quot;
  1645. address=&quot;{NUM}&quot;
  1646. key=&quot;language_dependent_key&quot;
  1647. encoding=&quot;base64|none&quot;
  1648. numchildren=&quot;{NUM}&quot;&gt;
  1649. ...encoded Value Data...
  1650. &lt;/property&gt;
  1651. </pre>
  1652. <p>Attributes in the property element can include:</p>
  1653. <blockquote>
  1654. <table border="1" class="docutils">
  1655. <colgroup>
  1656. <col width="21%" />
  1657. <col width="79%" />
  1658. </colgroup>
  1659. <thead valign="bottom">
  1660. <tr><th class="head">Attribute</th>
  1661. <th class="head">Description</th>
  1662. </tr>
  1663. </thead>
  1664. <tbody valign="top">
  1665. <tr><td>name</td>
  1666. <td>variable name. This is the short part of the
  1667. name. For instance, in PHP:
  1668. $v = 0; // short name 'v'
  1669. class:$v; // short name 'v'</td>
  1670. </tr>
  1671. <tr><td>fullname</td>
  1672. <td>variable name. This is the long form of the name
  1673. which can be eval'd by the language to retrieve
  1674. the value of the variable.
  1675. $v = 0; // long name 'v'
  1676. class::$v; // short name 'v', long 'class::$v'
  1677. $this-&gt;v; // short name 'v', long '$this-&gt;v'</td>
  1678. </tr>
  1679. <tr><td>classname</td>
  1680. <td>If the type is an object or resource, then the
  1681. debugger engine MAY specify the class name
  1682. This is an optional attribute.</td>
  1683. </tr>
  1684. <tr><td>page</td>
  1685. <td>if not all the children in the first level are
  1686. returned, then the page attribute, in combination
  1687. with the pagesize attribute will define where in
  1688. the array or object these children should be
  1689. located. The page number is 0-based.</td>
  1690. </tr>
  1691. <tr><td>pagesize</td>
  1692. <td>the size of each page of data, defaulted by the
  1693. debugger engine, or negotiated with feature_set
  1694. and max_children. Required when the page attribute
  1695. is available.</td>
  1696. </tr>
  1697. <tr><td>type</td>
  1698. <td>language specific data type name</td>
  1699. </tr>
  1700. <tr><td>facet</td>
  1701. <td>provides a hint to the IDE about additional
  1702. facets of this value. These are space separated
  1703. names, such as private, protected, public,
  1704. constant, etc.</td>
  1705. </tr>
  1706. <tr><td>size</td>
  1707. <td>size of property data in bytes</td>
  1708. </tr>
  1709. <tr><td>children</td>
  1710. <td>true/false whether the property has children
  1711. this would be true for objects or array's.</td>
  1712. </tr>
  1713. <tr><td>numchildren</td>
  1714. <td>optional attribute with number of children for
  1715. the property.</td>
  1716. </tr>
  1717. <tr><td>key</td>
  1718. <td>language dependent reference for the property.
  1719. if the key is available, the IDE SHOULD use it
  1720. to retrieve further data for the property, optional</td>
  1721. </tr>
  1722. <tr><td>address</td>
  1723. <td>containing physical memory address, optional</td>
  1724. </tr>
  1725. <tr><td>encoding</td>
  1726. <td>if this is binary data, it should be base64 encoded
  1727. with this attribute set</td>
  1728. </tr>
  1729. </tbody>
  1730. </table>
  1731. </blockquote>
  1732. </div>
  1733. <div class="section" id="data-types">
  1734. <h2><a class="toc-backref" href="#id54">7.12 Data Types</a></h2>
  1735. <p>Languages may have different names or meanings for data types,
  1736. however the IDE may want to be able to handle similar data types
  1737. as the same type. For this reason, we define a minimal set of
  1738. standard data types, and a method for specifying more explicit
  1739. facets on those types. We provide three different type attributes,
  1740. and a command to map those types to each other. The schema type
  1741. serves as a hint to the IDE as to how to handle this specific data
  1742. type, if it so chooses to, but should not be considered to be
  1743. generally supported. If the debugger engine chooses to support
  1744. Schema, it should handle all data validation itself.</p>
  1745. <dl class="docutils">
  1746. <dt>language type:</dt>
  1747. <dd>A language specific name for a data type</dd>
  1748. <dt>common type:</dt>
  1749. <dd>A name used by the IDE to group data types
  1750. that are similar or the same</dd>
  1751. <dt>schema type:</dt>
  1752. <dd>The XML Schema data type name as specified
  1753. in the W3C Recommendation, XML Schema
  1754. Part 2: Datatypes located at
  1755. <a class="reference external" href="http://www.w3.org/TR/xmlschema-2/">http://www.w3.org/TR/xmlschema-2/</a>
  1756. The use of the schema type is completely
  1757. optional. The language engine should not
  1758. expect an IDE to support usage of this
  1759. attribute. The IDE identifies support for
  1760. this in the debugger engine by retrieving
  1761. the data map, which would contain the
  1762. schema type attribute.</dd>
  1763. </dl>
  1764. <div class="section" id="common-data-types">
  1765. <h3><a class="toc-backref" href="#id55">7.12.1 Common Data Types</a></h3>
  1766. <p>This is a list of the common data types supported by this protocol.
  1767. For ease of documentation, and as hints to the IDE, they are mapped
  1768. to one or more schema data types, which are documented at
  1769. <a class="reference external" href="http://www.w3.org/TR/xmlschema-2/">http://www.w3.org/TR/xmlschema-2/</a>. Some non-scalar types are also
  1770. defined, which do not have direct mappings to the base types defined
  1771. by XML Schema.</p>
  1772. <blockquote>
  1773. <table border="1" class="docutils">
  1774. <colgroup>
  1775. <col width="17%" />
  1776. <col width="83%" />
  1777. </colgroup>
  1778. <thead valign="bottom">
  1779. <tr><th class="head">Common Type</th>
  1780. <th class="head">Schema Type</th>
  1781. </tr>
  1782. </thead>
  1783. <tbody valign="top">
  1784. <tr><td>bool</td>
  1785. <td>boolean (The value is always 0 or 1)</td>
  1786. </tr>
  1787. <tr><td>int</td>
  1788. <td>integer, long, short, byte, and signed or
  1789. unsigned variants</td>
  1790. </tr>
  1791. <tr><td>float</td>
  1792. <td>float, double, decimal</td>
  1793. </tr>
  1794. <tr><td>string</td>
  1795. <td>string or other string-like data types, such as
  1796. dateTime, hexBinary, etc.</td>
  1797. </tr>
  1798. </tbody>
  1799. </table>
  1800. </blockquote>
  1801. <p>Data types that do not map to schema:</p>
  1802. <dl class="docutils">
  1803. <dt>null:</dt>
  1804. <dd>For example the &quot;None&quot; of Python or
  1805. the &quot;null&quot; of PHP. Some languages may not have
  1806. a method to specify a null type.</dd>
  1807. <dt>array:</dt>
  1808. <dd>for non-associative arrays, such as
  1809. List in Python. Arrays have integers as keys,
  1810. and the index is put in the name attribute of
  1811. the property element.</dd>
  1812. <dt>hash:</dt>
  1813. <dd>for associative arrays, such as Dictionaries
  1814. in Python. The only supported key type is a
  1815. string, which would be in the name attribute of
  1816. the property.</dd>
  1817. <dt>object:</dt>
  1818. <dd>An instance of a class.</dd>
  1819. <dt>resource:</dt>
  1820. <dd>Any data type the language supports that does
  1821. not map into one of the common types. This
  1822. could include pointers in C, various Python
  1823. types such as Method or Class types, or
  1824. file descriptors, database resources, etc. in
  1825. PHP. Complex types may also be defined by
  1826. using XML Schema, and mapping a type to the
  1827. Schema type. This is a more specialized use
  1828. of the type mapping, and should be considered
  1829. experimental, and not generally available in
  1830. implementations of this protocol.</dd>
  1831. <dt>undefined:</dt>
  1832. <dd>This is used when a variable exists in the
  1833. local scope but does not have any value yet.
  1834. This is optional, it is also correct to not
  1835. return the property at all instead.</dd>
  1836. </dl>
  1837. <p>For the most part, this protocol treats array's and hashes in the
  1838. same way, placing the key or index into the name attribute of the
  1839. property element.</p>
  1840. </div>
  1841. <div class="section" id="typemap-get">
  1842. <h3><a class="toc-backref" href="#id56">7.12.2 typemap_get</a></h3>
  1843. <p>The IDE calls this command to get information on how to
  1844. map language specific type names (as received in the property
  1845. element returned by the context_get, and property_*
  1846. commands). The debugger engine returns all data types that
  1847. it supports. There may be multiple map elements with the same
  1848. type attribute value, but the name value must be unique. This
  1849. allows a language to map multiple language specific types into
  1850. one of the common data types (eg. float and double can both
  1851. be mapped to float).</p>
  1852. <p>IDE</p>
  1853. <pre class="literal-block">
  1854. typemap_get -i transaction_id
  1855. </pre>
  1856. <p>debugger engine</p>
  1857. <pre class="literal-block">
  1858. &lt;response command=&quot;typemap_get&quot;
  1859. transaction_id=&quot;transaction_id&quot;
  1860. xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
  1861. xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot;&gt;
  1862. &lt;map type=&quot;common_type&quot;
  1863. name=&quot;language_type_name&quot;
  1864. xsi:type=&quot;xsd:schema_type_name&quot;/&gt;
  1865. &lt;/response&gt;
  1866. </pre>
  1867. <p>Using the map element, a language can map a specific data type
  1868. into something the IDE can handle in a more generic way. For
  1869. example, if a language supports both float and double, the IDE
  1870. does not necessarily need to distinguish between them (but MAY).</p>
  1871. <pre class="literal-block">
  1872. &lt;map type=&quot;float&quot;
  1873. name=&quot;float&quot;
  1874. xsi:type=&quot;xsd:float&quot;/&gt;
  1875. &lt;map type=&quot;float&quot;
  1876. name=&quot;double&quot;
  1877. xsi:type=&quot;xsd:double&quot;/&gt;
  1878. &lt;map type=&quot;float&quot;
  1879. name=&quot;real&quot;
  1880. xsi:type=&quot;xsd:decimal&quot;/&gt;
  1881. </pre>
  1882. <p>Complex types may be supported if an implementation wishes to. Any
  1883. implementation doing so should work without the other end having
  1884. support for this:</p>
  1885. <pre class="literal-block">
  1886. &lt;response command=&quot;typemap_get&quot;
  1887. transaction_id=&quot;transaction_id&quot;
  1888. xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
  1889. xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot;
  1890. xmlns:mytypes=&quot;http://mysite/myschema.xsd&quot;&gt;
  1891. &lt;map type=&quot;resource&quot;
  1892. name=&quot;SpecialDataType&quot;
  1893. xsi:type=&quot;mytypes:SpecialDataType&quot;/&gt;
  1894. &lt;/response&gt;
  1895. </pre>
  1896. </div>
  1897. </div>
  1898. <div class="section" id="property-get-property-set-property-value">
  1899. <h2><a class="toc-backref" href="#id57">7.13 property_get, property_set, property_value</a></h2>
  1900. <p>Gets/sets a property value. When retrieving a property with the
  1901. get method, the maximum data that should be returned is a default
  1902. defined by the debugger engine unless it has been negotiated using
  1903. feature_set with max_data. If the size of the properties data is
  1904. larger than that, the debugger engine only returns the configured
  1905. amount, and the IDE should call property_value to get the entire
  1906. data. This is to prevent large data from slowing down debugger
  1907. sessions. The IDE should implement UI that allows the user to
  1908. decide whether they want to retrieve all the data. The IDE should
  1909. not read more data than the length defined in the packet header.
  1910. The IDE can determine if there is more data by using the property
  1911. data length information. As per the context_get command, the depth
  1912. of nested elements returned is either defaulted by the debugger
  1913. engine, or negotiated using feature_set with max_children.</p>
  1914. <blockquote>
  1915. <table border="1" class="docutils">
  1916. <colgroup>
  1917. <col width="3%" />
  1918. <col width="97%" />
  1919. </colgroup>
  1920. <tbody valign="top">
  1921. <tr><td>-d</td>
  1922. <td>stack depth (optional, debugger engine should assume
  1923. zero if not provided)</td>
  1924. </tr>
  1925. <tr><td>-c</td>
  1926. <td>context id (optional, retrieved by context-names,
  1927. debugger engine should assume zero if not provided)</td>
  1928. </tr>
  1929. <tr><td>-n</td>
  1930. <td>property long name (required)</td>
  1931. </tr>
  1932. <tr><td>-m</td>
  1933. <td>max data size to retrieve (optional)</td>
  1934. </tr>
  1935. <tr><td>-t</td>
  1936. <td>data type (property_set only, optional)</td>
  1937. </tr>
  1938. <tr><td>-p</td>
  1939. <td>data page (property_get, property_value: optional for arrays,
  1940. hashes, objects, etc.; property_set: not required; debugger
  1941. engine should assume zero if not provided)</td>
  1942. </tr>
  1943. <tr><td>-k</td>
  1944. <td>property key as retrieved in a property element,
  1945. optional, used for property_get of children and
  1946. property_value, required if it was provided by the
  1947. debugger engine.</td>
  1948. </tr>
  1949. <tr><td>-a</td>
  1950. <td>property address as retrieved in a property element,
  1951. optional, used for property_set/value</td>
  1952. </tr>
  1953. </tbody>
  1954. </table>
  1955. </blockquote>
  1956. <p>IDE</p>
  1957. <pre class="literal-block">
  1958. property_get -n property_long_name -d {NUM} -i transaction_id
  1959. </pre>
  1960. <p>debugger engine</p>
  1961. <pre class="literal-block">
  1962. &lt;response command=&quot;property_get&quot;
  1963. transaction_id=&quot;transaction_id&quot;&gt;
  1964. &lt;property ... /&gt;
  1965. ...
  1966. &lt;/response&gt;
  1967. </pre>
  1968. <p>IDE</p>
  1969. <pre class="literal-block">
  1970. property_set -n property_long_name -d {NUM} -i transaction_id
  1971. -l data_length -- {DATA}
  1972. </pre>
  1973. <p>debugger engine</p>
  1974. <pre class="literal-block">
  1975. &lt;response command=&quot;property_set&quot;
  1976. success=&quot;0|1&quot;
  1977. transaction_id=&quot;transaction_id&quot;/&gt;
  1978. </pre>
  1979. <p>IDE</p>
  1980. <pre class="literal-block">
  1981. property_value -n property_long_name -d {NUM} -i transaction_id
  1982. </pre>
  1983. <p>debugger engine</p>
  1984. <pre class="literal-block">
  1985. &lt;response command=&quot;property_value&quot;
  1986. size=&quot;{NUM}&quot;
  1987. encoding=&quot;base64|none&quot;
  1988. transaction_id=&quot;transaction_id&quot;&gt;
  1989. ...data...
  1990. &lt;/response&gt;
  1991. </pre>
  1992. <p>When the encoding attribute is not present then the default value of &quot;none&quot;
  1993. is assumed.</p>
  1994. </div>
  1995. <div class="section" id="source">
  1996. <h2><a class="toc-backref" href="#id58">7.14 source</a></h2>
  1997. <p>The body of the request is the URI (retrieved from the stack info),
  1998. the body of the response is the data contents of the URI. If the
  1999. file uri is not provided, then the file for the current context
  2000. is returned.</p>
  2001. <blockquote>
  2002. <table border="1" class="docutils">
  2003. <colgroup>
  2004. <col width="3%" />
  2005. <col width="97%" />
  2006. </colgroup>
  2007. <tbody valign="top">
  2008. <tr><td>-b</td>
  2009. <td>begin line (optional)</td>
  2010. </tr>
  2011. <tr><td>-e</td>
  2012. <td>end line (optional)</td>
  2013. </tr>
  2014. <tr><td>-f</td>
  2015. <td>file URI</td>
  2016. </tr>
  2017. </tbody>
  2018. </table>
  2019. </blockquote>
  2020. <p>IDE</p>
  2021. <pre class="literal-block">
  2022. source -i transaction_id -f fileURI
  2023. </pre>
  2024. <p>debugger engine</p>
  2025. <pre class="literal-block">
  2026. &lt;response command=&quot;source&quot;
  2027. success=&quot;0|1&quot;
  2028. transaction_id=&quot;transaction_id&quot;&gt;
  2029. ...data source code...
  2030. &lt;/response&gt;
  2031. </pre>
  2032. </div>
  2033. <div class="section" id="stdout-stderr">
  2034. <h2><a class="toc-backref" href="#id59">7.15 stdout, stderr</a></h2>
  2035. <p>Body of the request is null, body of the response is true or false.
  2036. Upon receiving one of these redirect requests, the debugger engine
  2037. will start to copy data bound for one of these streams to the IDE,
  2038. using the message packets.</p>
  2039. <blockquote>
  2040. <table border="1" class="docutils">
  2041. <colgroup>
  2042. <col width="3%" />
  2043. <col width="97%" />
  2044. </colgroup>
  2045. <tbody valign="top">
  2046. <tr><td>-c</td>
  2047. <td><p class="first">[0|1|2] 0 - disable, 1 - copy data, 2 - redirection</p>
  2048. <pre class="last literal-block">
  2049. 0 (disable) stdout/stderr output goes to regular
  2050. place, but not to IDE
  2051. 1 (copy) stdout/stderr output goes to both regular
  2052. destination and IDE
  2053. 2 (redirect) stdout/stderr output goes to IDE only.
  2054. </pre>
  2055. </td>
  2056. </tr>
  2057. </tbody>
  2058. </table>
  2059. </blockquote>
  2060. <p>IDE</p>
  2061. <pre class="literal-block">
  2062. stdout -i transaction_id -c 1
  2063. </pre>
  2064. <p>debugger engine</p>
  2065. <pre class="literal-block">
  2066. &lt;response command=&quot;stdout&quot;
  2067. success=&quot;0|1&quot;
  2068. transaction_id=&quot;transaction_id&quot;/&gt;
  2069. </pre>
  2070. </div>
  2071. </div>
  2072. <div class="section" id="extended-commands">
  2073. <h1><a class="toc-backref" href="#id60">8. Extended Commands</a></h1>
  2074. <p>A IDE can query the debugger engine by using the feature_get command
  2075. (see above). The feature strings for extended commands defined in this
  2076. specification are the same as the command itself. For commands not
  2077. listed in this specification, the prefix is 'xcmd_name'. Vendor or language
  2078. specific commands may be prefixed with 'xcmd_vendorname_name'.</p>
  2079. <div class="section" id="stdin">
  2080. <h2><a class="toc-backref" href="#id61">8.1 stdin</a></h2>
  2081. <p>The stdin command has nearly the same arguments and responses as
  2082. stdout and stderr from the core commands (section 7). Since
  2083. redirecting stdin may be very difficult to support in some
  2084. languages, it is provided as an optional command. Uses for
  2085. this command would primarily be for remote console operations.</p>
  2086. <p>If an IDE wishes to redirect stdin, or cancel the stdin redirection,
  2087. then it must send the stdin command with the -c argument, without
  2088. any data. After the IDE has redirected stdin, it can send more
  2089. stdin commands with the data. Sending both the -c argument and
  2090. data in the same command is invalid.</p>
  2091. <p>If the IDE requests stdin, it will <em>always</em> be a redirection,
  2092. and the debugger engine must not accept stdin from any other
  2093. source. The debugger engine may choose to not allow stdin to be
  2094. redirected in certain situations (such as when running under
  2095. a web server).</p>
  2096. <blockquote>
  2097. <table border="1" class="docutils">
  2098. <colgroup>
  2099. <col width="3%" />
  2100. <col width="97%" />
  2101. </colgroup>
  2102. <tbody valign="top">
  2103. <tr><td>-c</td>
  2104. <td><p class="first">[0|1] 0 - disable, 1 - redirection</p>
  2105. <pre class="last literal-block">
  2106. 0 (disable) stdin is read from the regular place
  2107. 1 (redirect) stdin is read from stdin packets received
  2108. from the IDE.
  2109. </pre>
  2110. </td>
  2111. </tr>
  2112. </tbody>
  2113. </table>
  2114. </blockquote>
  2115. <p>IDE</p>
  2116. <pre class="literal-block">
  2117. stdin -i transaction_id -c 1
  2118. stdin -i transaction_id -- base64(data)
  2119. </pre>
  2120. <p>debugger engine</p>
  2121. <pre class="literal-block">
  2122. &lt;response command=&quot;stdin&quot;
  2123. success=&quot;0|1&quot;
  2124. transaction_id=&quot;transaction_id&quot;/&gt;
  2125. </pre>
  2126. </div>
  2127. <div class="section" id="break">
  2128. <h2><a class="toc-backref" href="#id62">8.2 break</a></h2>
  2129. <p>This command can be sent to interrupt the execution of the
  2130. debugger engine while it is in a 'run state'.</p>
  2131. <p>IDE</p>
  2132. <pre class="literal-block">
  2133. break -i transaction_id
  2134. </pre>
  2135. <p>debugger engine</p>
  2136. <pre class="literal-block">
  2137. &lt;response command=&quot;break&quot;
  2138. success=&quot;0|1&quot;
  2139. transaction_id=&quot;transaction_id&quot;/&gt;
  2140. </pre>
  2141. </div>
  2142. <div class="section" id="eval">
  2143. <h2><a class="toc-backref" href="#id63">8.3 eval</a></h2>
  2144. <p>Evaluate a given string within the current execution context. A
  2145. property element MAY be returned as a child element of the
  2146. response, but the IDE MUST NOT expect one. The string being evaluated
  2147. may be an expression or a code segment to be executed. Languages, such
  2148. as Python, which have separate statements for these, will need to handle
  2149. both appropriately. For implementations that need to be more explicit, use
  2150. the expr or exec commands below.</p>
  2151. <p>The eval and expr commands can include the following optional parameter:</p>
  2152. <blockquote>
  2153. <table border="1" class="docutils">
  2154. <colgroup>
  2155. <col width="3%" />
  2156. <col width="97%" />
  2157. </colgroup>
  2158. <tbody valign="top">
  2159. <tr><td>-p</td>
  2160. <td>data page: optional for arrays, hashes, objects, etc.; debugger
  2161. engine should assume zero if not provided — similar to the -p
  2162. parameter for property_get.</td>
  2163. </tr>
  2164. </tbody>
  2165. </table>
  2166. </blockquote>
  2167. <p>IDE</p>
  2168. <pre class="literal-block">
  2169. eval -i transaction_id -- {DATA}
  2170. </pre>
  2171. <p>debugger engine</p>
  2172. <pre class="literal-block">
  2173. &lt;response command=&quot;eval&quot;
  2174. success=&quot;0|1&quot;
  2175. transaction_id=&quot;transaction_id&quot;&gt;
  2176. &lt;property .../&gt;
  2177. &lt;/response&gt;
  2178. </pre>
  2179. <div class="section" id="expr">
  2180. <h3><a class="toc-backref" href="#id64">8.3.1 expr</a></h3>
  2181. <p>expr, short for expression, uses the same command and response as eval above,
  2182. except that it is limited to evaluating expressions. Only some languages
  2183. support this functionality. expr should always return a property element
  2184. if the expression is evaluated successfully. This command is specified for
  2185. those applications that may need to implement this specific functionality.
  2186. General uses of the protocol should not expect to find this command available,
  2187. and should rely on eval above.</p>
  2188. </div>
  2189. <div class="section" id="exec">
  2190. <h3><a class="toc-backref" href="#id65">8.3.2 exec</a></h3>
  2191. <p>exec, short for execute, uses the same command and response as eval above,
  2192. except that it is limited to executing code fragments. Only some languages
  2193. support this functionality. An IDE should not expect exec to return a value.
  2194. This command is specified for those applications that may need to implement
  2195. this specific functionality. General uses of the protocol should not expect
  2196. to find this command available, and should rely on eval above.</p>
  2197. </div>
  2198. </div>
  2199. <div class="section" id="spawnpoints">
  2200. <h2><a class="toc-backref" href="#id66">8.4 spawnpoints</a></h2>
  2201. <p>Spawnpoints are points in (currently Tcl) file where a new debug session
  2202. might (i.e. if this position is a point in the code where a new application
  2203. is created) get spawned when hit. Spawnpoints are treated much like a
  2204. different type of breakpoint: They share many of the same attributes as
  2205. breakpoints, using a <em>type==&quot;spawn&quot;</em> to distinguish themselves. Spawnpoints
  2206. have an equivalent set of commands. A failure in any spawnpoint commands
  2207. results in an error defined in <a class="reference internal" href="#debugger-engine-errors">section 6.5</a>.</p>
  2208. <p>The following DBGP commands relate to spawnpoints:</p>
  2209. <blockquote>
  2210. <table border="1" class="docutils">
  2211. <colgroup>
  2212. <col width="27%" />
  2213. <col width="73%" />
  2214. </colgroup>
  2215. <tbody valign="top">
  2216. <tr><td><a class="reference internal" href="#id6">spawnpoint_set</a></td>
  2217. <td>Set a new spawnpoint on the session.</td>
  2218. </tr>
  2219. <tr><td><a class="reference internal" href="#id7">spawnpoint_get</a></td>
  2220. <td>Get spawnpoint info for the given spawnpoint id.</td>
  2221. </tr>
  2222. <tr><td><a class="reference internal" href="#id8">spawnpoint_update</a></td>
  2223. <td>Update one or more attributes of a spawnpoint.</td>
  2224. </tr>
  2225. <tr><td><a class="reference internal" href="#id9">spawnpoint_remove</a></td>
  2226. <td>Remove the given spawnpoint on the session.</td>
  2227. </tr>
  2228. <tr><td><a class="reference internal" href="#id10">spawnpoint_list</a></td>
  2229. <td>Get a list of all of the session's spawnpoints.</td>
  2230. </tr>
  2231. </tbody>
  2232. </table>
  2233. </blockquote>
  2234. <p>A spawnpoint has the following attributes:</p>
  2235. <blockquote>
  2236. <table border="1" class="docutils">
  2237. <colgroup>
  2238. <col width="25%" />
  2239. <col width="75%" />
  2240. </colgroup>
  2241. <tbody valign="top">
  2242. <tr><td>type</td>
  2243. <td>always set to &quot;spawn&quot;</td>
  2244. </tr>
  2245. <tr><td>filename</td>
  2246. <td>The file the spawnpoint is effective in. This must be
  2247. a &quot;<a class="reference external" href="file://">file://</a>&quot; URI.</td>
  2248. </tr>
  2249. <tr><td>lineno</td>
  2250. <td>Line number on which spawnpoint is effective. Line
  2251. numbers are 1-based. If an implementation requires a
  2252. numeric value to indicate that <em>lineno</em> is not set,
  2253. it is suggested that -1 be used, although this is not
  2254. enforced.</td>
  2255. </tr>
  2256. <tr><td>state</td>
  2257. <td>Current state of the spawnpoint. This must be one of
  2258. <em>enabled</em>, <em>disabled</em>.</td>
  2259. </tr>
  2260. </tbody>
  2261. </table>
  2262. </blockquote>
  2263. <p>Spawnpoints should be maintained in the debugger engine at an application
  2264. level, not the thread level. Debugger engines that support thread debugging
  2265. MUST provide spawnpoint id's that are global for the application, and must
  2266. use all spawnpoints for all threads where applicable.</p>
  2267. <p>As for any other commands, if there is error the debugger engine should
  2268. return an error response as described in <a class="reference internal" href="#debugger-engine-errors">section 6.5</a>.</p>
  2269. <div class="section" id="id6">
  2270. <h3><a class="toc-backref" href="#id67">8.4.1 spawnpoint_set</a></h3>
  2271. <p>This command is used by the IDE to set a spawnpoint for the session.</p>
  2272. <p>IDE to debugger engine:</p>
  2273. <pre class="literal-block">
  2274. spawnpoint_set -i TRANSACTION_ID [&lt;arguments...&gt;]
  2275. </pre>
  2276. <p>where the arguments are:</p>
  2277. <blockquote>
  2278. <table border="1" class="docutils">
  2279. <colgroup>
  2280. <col width="25%" />
  2281. <col width="75%" />
  2282. </colgroup>
  2283. <tbody valign="top">
  2284. <tr><td>-f FILENAME</td>
  2285. <td>the <em>filename</em> to which the spawnpoint belongs
  2286. [optional]</td>
  2287. </tr>
  2288. <tr><td>-n LINENO</td>
  2289. <td>the line number (<em>lineno</em>) of the spawnpoint
  2290. [optional]</td>
  2291. </tr>
  2292. <tr><td>-s STATE</td>
  2293. <td>spawnpoint <em>state</em> [optional, defaults to &quot;enabled&quot;]</td>
  2294. </tr>
  2295. </tbody>
  2296. </table>
  2297. </blockquote>
  2298. <p>A unique id for this spawnpoint for this session is returned by the debugger
  2299. engine. This <em>session spawnpoint id</em> is used by the IDE to identify the
  2300. spawnpoint in other spawnpoint commands.</p>
  2301. <p>debugger engine to IDE:</p>
  2302. <pre class="literal-block">
  2303. &lt;response command=&quot;spawnpoint_set&quot;
  2304. transaction_id=&quot;TRANSACTION_ID&quot;
  2305. state=&quot;STATE&quot;
  2306. id=&quot;SPAWNPOINT_ID&quot;/&gt;
  2307. </pre>
  2308. <p>where,</p>
  2309. <blockquote>
  2310. <table border="1" class="docutils">
  2311. <colgroup>
  2312. <col width="25%" />
  2313. <col width="75%" />
  2314. </colgroup>
  2315. <tbody valign="top">
  2316. <tr><td>SPAWNPOINT_ID</td>
  2317. <td>is an arbitrary string that uniquely identifies this
  2318. spawnpoint in the debugger engine.</td>
  2319. </tr>
  2320. <tr><td>STATE</td>
  2321. <td>the initial state of the spawnpoint as set by the
  2322. debugger engine</td>
  2323. </tr>
  2324. </tbody>
  2325. </table>
  2326. </blockquote>
  2327. </div>
  2328. <div class="section" id="id7">
  2329. <h3><a class="toc-backref" href="#id68">8.4.2 spawnpoint_get</a></h3>
  2330. <p>This command is used by the IDE to get spawnpoint information from the
  2331. debugger engine.</p>
  2332. <p>IDE to debugger engine:</p>
  2333. <pre class="literal-block">
  2334. spawnpoint_get -i TRANSACTION_ID -d SPAWNPOINT_ID
  2335. </pre>
  2336. <p>where,</p>
  2337. <blockquote>
  2338. <table border="1" class="docutils">
  2339. <colgroup>
  2340. <col width="25%" />
  2341. <col width="75%" />
  2342. </colgroup>
  2343. <tbody valign="top">
  2344. <tr><td>SPAWNPOINT_ID</td>
  2345. <td>is the unique <em>session spawnpoint id</em> returned by
  2346. <em>spawnpoint_set</em>.</td>
  2347. </tr>
  2348. </tbody>
  2349. </table>
  2350. </blockquote>
  2351. <p>debugger engine to IDE:</p>
  2352. <pre class="literal-block">
  2353. &lt;response command=&quot;spawnpoint_get&quot;
  2354. transaction_id=&quot;TRANSACTION_ID&quot;&gt;
  2355. &lt;spawnpoint id=&quot;SPAWNPOINT_ID&quot;
  2356. state=&quot;STATE&quot;
  2357. filename=&quot;FILENAME&quot;
  2358. lineno=&quot;LINENO&quot;/&gt;
  2359. &lt;/response&gt;
  2360. </pre>
  2361. </div>
  2362. <div class="section" id="id8">
  2363. <h3><a class="toc-backref" href="#id69">8.4.3 spawnpoint_update</a></h3>
  2364. <p>This command is used by the IDE to update one or more attributes of a
  2365. spawnpoint that was already set on the debugger engine via <em>spawnpoint_set</em>.</p>
  2366. <p>IDE to debugger engine:</p>
  2367. <pre class="literal-block">
  2368. spawnpoint_update -i TRANSACTION_ID -d SPAWNPOINT_ID [&lt;arguments...&gt;]
  2369. </pre>
  2370. <p>where the arguments are as follows. Both arguments are optional, however
  2371. at least one should be provided. See <a class="reference internal" href="#id6">spawnpoint_set</a> for a description of
  2372. each option:</p>
  2373. <blockquote>
  2374. <table border="1" class="docutils">
  2375. <colgroup>
  2376. <col width="25%" />
  2377. <col width="75%" />
  2378. </colgroup>
  2379. <tbody valign="top">
  2380. <tr><td>-s STATE</td>
  2381. <td>&nbsp;</td>
  2382. </tr>
  2383. <tr><td>-n LINENO</td>
  2384. <td>&nbsp;</td>
  2385. </tr>
  2386. </tbody>
  2387. </table>
  2388. </blockquote>
  2389. <p>debugger engine to IDE:</p>
  2390. <pre class="literal-block">
  2391. &lt;response command=&quot;spawnpoint_update&quot;
  2392. transaction_id=&quot;TRANSACTION_ID&quot;/&gt;
  2393. </pre>
  2394. </div>
  2395. <div class="section" id="id9">
  2396. <h3><a class="toc-backref" href="#id70">8.4.4 spawnpoint_remove</a></h3>
  2397. <p>This command is used by the IDE to remove the given spawnpoint.</p>
  2398. <p>IDE to debugger engine:</p>
  2399. <pre class="literal-block">
  2400. spawnpoint_remove -i TRANSACTION_ID -d SPAWNPOINT_ID
  2401. </pre>
  2402. <p>debugger engine to IDE:</p>
  2403. <pre class="literal-block">
  2404. &lt;response command=&quot;spawnpoint_remove&quot;
  2405. transaction_id=&quot;TRANSACTION_ID&quot;/&gt;
  2406. </pre>
  2407. </div>
  2408. <div class="section" id="id10">
  2409. <h3><a class="toc-backref" href="#id71">8.4.5 spawnpoint_list</a></h3>
  2410. <p>This command is used by the IDE to get spawnpoint information for all
  2411. spawnpoints that the debugger engine has.</p>
  2412. <p>IDE to debugger engine:</p>
  2413. <pre class="literal-block">
  2414. spawnpoint_list -i TRANSACTION_ID
  2415. </pre>
  2416. <p>debugger engine to IDE:</p>
  2417. <pre class="literal-block">
  2418. &lt;response command=&quot;spawnpoint_list&quot;
  2419. transaction_id=&quot;TRANSACTION_ID&quot;&gt;
  2420. &lt;spawnpoint id=&quot;SPAWNPOINT_ID&quot;
  2421. state=&quot;STATE&quot;
  2422. filename=&quot;FILENAME&quot;
  2423. lineno=&quot;LINENO&quot;/&gt;
  2424. &lt;spawnpoint .../&gt;
  2425. ...
  2426. &lt;/response&gt;
  2427. </pre>
  2428. </div>
  2429. </div>
  2430. <div class="section" id="notifications">
  2431. <h2><a class="toc-backref" href="#id72">8.5 Notifications</a></h2>
  2432. <p>At times it may be desirable to recieve a notification from the debugger
  2433. engine for various events. This notification tag allows for some simple
  2434. data to be passed from the debugger engine to the IDE. Customized
  2435. implementations may add child elements for additional data.</p>
  2436. <p>As an example, this is usefull for handling STDIN. The debugger engine
  2437. interupts all STDIN reads, and when a read is done by the application, it sends
  2438. a notification to the IDE. The IDE is then able to do something to let the user
  2439. know the application is waiting for input, such as placing a cursor in the
  2440. debugger output window.</p>
  2441. <p>A new feature name is introduced: notify_ok. The IDE will call feature_set
  2442. with the notify_ok name and a TRUE value (1). This lets the debugger engine
  2443. know that it can send notifications to the IDE. If the IDE has not set this
  2444. value, or sets it to FALSE (0), then the debugger engine MUST NOT send
  2445. notifications to the IDE.</p>
  2446. <p>The debugger engine MUST NOT expect a notification to cause an IDE to behave
  2447. in any particular way, or even to be handled by the IDE at all.</p>
  2448. <p>A proxy may also use notifications, during a debug session, to let the IDE know
  2449. about events that happen in the proxy. To do this, the proxy will have to
  2450. listen for feature_set commands and keep track of the values set, as well as
  2451. passing them through to the debugger engine.</p>
  2452. <p>IDE initialization of notifications:</p>
  2453. <pre class="literal-block">
  2454. feature_set -i TRANSACTION_ID -n notify_ok -v 1
  2455. </pre>
  2456. <p>debugger engine notifications to IDE:</p>
  2457. <pre class="literal-block">
  2458. &lt;notify name=&quot;notification_name&quot;&gt;
  2459. TEXT_NODE or CDATA
  2460. &lt;custom.../&gt;
  2461. &lt;/notify&gt;
  2462. </pre>
  2463. <div class="section" id="standard-notifications">
  2464. <h3><a class="toc-backref" href="#id73">8.5.1 Standard Notifications</a></h3>
  2465. <p>The following list of notifications are standardized for the protocol. Other
  2466. notifications may be added by other implementations. It is suggested that
  2467. notification names not found in this document are preceeded with 'XXX' or some
  2468. similar tag as a means of preventing name conflicts when new notifications get
  2469. added to the protocol in the future.</p>
  2470. <blockquote>
  2471. <table border="1" class="docutils">
  2472. <colgroup>
  2473. <col width="12%" />
  2474. <col width="88%" />
  2475. </colgroup>
  2476. <thead valign="bottom">
  2477. <tr><th class="head">Name</th>
  2478. <th class="head">Description</th>
  2479. </tr>
  2480. </thead>
  2481. <tbody valign="top">
  2482. <tr><td>stdin</td>
  2483. <td>notification occurs when the debugger engine is about
  2484. to read the stdin pipe.</td>
  2485. </tr>
  2486. </tbody>
  2487. </table>
  2488. </blockquote>
  2489. </div>
  2490. </div>
  2491. <div class="section" id="interact-interactive-shell">
  2492. <h2><a class="toc-backref" href="#id74">8.6 interact - Interactive Shell</a></h2>
  2493. <p>The interact command allows an IDE to send chunks of code to be compiled and
  2494. executed by the debugger engine. While this is similar to the eval command,
  2495. it has a couple important differences.</p>
  2496. <p>First, it buffers code sent to it until a successful compile is achieved. The
  2497. buffering allows the IDE to send a line of code for each call to the interact
  2498. command, which reflects a user typing code into a console. Each line is joined
  2499. in the debugger engine with a newline character. As soon as a successful
  2500. compile happens, the code is run and any output returned to the IDE (via
  2501. stdout/stderr or otherwise).</p>
  2502. <p>Second, it returns a prompt string that can be used by the IDE as an input
  2503. prompt for the user.</p>
  2504. <p>The interact command can only be called during a break or interactive state.</p>
  2505. <p>The debugger engine implementation MAY also be designed to work in
  2506. and interactive-only mode, where there is no script being debugged, and
  2507. all code is received through the interact command. This allows the
  2508. protocol to be utilized for the purpose of a pure interactive shell
  2509. for the language.</p>
  2510. <p>Control characters should be sent in the data section of the command, and the
  2511. debugger engine should handle the control characters in a way that is expected
  2512. by the implementation. These characters can include Ctrl-C (KeyboardInterupt
  2513. in Python) and other such console like controls. The IDE should not expect
  2514. the debugger engine to handle control characters in any specific way.</p>
  2515. <p>The IDE can query the debugger engine for interact support using the
  2516. feature_get command.</p>
  2517. <p>The 'filename' in the stack for an interactive session should be '&lt;console&gt;'
  2518. or some other string to denote a console stack level.</p>
  2519. <p>The debugger engine is not required to enable debugging of code
  2520. received via the interact command, however it should provide access
  2521. to other information, such as the variables retrieved via context_get.</p>
  2522. <p>IDE to debugger engine:</p>
  2523. <pre class="literal-block">
  2524. interact -i TRANSACTION_ID -m mode -- base64(code)
  2525. </pre>
  2526. <p>where,</p>
  2527. <blockquote>
  2528. <table border="1" class="docutils">
  2529. <colgroup>
  2530. <col width="16%" />
  2531. <col width="84%" />
  2532. </colgroup>
  2533. <tbody valign="top">
  2534. <tr><td>-m mode</td>
  2535. <td>a mode of zero tells the interact command
  2536. to clear the buffer and any other state
  2537. that was maintained for previous interact
  2538. commands. The prompt attribute returned
  2539. should be an empty string.</td>
  2540. </tr>
  2541. </tbody>
  2542. </table>
  2543. </blockquote>
  2544. <p>debugger engine to IDE:</p>
  2545. <pre class="literal-block">
  2546. &lt;response command=&quot;interact&quot;
  2547. transaction_id=&quot;TRANSACTION_ID&quot;
  2548. status=&quot;STATUS_NAME&quot;
  2549. more=&quot;CONTINUE_FLAG&quot;
  2550. prompt=&quot;PROMPT&quot; /&gt;
  2551. </pre>
  2552. <p>where,</p>
  2553. <blockquote>
  2554. <table border="1" class="docutils">
  2555. <colgroup>
  2556. <col width="24%" />
  2557. <col width="76%" />
  2558. </colgroup>
  2559. <tbody valign="top">
  2560. <tr><td>STATUS_NAME</td>
  2561. <td>A valid status name from the list of
  2562. status names in section 7.1. A new name
  2563. is added specificaly for this command
  2564. which is 'interactive'. The interactive
  2565. status is returned unless the mode in the
  2566. command was zero, in which case the
  2567. status will be up to the debugger engine
  2568. (typically the last status before running
  2569. interact), or some error has occured
  2570. that causes a different status.</td>
  2571. </tr>
  2572. <tr><td>CONTINUE_FLAG</td>
  2573. <td>a boolean which is true if the interact
  2574. command requires more code to compile
  2575. successfully</td>
  2576. </tr>
  2577. <tr><td>PROMPT</td>
  2578. <td>a string containing the prompt for the
  2579. next line of code</td>
  2580. </tr>
  2581. </tbody>
  2582. </table>
  2583. </blockquote>
  2584. </div>
  2585. </div>
  2586. <div class="section" id="a-changelog">
  2587. <h1><a class="toc-backref" href="#id75">A. ChangeLog</a></h1>
  2588. <p>2012-03-29</p>
  2589. <ul class="simple">
  2590. <li>6 Clarified what &quot;Pythons Cmd module&quot; means for quoting values that contain
  2591. spaces.</li>
  2592. </ul>
  2593. <p>2010-01-20 - draft 17</p>
  2594. <ul class="simple">
  2595. <li>7.6 / 7.6.2 Added the missing &quot;expression&quot; argument to information that can
  2596. be stored for breakpoints, and returned through breakpoint_get.</li>
  2597. </ul>
  2598. <p>2009-12-30</p>
  2599. <ul class="simple">
  2600. <li>8.3 Added the -p parameter to eval and expr, to control which pages are
  2601. shown in case the returned property is an array, hash or object with more
  2602. than &quot;pagesize&quot; children.</li>
  2603. </ul>
  2604. <p>2007-07-14 - draft 16</p>
  2605. <ul class="simple">
  2606. <li>6.3 Fixed binary encoding comments regarding data.</li>
  2607. <li>6.3 Clarified that the transaction ID is supposed to be numerical.</li>
  2608. <li>6.5.1 Mention that error code three is also for &quot;invalid values to an
  2609. option&quot;.</li>
  2610. <li>7.2.1 Clarified encoding feature.</li>
  2611. <li>7.2.2 Clarified the supported attribute for feature_get.</li>
  2612. <li>7.6 Added missing required attribute &quot;filename&quot; to the &quot;conditional&quot;
  2613. breakpoint type.</li>
  2614. <li>7.6 Added missing &quot;dbgp:&quot; URI scheme to &quot;filename&quot; breakpoint option.</li>
  2615. <li>7.6.1 Added a comment that it is up to the engine on how to handle
  2616. duplicate breakpoints.</li>
  2617. <li>7.6.1 Clarified on how expression evaluations affect breakpoint activation.</li>
  2618. <li>7.6.4 Added Xdebug's practise of returning the deleted breakpoint's
  2619. information as an optional child element.</li>
  2620. <li>7.9 Clarified that the context's ID attributes are numerical.</li>
  2621. <li>7.11 Marked &quot;key&quot; and &quot;address&quot; attributes as &quot;optional</li>
  2622. <li>7.13 The -a option is not required if the address is provided. Implementation
  2623. of this option could possible allow reading at random memory addresses which
  2624. is a security issue.</li>
  2625. <li>7.13 Clarified on how the -p option is used.</li>
  2626. <li>8.5 Fixed feature_set command in example, it does not use command data, but
  2627. the -v option for specifying the value.</li>
  2628. </ul>
  2629. <p>2007-03-31</p>
  2630. <ul class="simple">
  2631. <li>7.6.1 Fixed breakpoint_set example and note that the breakpoint types
  2632. are listed above and not below.</li>
  2633. </ul>
  2634. <p>2006-01-24</p>
  2635. <ul class="simple">
  2636. <li>7.2.1 Added a description of the breakpoint_types feature.</li>
  2637. </ul>
  2638. <p>2006-01-23</p>
  2639. <ul class="simple">
  2640. <li>7.11 Clarified the behavior of paging regarding depths, and that
  2641. paging of arrays/objects/hashes is 0 based.</li>
  2642. <li>draft 15</li>
  2643. </ul>
  2644. <p>2004-11-03</p>
  2645. <ul class="simple">
  2646. <li>7.12.1 Added the 'undefined' type.</li>
  2647. </ul>
  2648. <p>2004-10-28</p>
  2649. <ul class="simple">
  2650. <li>6 Clarify encoding for data passed in commands with the -- option.</li>
  2651. <li>7.13 Clarify the default encoding for property values.</li>
  2652. </ul>
  2653. <p>2004-05-16</p>
  2654. <ul class="simple">
  2655. <li>5.3 add address and port attributes to the proxyinit element returned to the
  2656. ide by the proxy.</li>
  2657. </ul>
  2658. <p>2004-05-12</p>
  2659. <ul>
  2660. <li><dl class="first docutils">
  2661. <dt>7.2 reorganize the feature names, add a couple missing names</dt>
  2662. <dd><p class="first last">(supports_postmortem, show_hidden, notify_ok).</p>
  2663. </dd>
  2664. </dl>
  2665. </li>
  2666. </ul>
  2667. <p>2004-04-05</p>
  2668. <ul class="simple">
  2669. <li>8.5 New notification support</li>
  2670. <li>8.6 New interact command</li>
  2671. </ul>
  2672. <p>2004-02-20</p>
  2673. <ul class="simple">
  2674. <li>1.2 moved the change log to appendix A</li>
  2675. <li>5 massive reorganization of section 5</li>
  2676. <li>5.3 expanded description of proxies and just in time debugging.</li>
  2677. <li>5.4 expand description of multisession and multithreaded debugging.</li>
  2678. <li>7.2 A new feature name, breakpoint_languages, has been added. This option
  2679. is only required if the engine supports more than one language.</li>
  2680. <li>7.2 and 7.3 Remove crufty documentation that still referred to old binary
  2681. protocol information.</li>
  2682. <li>7.6.1 For conditional breakpoints the expression has been moved to the data
  2683. section of the command.</li>
  2684. <li>8.3 remove the length argument in the eval command, it is unnecessary.</li>
  2685. <li>8.3 be more explicit about how eval works, add 8.3.1 expr and 8.3.2 exec as
  2686. additional optional commands that can be used in special implementations.</li>
  2687. <li>8.4 Remove the 'delete' state, this was old and removed in breakpoints.</li>
  2688. </ul>
  2689. <p>2004-01-28</p>
  2690. <ul class="simple">
  2691. <li>7.8 Fix cmdbegin/end attributes for stack_get</li>
  2692. </ul>
  2693. <p>2004-01-09</p>
  2694. <ul class="simple">
  2695. <li>5.1 New DBGP_IDEKEY environment variable</li>
  2696. </ul>
  2697. <p>2004-01-07</p>
  2698. <ul class="simple">
  2699. <li>7.5 renamed the stop and kill commands to detach and stop, added
  2700. some clarification to the description of the commands.</li>
  2701. </ul>
  2702. <p>2003-12-16</p>
  2703. <ul class="simple">
  2704. <li>7.6, 8.4 re-write the breakpoint and spawnpoint sections to be clearer</li>
  2705. </ul>
  2706. <p>2003-12-09</p>
  2707. <ul class="simple">
  2708. <li>6.7 new section describing dbgp file protocol</li>
  2709. <li>7.6 better document breakpoints</li>
  2710. </ul>
  2711. <p>2003-12-05</p>
  2712. <ul class="simple">
  2713. <li>6 Change the deliminator for command data to '--'. This conforms to
  2714. standard getopt libraries.</li>
  2715. <li>7.11 remove the recursive attribute, if an IDE wants to handle
  2716. circular references, it can do so based on the address attribute if
  2717. the engine provides it.</li>
  2718. </ul>
  2719. <p>2003-12-02</p>
  2720. <ul class="simple">
  2721. <li>7.6 remove breakpoint_enable/disable, and add breakpoint_update
  2722. command. Enable/disable states are changed through breakpoint_update.</li>
  2723. <li>8.4 new (optional) spawnpoint commands</li>
  2724. </ul>
  2725. <p>2003-11-25</p>
  2726. <ul class="simple">
  2727. <li>7.6 Change the breakpoint <em>hits</em> and <em>ignore</em> attributes to <em>hit_count</em>,
  2728. <em>hit_value</em> and <em>hit_condition</em> to add functionality available in VS.NET
  2729. and to simplify usage. Also clarify some other breakpoint attribute legal
  2730. values.</li>
  2731. </ul>
  2732. <p>2003-11-24</p>
  2733. <ul class="simple">
  2734. <li>7.5 correct the stop command documentation, stop is 'detach', and
  2735. does not allow for continued interaction. Document how expressions
  2736. are returned from breakpoint_get.</li>
  2737. <li>7.8 correct old documentation on the stack element. Add new
  2738. attributes: where, cmdbegin, cmdlength. Provide further documentation
  2739. about all the attributes.</li>
  2740. </ul>
  2741. <p>2003-11-20</p>
  2742. <ul class="simple">
  2743. <li>5.1 better define session keys vs. ide key for proxy, document how
  2744. proxy works better.</li>
  2745. <li>7.6 better document attributes and hit option</li>
  2746. </ul>
  2747. <p>2003-11-18</p>
  2748. <ul class="simple">
  2749. <li>7.1 Clarify stopping and stopped states</li>
  2750. <li>7.5 Clarify the stop command</li>
  2751. <li>7.6 Remove 'temporary' as a status for breakpoints, make it an option
  2752. in the command line. Remove the 'function' breakpoint type, provide
  2753. two new types, 'call' and 'return'. Add 'hits' option to allow a
  2754. breakpoint to be ignored a number of times before being used.</li>
  2755. </ul>
  2756. <p>2003-11-12</p>
  2757. <ul class="simple">
  2758. <li>draft 12</li>
  2759. <li>Rest markup tweaks</li>
  2760. </ul>
  2761. <p>2003-11-09</p>
  2762. <ul class="simple">
  2763. <li>draft 11</li>
  2764. <li>7.12 new section inserted as 7.12. This section specifies common
  2765. data types, and how to map more specific data types to the the common
  2766. types.</li>
  2767. <li>7.11 two new optional attributes, classname and facet, that provide
  2768. additional hints to the IDE about the nature of the property. New
  2769. key attribute for language specific keys to properties.</li>
  2770. <li>6.5 new section, 6.5.1 for defining common error codes.</li>
  2771. </ul>
  2772. <p>2003-11-05</p>
  2773. <ul class="simple">
  2774. <li>spelling fixes</li>
  2775. <li>5.1 change proxy options</li>
  2776. <li>7.6 clarify breakpoint command options</li>
  2777. <li>7.12 fix old text about context names</li>
  2778. </ul>
  2779. <p>2003-10-15</p>
  2780. <ul class="simple">
  2781. <li>6 remove the first NULL in the command structure from IDE to debugger
  2782. engine. This makes dealing with those commands easier.</li>
  2783. <li>6.6 NEW File paths must be URI's.</li>
  2784. <li>7 source command returns the source for the current context if no
  2785. file uri is provided.</li>
  2786. <li>7 added sub-item numbering</li>
  2787. <li>7.1 clarify the status values</li>
  2788. <li>8 added sub-item numbering</li>
  2789. </ul>
  2790. <p>2003-10-09</p>
  2791. <ul class="simple">
  2792. <li>7 remove run_to, unnecessary</li>
  2793. <li>7 remove 'step', there is no generic step command</li>
  2794. <li>7 clarify continuation commands</li>
  2795. <li>7 clarify breakpoints</li>
  2796. </ul>
  2797. <p>2003-10-07</p>
  2798. <ul class="simple">
  2799. <li>more layout changes for reStructuredText</li>
  2800. </ul>
  2801. <p>2003-10-06</p>
  2802. <ul class="simple">
  2803. <li>reformat to <a class="reference external" href="http://docutils.sourceforge.net/spec/rst/reStructuredText.html">reStructuredText markup</a></li>
  2804. <li>6 clarify message packets</li>
  2805. <li>6.3 clarify command packets</li>
  2806. <li>7 clarify feature_get/set</li>
  2807. <li>7 allow error results on breakpoints if a type of breakpoint
  2808. is not supported by a debugger engine.</li>
  2809. <li>7 add recursive attribute to properties, and clarify the
  2810. address attribute and how recursive data is handled.</li>
  2811. <li>7,8 moved stdin to the optional commands section</li>
  2812. </ul>
  2813. <p>2003-10-02</p>
  2814. <ul class="simple">
  2815. <li>5.1 changed proxy error to be the same as that in 6.5</li>
  2816. <li>5.1 the IDE and proxy ports have been defined to 9000/9001</li>
  2817. <li>5.3 exclude protocol overhead from data size definition</li>
  2818. <li>6.2 changed typo 'stdin and stdout' to 'stdout and stderr'</li>
  2819. <li>6.5 changed error id to error code</li>
  2820. <li>7 removed comments on 'body' from the run commands</li>
  2821. <li>7 clarified 'source' command arguments to be optional</li>
  2822. <li>7 added 'disable' option to stdin/out/err commands</li>
  2823. <li>7 breakpoint arguments and types have been better defined since
  2824. not all arguments need to be required for all types</li>
  2825. <li>7 the expression breakpoint type has been removed since it is
  2826. covered by the conditional breakpoint type</li>
  2827. </ul>
  2828. <p>2003-09-30</p>
  2829. <ul class="simple">
  2830. <li>section numbers added, changes below are marked with the section
  2831. number</li>
  2832. <li>3 Terminology changed (frontend -&gt; IDE, backend -&gt; debugger engine)</li>
  2833. <li>5.1 added response packet from proxy to IDE when IDE issues the
  2834. proxyinit command.</li>
  2835. <li>5.1 the proxy now adds a proxyclientid to the init packet from
  2836. the debugger engine when it passes the packet through to the IDE.</li>
  2837. <li>5.1 the proxy must be able to send errors to the IDE, for instance,
  2838. if it looses the connection to the debugger engine.</li>
  2839. <li>5.1 the proxy must be able to send errors to the Debugger, for
  2840. instance, if it looses the connection to the IDE.</li>
  2841. <li>5.3 added new section to help better define feature negotiation
  2842. with feature_get/set commands.</li>
  2843. <li>6 packets have been better defined. This section has also been
  2844. reorganized.</li>
  2845. <li>6.2 the communication of packets has been rewritten.</li>
  2846. <li>7 feature_get/set have some modifications.</li>
  2847. <li>7 context_get and property_* commands have been modified to better
  2848. reflect negotiation of features using the feature_get/set commands.</li>
  2849. <li>7 property_* commands have been commented a bit more, and an
  2850. additional argument is available for paging arrays, etc.</li>
  2851. <li>7 The definition of the property tag has been modified</li>
  2852. <li>7 stdin command has been modified, the debugger engine may choose
  2853. to not redirect stdin.</li>
  2854. <li>7 status command modified to support the async state</li>
  2855. <li>7 source command now accepts begin and end line arguments for
  2856. retrieving only parts of a file.</li>
  2857. <li>7 stack_get now defines an enumeration for the stack</li>
  2858. <li>8 break command clarified so it can only be sent while the debugger
  2859. engine is in a run state.</li>
  2860. <li>8 eval can return a property as part of the response</li>
  2861. </ul>
  2862. </div>
  2863. </td>
  2864. <td>&nbsp;</td>
  2865. </tr>
  2866. <?php include "include/footer.php"; ?>