home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / dumptool.zip / SAMPLRPN.ZIP / traptid.rpn < prev    next >
Text File  |  1997-01-27  |  1KB  |  46 lines

  1. ;trapdump by Pid & Tid number
  2. ;Take a dump when a trap raises an exception for the user in a particular process
  3. ;
  4. major=255
  5. hmte=6 ;os2krnl
  6. ;
  7. minor=1
  8. opcode=0x55         ;push
  9. object=0xf          ;GA Merlin 9.023 ALLSTRICT Kernel
  10. offset=0x46daf      ;   _XCPTBuildR3DispatcherStack segment:offset
  11. ;
  12. push w,0xa0         ;Intercept traps in PID 0xa0 (got this from PSTAT)
  13. push w,0x30         ;Segment of TASKAREA (PTDA_InfoSeg)
  14. push w,0xffca       ;Offset of curent Pid in TASKAREA (PTDA_InfoSeg) 
  15. push wis            ;pid now a DWORD on rpn stack 
  16. sub                 ;compare
  17. jmp zn,chktid       ;go check tid if pid matches
  18. abort
  19. ;
  20. chktid:
  21. push w,0x01         ;Inercept traps in tid 0x01  
  22. push w,0x30         ; Segment of TASKAREA
  23. push w,0xffd0       ;Offset of curent Tid in TASKAREA (PTDA_InfoSeg)  
  24. push wis            ;tid now a DWORD on rpn stack 
  25. sub                 ;compare
  26. jmp zn,dump         ;go dump if tid matches
  27. abort
  28.  
  29. ;
  30. ; Note:
  31. ;
  32. ;
  33. ;dump: sysdump      ; remove semi-colon to acivate dump
  34. ;
  35. ;
  36. ;    the following code dumps the parameters on entry to _XcptbuildR3DispatcherStack
  37. ;    this is for debugging this trace program. Comment out to activate the dump.
  38. ;    
  39. dump:push eax
  40. push w,8
  41. push ss
  42. push esp
  43. push w,4
  44. add
  45. log mrs
  46.