Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Diff of /sml/trunk/HISTORY
ViewVC logotype

Diff of /sml/trunk/HISTORY

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 672, Mon Jun 19 04:40:29 2000 UTC revision 686, Tue Jul 18 08:58:50 2000 UTC
# Line 13  Line 13 
13  Description:  Description:
14  ----------------------------------------------------------------------  ----------------------------------------------------------------------
15  Name: Matthias Blume  Name: Matthias Blume
16    Date: 2000/07/18 18:00:00 JST
17    Tag: blume-20000718-Version_110_29
18    Description:
19    
20    1. Updated src/compiler/TopLevel/main/version.sml to version 110.29
21    
22    2. Updated config/version to 110.29
23    
24    3. Updated config/srcarchiveurl
25    
26    3. New boot files!
27       ftp://ftp.cs.princeton.edu/pub/people/blume/sml/110.29-autofetch
28    
29    ----------------------------------------------------------------------
30    Name: Matthias Blume
31    Date: 2000/07/11 13:58:00 JST
32    Tag: blume-20000711-doctypo
33    Description:
34    
35    Fixed a few typos in CM manual.
36    
37    ----------------------------------------------------------------------
38    Name: Allen Leung
39    Date: 2000/06/15 00:38:00
40    Tag: leunga-20000704-sparc-x86
41    
42    1. x86 peephole improvement sp += k; sp -= k => nop  [from John]
43    2. fix to x86 RET bug [found by Dan Grossman]
44    3. sparc assembly bug fix for ticc instructions [found by Fermin]
45    
46       Affects c-- and moby only
47    
48    ----------------------------------------------------------------------
49    Name: Matthias Blume
50    Date: 2000/07/04 15:26:00
51    Tag: blume-20000704-trigger
52    Description:
53    
54    1. Improvements to CM manual.
55    2. SMLofNJ.Internals.BTrace.trigger reinstated as an alternative way
56       of getting a back-trace.  The function, when called, raises an
57       internal exception which explicitly carries the full back-trace history,
58       so it is unaffected by any intervening handle-raise pairs ("trivial"
59       or not).  The interactive loop will print that history once it arrives
60       at top level.
61       Short of having all exceptions implicitly carry the full history, the
62       recommended way of using this facility is:
63         - compile your program with instrumentation "on"
64         - run it, when it raises an exception, look at the history
65         - if the history is "cut off" because of some handler, go and modify
66           your program so that it explicitly calls BTrace.trigger
67         - recompile (still instrumented), and rerun; look at the full history
68    
69    ----------------------------------------------------------------------
70    Name: Matthias Blume
71    Date: 2000/07/03 15:36:00 JST
72    Tag: blume-20000702-manual
73    Description:
74    
75    Small corrections and updates to CM manual.
76    
77    ----------------------------------------------------------------------
78    Name: Matthias Blume
79    Date: 2000/06/29 16:04:00 JST
80    Tag: blume-20000629-yacctool
81    Description:
82    
83    Changes:
84    
85    1. Class "mlyacc" now takes separate arguments to pass options to
86       generated .sml- and .sig-files independently.
87    2. Corresponding CM manual updates.
88    3. BTrace module now also reports call sites.  (However, for loop clusters
89       it only shows from where the cluster was entered.)  There are associated
90       modifications to core.sml, internals.{sig,sml}, btrace.sml, and btimp.sml.
91    
92    ----------------------------------------------------------------------
93    Name: Matthias Blume
94    Date: 2000/06/27 16:51:00 JST
95    Tag: blume-20000627-noweb
96    Description:
97    
98    Changes:
99    
100     1. Implemented "subdir" and "witness" options for noweb tool.
101        This caused some slight internal changes in CM's tool implementation.
102     2. Fixed bug in "tool plugin" mechanism.  This is essentially cleaning
103        some remaining issues from earlier path anchor changes.
104     3. Updated CM manual accordingly.
105    
106     4. Changed implementation of back-tracing so that I now consider it
107        ready for prime-time.
108    
109        In particular, you don't have to explicitly trigger the back-trace
110        anymore.  Instead, if you are running BTrace-instrumented code and
111        there is an uncaught exception (regardless of whether or not it was
112        raised in instrumented code), the top-level evalloop will print
113        the back-trace.
114    
115        Features:
116    
117          - Instrumented and uninstrumented code work together seemlessly.
118            (Of course, uninstrumented code is never mentioned in actual
119             back-traces.)
120    
121          - Asymptotic time- and space-complexity of instrumented code is
122            equal to that of uninstrumented code.  (This means that
123            tail-recursion is preserved by the instrumentation phase.)
124    
125          - Modules whose code has been instrumented in different sessions
126            work together without problem.
127    
128          - There is no penalty whatsoever on uninstrumented code.
129    
130          - There is no penalty on "raise" expressions, even in
131            instrumented code.
132    
133        A potential bug (or perhaps it is a feature, too):
134    
135          A back-trace reaches no further than the outermost instrumented
136          non-trivial "raise".  Here, a "trivial" raise is one that is the
137          sole RHS of a "handle" rule.  Thus, back-traces reach trough
138    
139               <exp> handle e => raise e
140    
141          and even
142    
143               <exp> handle Foo => raise Bar
144    
145          and, of course, through
146    
147               <exp> handle Foo => ...
148    
149         if the exception was not Foo.
150    
151         Back-traces always reach right through any un-instrumented code
152         including any of its "handle" expressions, trivial or not.
153    
154       To try this out, do the following:
155    
156         - Erase all existing binfiles for your program.
157           (You may keep binfiles for those modules where you think you
158            definitely don't need back-tracing.)
159         - Turn on back-trace instrumentation:
160              SMLofNJ.Internals.BTrace.mode (SOME true);
161         - Recompile your program.  (I.e., run "CM.make" or "use".)
162         - You may now turn instrumentation off again (if you want):
163              SMLofNJ.Internals.BTrace.mode (SOME false);
164         - Run your program as usual.  If it raises an exception that
165           reaches the interactive toplevel, then a back-trace will
166           automatically be printed.  After that, the toplevel loop
167           will print the exception history as usual.
168    
169    ----------------------------------------------------------------------
170    Name: Matthias Blume
171    Date: 2000/06/26 09:56:46 JST
172    Tag: blume-20000626-setup
173    Description:
174    
175    CM: - setup-parameter to "sml" added; this can be used to run arbitrary
176          ML code before and after compiling a file (e.g., to set compiler
177          flags)
178    
179    Compiler: - improved btrace API (in core.sml, internals.{sig,sml})
180              - associated changes to btrace.sml (BTrace instrumentation pass)
181              - cleaner implementation of btimp.sml (BTrace tracing and report
182                module)
183    
184    CM manual: * new path encoding documented
185               * description of setup-parameter to "sml" added
186    
187    The biggest user-visible change to back-tracing is that it is no
188    longer necessary to compile all traced modules within the same
189    session.  (This was a real limitation.)
190    
191    ----------------------------------------------------------------------
192    Name: Matthias Blume
193    Date: 2000/06/24 12:40:00 JST
194    Tag: blume-20000624-startup
195    Description:
196    
197    Fixes startup slowdown problem.  (I was calling SrcPath.sync a _tad_
198    bit too often -- to put it mildly. :)
199    
200    ----------------------------------------------------------------------
201    Name: Matthias Blume
202    Date: 2000/06/23 18:20:00 JST
203    Tag: blume-20000623-btrace
204    Description:
205    
206    This updates adds a backtrace facility to aid programmers in debugging
207    their programs.  This involves the following changes:
208    
209    1. Module system/smlnj/init/core.sml (structure _Core) now has hooks for
210       keeping track of the current call stack.  When programs are compiled
211       in a special mode, the compiler will insert calls to these hooks
212       into the user program.
213       "Hook" means that it is possible for different implementations of
214       back-tracing to register themselves (at different times).
215    
216    2. compiler/MiscUtil/profile/btrace.sml implements the annotation phase
217       as an Absyn.dec->Absyn.dec rewrite.  Normally this phase is turned off.
218       It can be turned on using this call:
219         SMLofNJ.Internals.BTrace.mode (SOME true);
220       Turning it off again:
221         SMLofNJ.Internals.BTrace.mode (SOME false);
222       Querying the current status:
223         SMLofNJ.Internals.BTrace.mode NONE;
224       Annotated programs are about twice as big as normal ones, and they
225       run a factor of 2 to 4 slower with a dummy back-trace plugin (one
226       where all hooks do nothing).  The slowdown with a plugin that is
227       actually useful (such as the one supplied by default) is even greater,
228       but in the case of the default plugin it is still only an constant
229       factor (amortized).
230    
231    3. system/Basis/Implementation/NJ/internals.{sig,sml} have been augmented
232       with a sub-structure BTrace for controlling back-tracing.  In particular,
233       the above-mentioned function "mode" controls whether the annotation
234       phase is invoked by the compiler.  Another important function is
235       "trigger": when called it aborts the current execution and causes
236       the top-level loop to print a full back-trace.
237    
238    4. compiler/MiscUtil/profile/btimp.sml is the current default plugin
239       for back-tracing.  It keeps track of the dynamic call stack and in
240       addition to that it keeps a partial history at each "level" of that
241       stack.  For example, if a tail-calls b, b tail-calls c, and c tail-calls
242       d and b (at separate times, dynamically), then the report will show:
243    
244       GOTO   d
245             /c
246       GOTO  \b
247       CALL   a
248    
249       This shows that there was an initial non-tail call of a, then a
250       tail-call to b or c, looping behavior in a cluster of functions that
251       consist of b and c, and then a goto from that cluster (i.e., either from
252       b or from c) to d.
253    
254       Note that (depending on the user program) the amount of information
255       that the back-trace module has to keep track of at each level is bounded
256       by a constant.  Thus, the whole implementation has the same asymptotical
257       complexity as the original program (both in space and in time).
258    
259    5. compiler/TopLevel/interact/evalloop.sml has been modified to
260       handle the special exception SMLofNJ.Internals.BTrace.BTrace
261       which is raised by the "trigger" function mentioned above.
262    
263    Notes on usage:
264    
265    - Annotated code works well together with unannotated code:
266    Unannotated calls simply do not show up at all in the backtrace.
267    
268    - It is not a good idea to let modules that were annotated during
269    different sessions run at the same time.  This is because the compiler
270    chooses small integers to identify individual functions, and there
271    will be clashes if different modules were compiled in separate sessions.
272    (Nothing will crash, and you will even be told about the clashes, but
273    back-trace information will in general not be useful.)
274    
275    - Back-tracing can be confused by callcc and capture.
276    
277    - The only way of getting a back-trace right now is to explicitly
278    invoke the "trigger" function from your user program.  Eventually, we
279    should make every exception carry back-trace information (if
280    available).  But since this creates more overhead at "raise"-time
281    (similar to the current exnHistory overhead), I have not yet
282    implemented this.  (The implementation will be rather easy.)  With
283    exceptions carrying back-trace information, this facility will be even
284    more useful because users don't need to modify their programs...
285    
286    - While it is possible to compile the compiler with back-trace
287    annotations turned on (I did it to get some confidence in
288    correctness), you must make absolutely sure that core.sml and
289    btimp.sml are compiled WITHOUT annotation!  (core.sml cannot actually
290    be compiled with annotation because there is no core access yet, but
291    if you compile btimp.sml with annotation, then the system will go into
292    an infinite recursion and crash.)
293    Since CM currently does not know about BTrace, the only way to turn
294    annotations on and off for different modules of the compiler is to
295    interrupt CMB.make, change the settings, and re-invoke it.  Of course,
296    this is awkward and clumsy.
297    
298    Sample sessions:
299    
300    Standard ML of New Jersey v110.28.1 [FLINT v1.5], June 5, 2000
301    - SMLofNJ.Internals.BTrace.mode (SOME true);
302    [autoloading]
303    [autoloading done]
304    val it = false : bool
305    - structure X = struct
306    -     fun main n = let
307    -         fun a (x, 0) = d x
308    -           | a (x, n) = b (x, n - 1)
309    -         and b (x, n) = c (x, n)
310    -         and c (x, n) = a (x, n)
311    -         and d x = e (x, 3)
312    -         and e (x, 0) = f x
313    -           | e (x, n) = e (x, n - 1)
314    -         and f 0 = SMLofNJ.Internals.BTrace.trigger ()
315    -           | f n = n * g (n - 1)
316    -         and g n = a (n, 3)
317    -     in
318    -         f n
319    -     end
320    - end;
321    structure X : sig val main : int -> int end
322    - X.main 3;
323    *** BACK-TRACE ***
324    GOTO   stdIn:4.2-13.20: X.main[2].f
325    GOTO-( stdIn:4.2-13.20: X.main[2].e
326    GOTO   stdIn:4.2-13.20: X.main[2].d
327         / stdIn:4.2-13.20: X.main[2].a
328         | stdIn:4.2-13.20: X.main[2].b
329    GOTO-\ stdIn:4.2-13.20: X.main[2].c
330    CALL   stdIn:4.2-13.20: X.main[2].g
331    GOTO   stdIn:4.2-13.20: X.main[2].f
332    GOTO-( stdIn:4.2-13.20: X.main[2].e
333    GOTO   stdIn:4.2-13.20: X.main[2].d
334         / stdIn:4.2-13.20: X.main[2].a
335         | stdIn:4.2-13.20: X.main[2].b
336    GOTO-\ stdIn:4.2-13.20: X.main[2].c
337    CALL   stdIn:4.2-13.20: X.main[2].g
338    GOTO   stdIn:4.2-13.20: X.main[2].f
339    GOTO-( stdIn:4.2-13.20: X.main[2].e
340    GOTO   stdIn:4.2-13.20: X.main[2].d
341         / stdIn:4.2-13.20: X.main[2].a
342         | stdIn:4.2-13.20: X.main[2].b
343    GOTO-\ stdIn:4.2-13.20: X.main[2].c
344    CALL   stdIn:4.2-13.20: X.main[2].g
345    GOTO   stdIn:4.2-13.20: X.main[2].f
346    CALL   stdIn:2.15-17.4: X.main[2]
347    -
348    
349    (Note that because of a FLINt bug the above code currently does not
350    compile without BTrace turned on.)
351    
352    Here is another example, using my modified Tiger compiler:
353    
354    Standard ML of New Jersey v110.28.1 [FLINT v1.5], June 5, 2000
355    - SMLofNJ.Internals.BTrace.mode (SOME true);
356    [autoloading]
357    [autoloading done]
358    val it = false : bool
359    - CM.make "sources.cm";
360    [autoloading]
361    ...
362    [autoloading done]
363    [scanning sources.cm]
364    [parsing (sources.cm):parse.sml]
365    [creating directory CM/SKEL ...]
366    [parsing (sources.cm):tiger.lex.sml]
367    ...
368    [wrote CM/sparc-unix/semant.sml]
369    [compiling (sources.cm):main.sml]
370    [wrote CM/sparc-unix/main.sml]
371    [New bindings added.]
372    val it = true : bool
373    - Main.compile ("../testcases/merge.tig", "foo.out");
374    *** BACK-TRACE ***
375    CALL   lib/semant.sml:99.2-396.21: SemantFun[2].transExp.trvar
376    CALL   lib/semant.sml:99.2-396.21: SemantFun[2].transExp.trexp
377    CALL   lib/semant.sml:289.3-295.22: SemantFun[2].transExp.trexp.check[2]
378    GOTO   lib/semant.sml:289.3-295.22: SemantFun[2].transExp.trexp.check[2]
379    CALL   lib/semant.sml:99.2-396.21: SemantFun[2].transExp.trexp
380    CALL   lib/semant.sml:99.2-396.21: SemantFun[2].transExp.trexp
381    CALL   lib/semant.sml:488.3-505.6: SemantFun[2].transDec.trdec[2].transBody[2]
382         / lib/semant.sml:411.65-543.8: SemantFun[2].transDec
383    CALL-\ lib/semant.sml:413.2-540.9: SemantFun[2].transDec.trdec[2]
384    CALL   lib/semant.sml:99.2-396.21: SemantFun[2].transExp.trexp
385    CALL   lib/semant.sml:8.52-558.4: SemantFun[2].transProg[2]
386    CALL   main.sml:1.18-118.4: Main.compile[2]
387    -
388    
389    ----------------------------------------------------------------------
390    Name: Matthias Blumen
391    Date: 2000/06/21 18:00:00 JST
392    Tag: blume-20000621-manual
393    Description:
394    
395    CM manual update: Path environments documented.
396    
397    ----------------------------------------------------------------------
398    Name: Matthias Blume
399  Date: 2000/06/19 13:40:00  Date: 2000/06/19 13:40:00
400  Tag: blume-20000619-manual  Tag: blume-20000619-manual
401  Description:  Description:

Legend:
Removed from v.672  
changed lines
  Added in v.686

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0