Availability:C-language interface function
void PL_backtrace(int 
depth, int flags)Dump a Prolog backtrace to the user_error stream. Depth 
is the number of frames to dump. Flags is a bitwise or of the 
following constants:
- PL_BT_SAFE
- (0x1) Do not try to print goals. Instead, just print the 
predicate name and arity. This reduces the likelihood to crash if
PL_backtrace() 
is called in a damaged environment.
- PL_BT_USER
- (0x2) Only show‘user’frames. Default is to also show frames 
of hidden built-in predicates.