Maple Professional
Maple Academic
Maple Student Edition
Maple Personal Edition
Maple Player
Maple Player for iPad
MapleSim Professional
MapleSim Academic
Maple T.A. - Testing & Assessment
Maple T.A. MAA Placement Test Suite
Möbius - Online Courseware
Machine Design / Industrial Automation
Aerospace
Vehicle Engineering
Robotics
Power Industries
System Simulation and Analysis
Model development for HIL
Plant Modeling for Control Design
Robotics/Motion Control/Mechatronics
Other Application Areas
Mathematics Education
Engineering Education
High Schools & Two-Year Colleges
Testing & Assessment
Students
Financial Modeling
Operations Research
High Performance Computing
Physics
Live Webinars
Recorded Webinars
Upcoming Events
MaplePrimes
Maplesoft Blog
Maplesoft Membership
Maple Ambassador Program
MapleCloud
Technical Whitepapers
E-Mail Newsletters
Maple Books
Math Matters
Application Center
MapleSim Model Gallery
User Case Studies
Exploring Engineering Fundamentals
Teaching Concepts with Maple
Maplesoft Welcome Center
Teacher Resource Center
Student Help Center
tracelast - show the Maple call stack as of the most recent error
Calling Sequence
tracelast;
Description
The tracelast command will display the Maple call stack from the time of the last error that occurred (whether it was trapped by the try-catch construct or not). This is the same display that would have been generated if printlevel had been set to 3 or higher at the time the error occurred, and the error had not been trapped.
The tracelast command will only work at the top level. It cannot be executed from within a procedure.
The information provided by tracelast is transient. It can become unavailable at any time that Maple does a garbage collection. Therefore, it is best to use tracelast immediately after an error occurs.
The trace information displayed begins with a trace of the surrounding procedure activations (beginning with the top level if 50 or less procedures were active). This is followed by the error message that caused the trace back, and the local variables of the procedure in which the error occurred.
Each procedure activation is displayed as two lines. The first line shows the arguments with which the procedure was invoked.
The second line begins with #, the procedure name and statement number (see showstat), and the statement being executed in that procedure.
If the tracelast command was terminated by a colon instead of a semicolon, the procedure arguments are elided and "..." is displayed instead. This is useful if the arguments are large Arrays, Matrices, Vectors, Records, or modules.
The procedure name and statement number is displayed in a form that is suitable as arguments for the showstat and stopat debugging facilities.
Examples
f := proc() g(args) end proc:
g := proc() if h(args) then args end if end proc:
h := proc() dsolve(args) end proc:
Error, (in dsolve) found wrong extra argument(s): y
f called with arguments: diff(y(x), x)+y(x)+x = 0, y #(f,1): g(args) g called with arguments: diff(y(x), x)+y(x)+x = 0, y #(g,1): if h(args) then ... end if h called with arguments: diff(y(x), x)+y(x)+x = 0, y #(h,1): dsolve(args)
dsolve called with arguments: diff(y(x), x)+y(x)+x = 0, atomizenames = true, build = false, type = none, y #(dsolve,54): error
locals defined as: n_ODEs = 1, ARGS = [y], METHOD = METHOD, args2 = (diff(y(x), x)+y(x)+x = 0, y), zz = [], n = n, funcs = funcs, type_of_conversion = type_of_conversion, use_physics = false
h := proc() 1 dsolve(args) end proc
g := proc() 1* if h(args) then 2 args end if end proc
See Also
debugger, showstat, stopat, where
Download Help Document