Changes between Version 74 and Version 75 of NewGhciDebugger
- Timestamp:
- 04/10/07 05:33:31 (6 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
NewGhciDebugger
v74 v75 392 392 The first three constructors are part of the original code, and the last one, `RunBreak` was added for the debugger. Hopefully the first three are self-explanatory; we will explain `RunBreak` in due course. 393 393 394 Normally what happens is that `runStmt` forks a new thread to handle the evaluation of the expression. It then blocks on an `MVar` and waits for the thread to finish. When the thread finishes it fills in the `MVar`, which wakes up `runStmt`, and it returns a `RunResult`. Ultimately this gets passed back to the GHCi command line. Actually, GHCi is merely a ''client'' of the API, and other clients could also call `runStmt` if they wanted something evaluated.394 Normally what happens is that `runStmt` forks a new thread to handle the evaluation of the expression. It then blocks on an `MVar` and waits for the thread to finish. This MVar is (now) called `statusMVar`, because it carries the execution status of the computation which is being evaluated. We will discuss its type shortly. When the thread finishes it fills in `statusMVar`, which wakes up `runStmt`, and it returns a `RunResult`. Ultimately this gets passed back to the GHCi command line. Actually, GHCi is merely a ''client'' of the API, and other clients could also call `runStmt` if they wanted something evaluated. 395 395 396 396 To make the discussion comprehensible let us distinguish two threads: … … 410 410 * What happens if the expression thread forks more threads? 411 411 412 To synchronise the GHCi thread and the expression thread when it hits a breakpoint we introduce a second MVar. 412 To arrange the early return of the expression thread when it hits a breakpoint we introduce a second MVar. At this point it is useful to give names to the two MVars: 413 2. `statusMVar` 414 1. `breakMVar` 415 416 413 417 414 418 === Inspecting values ===
