home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / sys / amiga / programm / 18490 < prev    next >
Encoding:
Text File  |  1993-01-11  |  2.9 KB  |  74 lines

  1. Newsgroups: comp.sys.amiga.programmer
  2. Path: sparky!uunet!gatech!concert!sas!mozart.unx.sas.com!walker
  3. From: walker@twix.unx.sas.com (Doug Walker)
  4. Subject: Re: Programming is getting painful!
  5. Originator: walker@twix.unx.sas.com
  6. Sender: news@unx.sas.com (Noter of Newsworthy Events)
  7. Message-ID: <C0p0Fq.CD9@unx.sas.com>
  8. Date: Mon, 11 Jan 1993 14:04:37 GMT
  9. References: <C0IwoG.7ow@usenet.ucs.indiana.edu> <C0JIKp.I6D@unx.sas.com> <1993Jan9.200742.11858@polaris.utu.fi>
  10. Nntp-Posting-Host: twix.unx.sas.com
  11. Organization: SAS Institute Inc.
  12. Lines: 60
  13.  
  14.  
  15. In article <1993Jan9.200742.11858@polaris.utu.fi>, sutela@polaris.utu.fi (Kari Sutela) writes:
  16. |> walker@twix.unx.sas.com (Doug Walker) writes:
  17. |> 
  18. |> >Version 6.x, the CPR debugger will automatically use enforcer to
  19. |> >stop your program at the location that is causing the enforcer hit;
  20. |> 
  21. |> Now that you mention it: Is there any other way to proceed than "jump"
  22. |> over the statement which caused the hit?  I saw no mention of this
  23. |> feature in the documentation (the readme files mention it briefly).  A
  24. |> very nice feature, though.
  25.  
  26. When you get an Enforcer hit, something has gone wrong and invalid
  27. memory is being addressed.  If you simply attempt to continue, you
  28. will probably hit the same situation again, since the registers 
  29. will not have changed.  You can fix up the Enforcer hit by modifying 
  30. registers using the SET or REGISTER commands.  For example, let's say
  31. the following instruction generates an Enforcer hit:
  32.  
  33.    MOVE.L D0,(A0)
  34.  
  35. where register A0 contains a zero (or some other invalid address.)
  36. You can fix it by modifying register A0 with the REGISTER or SET
  37. commands so that it points to valid memory.  You can even do this
  38. with a macro, as shown below.  (For this example, assume that A0
  39. is supposed to be the address of the variable 'x', but somehow you
  40. forgot to set it in your code):
  41.  
  42.    break $ {register A0 = &x; go}
  43.    register A0 = &x
  44.    go
  45.  
  46. The $ says to set the breakpoint at the current location.  When the
  47. breakpoint is hit, register A0 will be set to the address of the
  48. variable 'x' and execution will continue.  The next two statements
  49. set A0 for this occurrence and continue.
  50.  
  51. Of course, the same thing applies to the JUMP command:
  52.  
  53.    break $ {jump nn; go}
  54.    jump 0xADDRESS
  55.    go
  56.  
  57. There is also one further thing you can do:  turn off Enforcer for
  58. the remainder of the CPR session.  If you disable Enforcer, the
  59. Enforcer hits won't be generated and CPR won't catch them.  Use
  60. a CPR AREXX macro or go to an external CLI to disable Enforcer.
  61.  
  62. |> 
  63. |> -- 
  64. |> Kari Sutela    sutela@utu.fi
  65. -- 
  66.   *****
  67. =*|_o_o|\\=====Doug Walker, Software Distiller====== BBS: (919)460-7430 =
  68.  *|. o.| ||                                          1200/2400/9600 Dual
  69.   | o  |//     For all you do, this bug's for you!
  70.   ====== 
  71. usenet: walker@unx.sas.com                            bix: djwalker 
  72. Any opinions expressed are mine, not those of SAS Institute, Inc.
  73.  
  74.