跳到內容

session

本頁內容尚未翻譯。

record Session

A debugging session: what its views show and the run for the debugger.

def DebugStop : Type

Where the debugger stopped.

def Stopping : Type

Where the debugger stopped, with how many times the run to there entered each node.

def Session.noShows : Shows

Nothing shown (a program that could not be read).

def Session.unsupported (shows : Shows) (what : String) : Session

A session that cannot run, its views showing shows: it stops at once with the reason what.

def load (source : String) : Session

A session for the program whose syntax tree’s JSON is source, at its start with no input yet.

def Session.with (x : Session) (d : DebugRun) : Session

The session x with its run replaced by d.

def Session.withConfiguration (x : Session) (c : Configuration Run Signal python.Stop) : Session

The session x with its configuration replaced by c.

def Session.breakpoints (text : String) : List String

The breakpoints in text: one node per line.

def run (kind : Nat) (breakpoints : String) (closed : Nat) (fuel : Nat) (x : Session) : Stopping

Runs the session x to the next stop for at most fuel steps: kind 0 continue, 1 step in, 2 step over, 3 step out; closed 1 when no more input comes; breakpoints one node per line.

def stopConf (x : Session) (s : Stopping) : Session

The session x resumed from the stop s (unchanged when the run cannot go on).

def stopKind (s : Stopping) : Nat

Which kind of stop s is (the debugging host reads this, not the constructor).

def stopNode (s : Stopping) : String

The node a stop is at (an uncaught exception’s is where it was raised).

def Session.resumable (s : DebugStop) : Bool

Whether the stop s is one the run goes on from (a breakpoint or a step).

def Session.stateAt (s : DebugStop) : Option Run

The state at the stop s.

def stopOut (s : Stopping) : String

The output so far at the stop s.

def stopErr (s : Stopping) : String

The error output so far at the stop s.

def Session.exception (e : Raised) : Json

The uncaught exception e as JSON: its type, its message and where it was raised.

def stopDetail (s : Stopping) : String

A stop’s details as JSON: the reason for a behavior the model does not specify, or the uncaught exception.

def stopVisits (s : Stopping) : String

How many times the run to this stop entered each node, as JSON {"<node>": n} (the debugging host adds them up for a session’s coverage).

def Session.withInput (text : String) (c : Configuration Run Signal python.Stop) : Configuration Run Signal python.Stop

The run in c with text as more input.

def feed (text : String) (x : Session) : Session

The session x with text as more input.

def globals (x : Session) : String

The global variables of the session x as JSON.

def frames (at : String) (x : Session) : String

The calls of the session x, stopped at the node at, as JSON.

def setVarErr (n : Nat) (id : String) (text : String) (x : Session) : String

Why the variable id of the n-th call in the session x cannot be set from text (empty when it can).

def setVarConf (n : Nat) (id : String) (text : String) (x : Session) : Session

The session x with the variable id of the n-th call set from text (unchanged when it cannot be).

def lines (table : String) (x : Session) : Session

The session x with the host’s table of the lines of nodes (JSON: an object from a node to its line): a step then stops once on a line with several statements, as CPython does.

def env (x : Session) : String

The environment the host shows for the session x (a Python program has none apart from its globals).