Subversion Repositories Kolibri OS

Rev

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

  1. <html
  2. <head>
  3. <title>Sys. function 69</title>
  4. <text><b>KolibriOS Help</b></text>
  5. <text><a href="\help\soft_dev\sys_funct_main.html">[Back to list system function]</a></text>
  6. <text><a href="\help\sys_funct\f68_main.html">  [Previous page]</text>
  7. <text><a href="\help\sys_funct\f70_main.html">  [Next page]</a></text>
  8. </br>
  9. <head
  10. <body>
  11. <h2>System function 69 - debugging.</h2>
  12. <text>A process can load other process as debugged by set of corresponding bit by call to subfunction 7 of function 70.</br>
  13. 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>
  14. <text>Format of a message:</br>
  15.   +0: dword: message code;</br>
  16.   +4: dword: PID of debugged process;</br>
  17.   +8: there can be additional data depending on message code.</br></br>
  18. </text>
  19. <text>Message codes:</br>
  20.   1 = exception in addition dword-number of the exception is given process is suspended;</br>
  21.   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>
  22.   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>
  23. </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>
  26. </text>
  27. <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>
  28. </text>
  29. <text>The full list of subfunctions:</br>
  30.   subfunction 0 - define data area for debug messages</br>
  31.   subfunction 1 - get contents of registers of debugged thread</br>
  32.   subfunction 2 - set contents of registers of debugged thread</br>
  33.   subfunction 3 - detach from debugged process</br>
  34.   subfunction 4 - suspend debugged thread</br>
  35.   subfunction 5 - resume debugged thread</br>
  36.   subfunction 6 - read from the memory of debugged process</br>
  37.   subfunction 7 - write to the memory of debugged process</br>
  38.   subfunction 8 - terminate debugged thread</br>
  39.   subfunction 9 - set/clear hardware breakpoint</br></br>
  40. </text>
  41. <text>Value for register eax - 69 (SF_DEBUG).</br>
  42. Values for register ebx:</br>
  43. 0 - SSF_SET_MESSAGE_AREA - subfunction 0 - define data area fror debug messages.</br>
  44. 1 - SSF_GET_REGISTERS - subfunction 1 - Get contents of registers of debugged thread.</br>
  45. 2 - SSF_SET_REGISTERS - subfunction 2 - Set contents of registers of debugged thread.</br>
  46. 3 - SSF_DETACH - subfunction 3 - detach from debugged process.</br>
  47. 4 - SSF_SUSPEND - subfunction 4 - suspend debugged thread.</br>
  48. 5 - SSF_RESUME - subfunction 5 - resume debugged thread.</br>
  49. 6 - SSF_READ_MEMORY - subfunction 6 - read from memory of debugged process.<br>
  50. 7 - SSF_WRITE_MEMORY - subfunction 7 - write to memory of debugged process.</br>
  51. 8 - SSF_TERMINATE - subfunction 8 - terminate debugged thread.</br>
  52. 9 - SSF_DEFINE_BREAKPOINT - subfunction 9 - set/clear hardware breakpoint.
  53. </text>
  54. <text>created 23.08.2020 by Alex2003</text>
  55. </body>
  56. </html>