Subversion Repositories HelenOS

Rev

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

  1. /** @addtogroup sctrace
  2.  * @{
  3.  */
  4. /** @file
  5.  */
  6.  
  7. #include <stdio.h>
  8. #include <syscall.h>
  9. #include <ipc/ipc.h>
  10. #include <async.h>
  11. #include <udebug.h>
  12.  
  13. #include "debug_api.h"
  14.  
  15. int debug_begin(unsigned phoneid)
  16. {
  17.     return async_req_1_0(phoneid, IPC_M_DEBUG_ALL, UDEBUG_M_BEGIN);
  18. }
  19.  
  20. int debug_end(unsigned phoneid)
  21. {
  22.     return async_req_1_0(phoneid, IPC_M_DEBUG_ALL, UDEBUG_M_END);
  23. }
  24.  
  25. int debug_thread_read(unsigned phoneid, void *buffer, unsigned n,
  26.     unsigned *copied, unsigned *needed)
  27. {
  28.     return async_req_3_2(phoneid, IPC_M_DEBUG_ALL, UDEBUG_M_THREAD_READ,
  29.         (sysarg_t)buffer, n, copied, needed);
  30. }
  31.  
  32. int debug_mem_read(unsigned phoneid, void *buffer, unsigned addr, unsigned n)
  33. {
  34.     return async_req_4_0(phoneid, IPC_M_DEBUG_ALL, UDEBUG_M_MEM_READ,
  35.         (sysarg_t)buffer, addr, n);
  36. }
  37.  
  38. int debug_args_read(unsigned phoneid, unsigned tid, unsigned *buffer)
  39. {
  40.     return async_req_3_0(phoneid, IPC_M_DEBUG_ALL, UDEBUG_M_ARGS_READ,
  41.         tid, (sysarg_t)buffer);
  42. }
  43.  
  44. int debug_go(unsigned phoneid, unsigned tid, unsigned *ev_type,
  45.     unsigned *sc_id, unsigned *sc_rc)
  46. {
  47.     /* Run thread until a syscall is executed */
  48.     return async_req_2_3(phoneid, IPC_M_DEBUG_ALL, UDEBUG_M_GO,
  49.         tid, (sysarg_t)ev_type, (sysarg_t)sc_id, (sysarg_t)sc_rc);
  50. }
  51.  
  52. /** @}
  53.  */
  54.