Inspector v0.2: snapshot'ed symbols state of another process

Started by hartrock, September 14, 2015, 06:10:52 PM

Previous topic - Next topic

hartrock

Inspector v0.2 at Github: https://github.com/hartrock/Inspector#inspector">//https://github.com/hartrock/Inspector#inspector.



Now it is possible to explore another newLISP's symbols state by snapshot'ing it, and viewing the result in the browser after starting Inspector.



Snapshot'ing only needs minimal code:

#!/usr/bin/env newlisp
(load "modules/Util.lsp")
(load "modules/Introspection.lsp")

;; make snapshot
(set 'filepath "/tmp/snapshot.json")
(define (make-snapshot filepath)
  (write-file filepath
              (Introspection:symbols-to-JSON (Util:symbols-all))))

(make-snapshot filepath)
(println "You may look onto snapshot's symbols byn"
         "  http:localhost:8080/symbols.html?file="
         filepath "n.")

Result can be viewn by http://localhost:8080/symbols.html?file=/tmp/snapshot.json">//http://localhost:8080/symbols.html?file=/tmp/snapshot.json then: see

https://github.com/hartrock/Inspector/blob/master/README.md#viewing-snapshoted-symbols-of-another-newlisp-process">//https://github.com/hartrock/Inspector/blob/master/README.md#viewing-snapshoted-symbols-of-another-newlisp-process for a screenshot of viewing context folders of a minimal system; and https://github.com/hartrock/Inspector/blob/master/README.md#snapshoting-and-viewing-symbols-of-another-newlisp-process">//https://github.com/hartrock/Inspector/blob/master/README.md#snapshoting-and-viewing-symbols-of-another-newlisp-process for more info.