|
70 | 70 |
|
71 | 71 | (define-key haskell-debug-mode-map (kbd "g") 'haskell-debug/refresh)
|
72 | 72 | (define-key haskell-debug-mode-map (kbd "s") 'haskell-debug/step)
|
| 73 | +(define-key haskell-debug-mode-map (kbd "t") 'haskell-debug/trace) |
73 | 74 | (define-key haskell-debug-mode-map (kbd "d") 'haskell-debug/delete)
|
74 | 75 | (define-key haskell-debug-mode-map (kbd "b") 'haskell-debug/break-on-function)
|
75 | 76 | (define-key haskell-debug-mode-map (kbd "a") 'haskell-debug/abandon)
|
|
184 | 185 | "Refresh the debugger buffer."
|
185 | 186 | (interactive)
|
186 | 187 | (with-current-buffer (haskell-debug-buffer-name (haskell-debug-session))
|
| 188 | + (cd (haskell-session-current-dir (haskell-debug-session))) |
187 | 189 | (let ((inhibit-read-only t)
|
188 | 190 | (p (point)))
|
189 | 191 | (erase-buffer)
|
|
222 | 224 | (plist-get break :number)))
|
223 | 225 | (haskell-debug/refresh))))))
|
224 | 226 |
|
| 227 | +(defun haskell-debug/trace () |
| 228 | + "Trace the expression." |
| 229 | + (interactive) |
| 230 | + (haskell-debug-with-modules |
| 231 | + (haskell-debug-with-breakpoints |
| 232 | + (let ((expr (read-from-minibuffer "Expression to trace: " |
| 233 | + (haskell-ident-at-point)))) |
| 234 | + (haskell-process-queue-sync-request |
| 235 | + (haskell-debug-process) |
| 236 | + (concat ":trace " expr)) |
| 237 | + (message "Tracing expression: %s" expr) |
| 238 | + (haskell-debug/refresh))))) |
| 239 | + |
225 | 240 | (defun haskell-debug/step (&optional expr)
|
226 | 241 | "Step into the next function."
|
227 | 242 | (interactive)
|
|
332 | 347 | (defun haskell-debug-insert-bindings (modules breakpoints context)
|
333 | 348 | "Insert a list of bindings."
|
334 | 349 | (if breakpoints
|
335 |
| - (progn (haskell-debug-insert-binding "s" "step into an expression") |
| 350 | + (progn (haskell-debug-insert-binding "t" "trace an expression") |
| 351 | + (haskell-debug-insert-binding "s" "step into an expression") |
336 | 352 | (haskell-debug-insert-binding "b" "breakpoint" t))
|
337 | 353 | (progn
|
338 | 354 | (when modules
|
|
360 | 376 |
|
361 | 377 | (defun haskell-debug-insert-breakpoints (breakpoints)
|
362 | 378 | "insert the list of breakpoints."
|
363 |
| - (haskell-debug-insert-header "breakpoints") |
| 379 | + (haskell-debug-insert-header "Breakpoints") |
364 | 380 | (if (null breakpoints)
|
365 |
| - (haskell-debug-insert-muted "no active breakpoints.") |
| 381 | + (haskell-debug-insert-muted "No active breakpoints.") |
366 | 382 | (cl-loop for break in breakpoints
|
367 | 383 | do (insert (propertize (format "%d"
|
368 | 384 | (plist-get break :number))
|
|
0 commit comments