[m-rev.] Add a listing facility to mdb
Ralph Becket
rafe at cs.mu.OZ.AU
Tue Oct 25 14:43:14 AEST 2005
Ian MacLarty, Tuesday, 25 October 2005:
>
>
> On Sun, 23 Oct 2005, Ralph Becket wrote:
>
> > Ian MacLarty, Saturday, 22 October 2005:
> > > All the code in the browser directory is not traced, even in debug grades,
> > > so that shouldn't be a problem.
> >
> > Hmm, that's odd. I don't understand why I saw this problem then.
>
> Were you calling a library predicate like foldl? The library doesn't have
> tail recursion optimization in the debug grades, just the browser directory.
No, it was just a hand-coded loop calling io.read_char and switching on
the result.
> > > > +:- pragma foreign_type("C", c_file_ptr, "FILE *", [can_pass_as_mercury_type]).
> > >
> > > There's no need to define a new type, you can use io.output_stream.
> >
> > There is: a Mercury IO stream is not the same as a FILE *, which is what
> > MR_mdb_{out,err} are.
>
> Yes I see what you mean. The other debugger code, however, does just use
> io.output_stream and works fine. Not sure why yet -- I'll have to
> investigate further.
I would wager that's because the MercuryFile C type is a struct whose
first member is a FILE *. I'd say the code that passes a FILE * where a
MercuryFile is expected is in error.
-- Ralph
--------------------------------------------------------------------------
mercury-reviews mailing list
post: mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------
More information about the reviews
mailing list