Subversion Repositories Kolibri OS

Rev

Blame | Last modification | View Log | Download | RSS feed

  1. <html>
  2.        
  3. <head>
  4. <title>Sys. function 70</title>
  5. <text><b>KolibriOS Help</b></text>
  6. <text><a href="\help\soft_dev\sys_funct_main.html">[Back to list system function]</a></text>
  7. <text><a href="\help\sys_funct\f69_main.html">  [Previous page]</a></text>
  8. <text>  [Next page]</text>
  9. </br>
  10. <head>
  11.        
  12. <body>
  13. <h2>System function 68 - debugging.</h2>
  14. <text>A process can load other process as debugged by set of corresponding bit by call to subfunction 7 of function 70.</br>
  15. A process can have only one debugger; one process can debug some others. The system notifies debugger on events occuring with debugged process.</br> Messages are written to the buffer defined by subfunction 0.</br></text>
  16. <text>Format of a message:</br>
  17.   +0: dword: message code;</br>
  18.   +4: dword: PID of debugged process;</br>
  19.   +8: there can be additional data depending on message code.</br></br></text>
  20. <text>Message codes:</br>
  21.   1 = exception in addition dword-number of the exception is given process is suspended;</br>
  22.   2 = process has terminated comes at any termination: both through the system function -1, and at "murder" by any other process (including debugger itself);</br>
  23.   3 = debug exception int 1 = #DB in addition dword-image of the register DR6 is given: bits 0-3: condition of the corresponding breakpoint (set by subfunction 9) is satisfied bit 14: exception has occured because of the trace mode (flag TF is set TF) process is suspended.</br></br></text>
  24. <text>When debugger terminates, all debugged processes are killed. If debugger does not want this, it must previously detach by
  25. subfunction 3.</br></br></text>
  26. <text>All subfunctions are applicable only to processes/threads started from the current by function 70 with set debugging flag. Debugging of multithreaded programs is not supported yet.</br></br></text>
  27. <text>The full list of subfunctions:</br>
  28.   subfunction 0 - define data area for debug messages</br>
  29.   subfunction 1 - get contents of registers of debugged thread</br>
  30.   subfunction 2 - set contents of registers of debugged thread</br>
  31.   subfunction 3 - detach from debugged process</br>
  32.   subfunction 4 - suspend debugged thread</br>
  33.   subfunction 5 - resume debugged thread</br>
  34.   subfunction 6 - read from the memory of debugged process</br>
  35.   subfunction 7 - write to the memory of debugged process</br>
  36.   subfunction 8 - terminate debugged thread</br>
  37.   subfunction 9 - set/clear hardware breakpoint</br></text>
  38.  
  39. </body>
  40.  
  41. </html>