[m-dev.] logging proposal

Ian MacLarty maclarty at cs.mu.OZ.AU
Sun Mar 19 23:42:51 AEDT 2006


On 3/19/06, Mark Brown <mark at cs.mu.oz.au> wrote:
> On 19-Mar-2006, Ian MacLarty <maclarty at cs.mu.OZ.AU> wrote:
> > On 3/19/06, Mark Brown <mark at cs.mu.oz.au> wrote:
> > > On 19-Mar-2006, Julien Fischer <juliensf at cs.mu.OZ.AU> wrote:
> > > > But then how much latitude is the compiler going to have to optimize code
> > > > containing debug goals?
> > >
> > > Good question.  The strictness of mdb's events is determined by the
> > > `--trace-optimized' option.  Perhaps we shohuld go by this or something
> > > similar.
> > >
> > > I think that, as with the current debug events, users would expect their
> > > debugging goals to be strict.  If they want to observe the optimized version
> > > of their program they can ask for it with a compiler option.
> > >
> >
> > I'm not really following this part of the discussion.  What's the
> > issue here?
>
> Sometimes it is more helpful to observe the unoptimized version of your
> program to figure out why it is misbehaving, and sometimes it is more
> helpful to observe the optimized version.  Mdb provides both, with the
> former being default and the latter being selected by the
> `--trace-optimized' option.  We will also provide both with this feature,
> since the user can get the unoptimized version with `-O-1', for example,
> or the optimized version with `-O5' and maybe `--trace-optimized'.
>
> So I guess the issue is what the default should be: optimized or
> unoptimized.  That is, should the trace level (or whatever) that selects
> these events affect the set of optimizations that are done, like
> `--trace deep' does?
>
> > If the trace goals are enabled then they cannot be
> > optimized away or reordered in the predicate they appear in.  If the
> > predicate the trace goal appears in is optimized away by the compiler,
> > then it is equivalent to true in the semantics of the object code and
> > why would anyone write a pure predicate always equivalent to true?
>
> They may have done so unwittingly.  Garbage-In-Garbage-Out is never a
> good foundation for debugging tools -- people who write garbage are the
> ones who will need debugging the most.  ;-)
>
> Having said that, I don't feel strongly either way what the default
> behaviour should be.
>

It's clearer now.  I guess the best default depends on what you're
doing - if you're profiling then you probably want optimizations on,
if you're debugging then you want them off.  So I think the
optimization level should be independent, but I also don't feel
strongly either way.

Ian.

--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list