home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Demos / OOFILE / docs / debug.txt < prev    next >
Encoding:
Text File  |  1995-09-28  |  2.5 KB  |  60 lines  |  [TEXT/ttxt]

  1. SmartHeap
  2. If you use MicroQuill's SmartHeap product then defining OOF_SmartHeap
  3. will include smrtheap.hpp and perform pool validation at selected points
  4. to aid in detecting bugs such as memory overwrites. This runs a LOT
  5. slower but provides a high degree of assurance.
  6.  
  7.  
  8. OOF Debug Notes
  9.  
  10. -=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  11. OVERVIEW
  12.  
  13. OOF_Debug is a flag, that will turn on debugging modes within OOFILE. These are
  14. in the nature of development-time checks and should not be left in released
  15. applications! However, the errors they trigger will be handled by the standard
  16. error handler (dbConnect::raise), so you could theoretically cope with them
  17. yourself. Most of the OOF_Debug errors are programmer errors, and it should not
  18. be relied on as (say) a range-checking recovery mechanism.
  19.  
  20.  
  21. -=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  22. CATCHING MISSING PARENS ON RELATED FIELDS
  23. We use operator() on fields at the end of a relation chain to force immediate
  24. evaluation of the relation chain (which has been stashed in a global variable).
  25.  
  26. The danger exists that the user can forget these parents. ie:
  27. People.Visits->Date() vs
  28. People.Visits->Date    // whoops!
  29.  
  30. The latter Date field would come from the current selection in Visits, not
  31. People->Visits.
  32.  
  33. Every operation on a field checks to see if the chain setup by Visits-> has 
  34. been consumed, and triggers an error at that point - immediately after the 
  35. failure to include the paren, so it should be easy to spot.
  36.  
  37.  
  38. -=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  39. OVERRUNS ON OOF_DICTIONARY
  40. If you write to an unallocated cell that is more than one past the previous
  41. high point (ie: not just an append) then OOF_DictRep::operator[](long) will
  42. report the error. This catches problems such as incorrect copying of objects 
  43. (mainly our mistakes) or scrambling memory so that the index being used on
  44. the dictionary is a ridiculous value.
  45.  
  46.  
  47. -=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  48. RANGE ERRORS ON NUMERIC FIELDS
  49. Conversion from a double to a long, or short and conversion from a long to a 
  50. short are range-checked when the fields are assigned a value.
  51.  
  52.  
  53. -=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  54. INAPPROPRIATE ACTIONS LOCKED
  55. Attempting to add a record while read-locked will raise an error
  56.  
  57. Attempts to set a read lock whilst write-locked and vice versa will raise
  58. an error, as will failing to match the number of ApplyLock calls to 
  59. ReleaseLock's.
  60.