home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / gnu / gdb / bug / 917 < prev    next >
Encoding:
Text File  |  1992-07-29  |  2.0 KB  |  57 lines

  1. Newsgroups: gnu.gdb.bug
  2. Path: sparky!uunet!usc!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!traffic.den.mmc.com!kevin
  3. From: kevin@traffic.den.mmc.com (Kevin Rodgers)
  4. Subject: Re: Execution trace feature for gdb
  5. Message-ID: <1992Jul29.185752.23476@den.mmc.com>
  6. Sender: gnulists@ai.mit.edu
  7. Organization: Martin Marietta Western Internal Systems, Technical Operations
  8. References: <9207201607.AA02430@bugs.airs.com> 
  9. Distribution: gnu
  10. Date: Wed, 29 Jul 1992 18:57:52 GMT
  11. Approved: bug-gdb@prep.ai.mit.edu
  12. Lines: 43
  13.  
  14. In article <1992Jul28.114950.3647@ips.cs.tu-bs.de> neitzel@ips.CS.tu-bs.DE (Martin Neitzel) writes:
  15. >I just asked the same question about the "trace facility in the dbx
  16. >sense" three months ago and digged into the gdb source.
  17. >
  18. >I found out that this functionality would require more than, say, a
  19. >twenty line patch.  The framework for integrating "trace points" as
  20. >another variant of break and watchpoints points is there.  The new
  21. >"trace" commands set would nicely fit into it (arguments/syntax just
  22. >like "break" commands with lots of code reuse possible).  I'd estimate
  23. >that modifications would mainly concern about three modules.
  24.  
  25. I'd like to add that the gdb command language itself could provide the
  26. framework for integrating tracepoints, since:
  27.  
  28. (1) breakpoints can be specified by function name,
  29. (2) arbitrary gdb commands can be associated with any breakpoint with
  30.     the 'commands' command, and
  31. (3) there is a mechanism for defining new commands ('define').
  32.  
  33. If 'define' could take an argument, e.g. a function name, then 'trace'
  34. could be implemented something like:
  35.  
  36. define trace (function)
  37.     break $function
  38.     commands
  39.         silent
  40.         echo >
  41.         info frame
  42.         finish
  43.         echo <
  44.         info frame
  45.     end
  46. end
  47.  
  48. If 'define' is enhanced to accept arguments, it might be worthwhile to
  49. allow optional arguments, so that for instance 'trace' could take an
  50. optional 'if COND' clause that could be passed to 'break'.
  51. -- 
  52. Kevin Rodgers                kevin@traffic.den.mmc.com
  53. Martin Marietta MS A16401        (303) 790-3971
  54. 116 Inverness Dr. East
  55. Englewood CO 80112 USA            GO BUFFS!
  56.  
  57.