Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: profile.do


From   "Sergiy Radyakin" <serjradyakin@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: profile.do
Date   Fri, 15 Feb 2008 14:59:30 -0500

On 2/15/08, Nick Winter <nwinter@virginia.edu> wrote:
> i'll note that -set trace on- act the same way, which means you can turn
> on tracing at a mid-point in your program (just before the point you are
> debugging), and Stata will *not* continue to display trace output after
> the program ends.

And in light of that, it would be very desirable to let "set
tracedepth" to accept negative values, to allow debugging the caller,
after a particular event occured in the procedure being called.

E.g. program A calls program B calls program C
(let's think of them as very non-linear in terms of commands flow)

I want to be able to "set trace -1" in C, to allow tracing B if a
particular event occured in C (e.g. file not found in C, or invalid
value of an argument is received).

Ideally I would want even to scroll back and see the history of what
happened before the call. (i.e. trace's output is suppressed, until a
certain moment, but then, say after a critical stop, the last n lines
become visible) -- with all that output generated by trace, it can be
that some parts of the code can be inaccessible because they are so
deep in the code, that it takes long minutes/hours to trace the
programs till we get there, and turning in conditional tracing is not
possible, because we don't know where the problem is in the first
place.

Best Regards,
   Sergiy Radyakin



>
> This was a change (around Stata 8??).
>
> --NW
>
> n j cox wrote:
> > I would put it differently. You can include
> >
> > set more off
> >
> > in a do-file but it doesn't have a persistent effect. It only operates
> > until the end of the do file. This is generic to do files, and beyond.
> > Experiments with something like
> >
> > * --------------------------- setmoreoff.do
> > set more off
> > * ---------------------------
> >
> > clear
> > set obs 1000
> > do setmoreoff
> > gen id = _n
> > l
> >
> > will show that the do-file does nothing that persists beyond its own
> > termination. Adding -, permanently- makes no difference to that as far
> > as I can tell. At this moment I don't have access to a manual, so I
> > can't see if the manual says more than the help on this detail.
> >
> > I surmise that the rationale for this behaviour is that it is more
> > likely to be what you really want than the opposite. -set more off- is
> > usually for here and now, and temporarily. That means, _within_ a
> > program, do file (including code currently in do file editor) or
> > interactive session, but not beyond.
> >
> > Nick
> > n.j.cox@durham.ac.uk
> >
> > David Jacobs <jacobs.184@sociology.osu.edu>
> >
> > Stata deliberately does not let users alter the set more off command
> > in the profile.do file although I can't remember why.
> >
> > Dave
> >
> >  >I'm using Stata 9 and I made a profile.do file so that when Stata opens
> >  >it sets the mem to 500m and sets more off.  I see that the little do
> >  >file runs every time Stata opens, but it does not set more off.  Does
> >  >anybody have any idea why?  Here is what is in the profile.do file.
> >  >
> >  >set more off
> >  >set memory 500m
> >  >
> >  >and here is how I know it is actually running.  This is the message I
> >  >get now whenever I start Stata:
> >  >Notes:
> >  >       1.  (/m# option or -set memory-) 10.00 MB allocated to data
> >  >       2.  (/v# option or -set maxvar-) 5000 maximum variables
> >  >
> >  >
> >  >running C:\Program Files\Stata9\profile.do ...
> >
> > *
> > *   For searches and help try:
> > *   http://www.stata.com/support/faqs/res/findit.html
> > *   http://www.stata.com/support/statalist/faq
> > *   http://www.ats.ucla.edu/stat/stata/
>
> --
> --------------------------------------------------------------
> Nicholas Winter                                 434.924.6994 t
> Assistant Professor                             434.924.3359 f
> Department of Politics                  nwinter@virginia.edu e
> University of Virginia          faculty.virginia.edu/nwinter w
> PO Box 400787, 100 Cabell Hall
> Charlottesville, VA 22904
>
> *
> *   For searches and help try:
> *   http://www.stata.com/support/faqs/res/findit.html
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/
>
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index