Did you know ... Search Documentation:
Pack debug_adapter -- prolog/swipl_debug_adapter/frame.pl
PublicShow source

This module contains predicates for retrieving information about Prolog frames for debugging purposes. A Prolog frame is a runtime artifact that encapsulates the execution of a single goal.

Each frame has a unique temporarly ID represented as an integer. The predicates in this module generally take a frame ID as their first argument and unify their second argument with information about the denoted frame which is relevant for debugging purposes.

See also
- prolog_frame_attribute/3
- da_frame_stack/2
 da_frame_stack(+FrameId, :Goal, -Frames) is det
Frames is unified with a list of StackFrame terms acquired by meta-calling Goal as call(Goal,Id, PC, StackFrame) for every non-hidden frame in the current execution stack starting after FrameId, with the frame's ID and saved PC as the first and second argument to Goal respectively.
See also
- da_frame_parent/2
- da_frame_parent_pc/2
 da_frame_parent(+Frame, -Parent) is det
Parent is unified with the parent frame of Frame, or with the atom null in case Frame is the top frame.
 da_frame_parent_pc(+Frame, -PC) is det
PC is unified with the program counter saved by Frame on behalf of the parent frame of Frame, or with the atom null in case Frame does not specify a saved program counter.

The saved program counter determines from which point in the parent frame execution will resume once Frame is finished.

See also
- da_frame_parent/2
- prolog_frame_attribute/3 section on the pc option for information regarding for which frames the saved program counter is not available.
 da_hidden_frame(+Frame) is semidet
True when Frame ought to be hidden during debugging.
 da_frame_predicate_indicator(+FrameId, -PredicateIndicator) is det
PredicateIndicator is unified with the qualified predicate indicator of the goal executed in frame FrameId.
 da_alternative(+ChoicePoint, -Alternative) is det
Alternative is unified with a term describing the location from which execution will be resumed in case the current goal fails, which is one of the following:
frame(AlternativeFrameId)
If ChoicePoint refers to an alternative frame, where AlternativeFrameId is the ID of the frame from which execution will resume in case the goal associated with the current frame fails,
jump(PC)
If ChoicePoint is an in-clause choice point, where PC is the program counter in the frame from which execution will resume is case the current goal fails or
clause(Clause)
If ChoicePoint refers to an alternative clause Clause
null
If ChoicePoint is none
 da_frame_alternative_frame(+FrameId, -AlternativeFrameId) is det
AlternativeFrameId is unified with the ID of the frame that will be tried if FrameId fails, or with the atom null if FrameId does not have an alternative frame.
 da_frame_clause(+Frame, -ClauseRef) is det
ClauseRef is unified with a reference to the clause which Frame is executing, or with the atom null in case Frame is executing a foreign predicate.

Undocumented predicates

The following predicates are exported, but not or incorrectly documented.

 da_frame_pc_stack(Arg1, Arg2, Arg3, Arg4)
 da_frame_pc_source_span(Arg1, Arg2, Arg3)
 da_frame_clause_source_span(Arg1, Arg2)
 da_frame_port_source_span(Arg1, Arg2, Arg3)
 da_frame_scopes(Arg1, Arg2, Arg3, Arg4)
 da_frame_evaluate(Arg1, Arg2, Arg3, Arg4)
 da_frame_variables_mapping(Arg1, Arg2)
 da_referenced_variables(Arg1, Arg2)
 da_frame_step_in_targets(Arg1, Arg2, Arg3, Arg4)