Subject: maxima debug feature? - or how to accomplish same
From: Richard Fateman
Date: Sun, 10 Oct 2010 07:04:03 -0700
Ray has given you some useful information, but here is some more...
On 10/10/2010 2:56 AM, Max B wrote:
>
> Hi,
>
> Thanks for Maxima - it is a great tool! :)
>
> I am curious about how it operates; function call tree etc. For
> example: identify the functions that are called when the user inputs
> '2+2;',
There are tools that will give you a complete database of all functions
called by other functions, but this is huge.
There is really no necessity to figure out by debugging which function
calls which other functions. It is quite
apparent from the code (at least the immediate calls), and there IS
some documentation that you can read.
Maxima is not like a previously unknown biological life form that you
must dissect and examine under a microscope
to understand.
> or 'collectterms(expand(sbs));'. Unfortunately, maxima is written in
> lisp and I can't seem to debug it.
It would be quite easy for you to learn enough lisp to understand
Maxima's basic organization.
You do not need "debug" it unless you find a bug.
> Tools with which I am familiar include gdb, the printf function, and
> the cpp macros __LINE__ etc.
>
> I do have the maxima-5.21.1 source code, and have managed to compile it.
It was probably unnecessary for you to compile it, since their is a
binary available for most
operating systems.
You may be confused by other systems in which one constructs separate
binary versions
which are "debug" and "production". This is not done in lisp systems
because you can
use debugging tools on the production system.
>
> I have resolved to insert lines of code like 'at line __LINE__ in
> function __FUNC__' (or similar) into the functions in which I am
> interested, but cannot discover the syntax of lisp that would allow me
> to announce watchpoints like printf.
This would easily be resolved if you read some documentation on lisp,
but aside from
that, most people do not do anything like this. Since much of lisp code
looks like
functions calling functions, most of the information about what is going
on is
revealed by seeing what functions are called with which arguments, and what
is returned.
If you want to do this, you can call the lisp TRACE function. So to see
what
the function simptimes does, you can type into the Maxima command line..
(%i10) ?trace(?simptimes);
There is also ?untrace()
The "?" prefix is to say that you mean the LISP name simptimes, not the
Maxima name simptimes.
Anyway, if you then type
(%i11) a*a;
you will see the trace.
What to trace?
check out
http://www.cs.berkeley.edu/~fateman/papers/simplifier.txt
>
> So in my desperation I thought to email this listserv to ask for help.
>
> Is there a not-for-public-release 'debug' version of the source code
> with this type of code present?
You have the only version you need.
Unfortunately, you and so many other people are used to using technology
based
on nasty programming languages and implementations, like C or Fortran.
Lisp is so much better in so many respects that the time you spend learning
about it should be a useful education.
Have fun.
>
> Thanks in advance,
> Max
>
>
>
>
>
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima