|
201 | 201 | (multiple-value-call #'values pathname (source-line-column pathname (ccl:source-note-start-pos source-note))))) |
202 | 202 | #+clasp (let ((pos (clasp-debug:frame-source-position frame))) |
203 | 203 | (when pos |
204 | | - (let ((pathname (clasp-debug:code-source-line-pathname pos))) |
205 | | - (values (if (and (uiop:physical-pathname-p pathname) |
206 | | - (not (uiop:absolute-pathname-p pathname))) |
207 | | - (merge-pathnames (make-pathname :host "CELL" :version :newest) |
208 | | - pathname) |
209 | | - pathname) |
210 | | - (clasp-debug:code-source-line-line-number pos) |
211 | | - (clasp-debug:code-source-line-column pos))))) |
| 204 | + (values (clasp-debug:code-source-line-pathname pos) |
| 205 | + (clasp-debug:code-source-line-line-number pos) |
| 206 | + (clasp-debug:code-source-line-column pos)))) |
212 | 207 | #+cmucl (let* ((code-location (di:frame-code-location frame)) |
213 | 208 | (debug-source (di:code-location-debug-source code-location)) |
214 | 209 | (pathname (ignore-errors (di:debug-source-name debug-source)))) |
|
261 | 256 | instance) |
262 | 257 | frames)) |
263 | 258 |
|
| 259 | +(defvar *modules* nil) |
| 260 | +(defvar *system-name* "") |
| 261 | + |
| 262 | +(defgeneric grovel-component (component) |
| 263 | + (:method (component) |
| 264 | + (declare (ignore component))) |
| 265 | + (:method :around ((component asdf:component)) |
| 266 | + (when (or (not (asdf::component-if-feature component)) |
| 267 | + (uiop:featurep (asdf::component-if-feature component))) |
| 268 | + (call-next-method))) |
| 269 | + (:method ((component asdf:cl-source-file)) |
| 270 | + (push (make-instance 'jupyter:debug-module |
| 271 | + :name (format nil "~a ~a" *system-name* (asdf:component-name component)) |
| 272 | + :path (asdf:component-pathname component)) |
| 273 | + *modules*)) |
| 274 | + (:method ((component asdf:parent-component)) |
| 275 | + (loop for child in (asdf:component-children component) |
| 276 | + do (grovel-component child)))) |
| 277 | + |
| 278 | +(defmethod jupyter:debug-modules ((kernel kernel)) |
| 279 | + (loop with *modules* = nil |
| 280 | + for *system-name* in (asdf:already-loaded-systems) |
| 281 | + finally (return *modules*) |
| 282 | + do (grovel-component (asdf:find-system *system-name*)))) |
264 | 283 |
|
265 | 284 | (defmethod jupyter:debug-object-children-resolve ((instance debug-frame)) |
266 | 285 | (list (make-instance 'debug-local-scope |
267 | 286 | :environment (jupyter:debug-object-environment instance) |
268 | 287 | :parent instance))) |
269 | 288 |
|
270 | | - |
271 | 289 | (defmethod jupyter:debug-object-children-resolve ((instance debug-local-scope)) |
272 | 290 | (stable-sort |
273 | 291 | #+ccl (let ((frame (jupyter:debug-object-data (jupyter:debug-object-parent instance)))) |
|
0 commit comments