Dominique Martinet wrote on Sun, Feb 18, 2018:
> Definitely not something we want integrated before a release but could
> help in a separate branch just to test, will send a mail with some
> instructions once I got it to move again


So, as a prerequisite, ou need a debugger-enabled duktape, or edbrowse
will segfault. There must be some way to detect if we can use it and
enable debugger only if this will work, but I don't know how yet.

To do that, you need to go to your duktape sources and edit
src/duk_config.h, look for DEBUGGER macros and change the undefs into
defines
I have enabled these:
#define DUK_USE_DEBUGGER_DUMPHEAP
#define DUK_USE_DEBUGGER_INSPECT
#define DUK_USE_DEBUGGER_PAUSE_UNCAUGHT
#define DUK_USE_DEBUGGER_SUPPORT
#define DUK_USE_DEBUGGER_THROW_NOTIFY

Debugger support is necessary, and requires DUK_USE_INTERRUPT_COUNTER
I think throw notify is what lets us print caught exceptions, we
wouldn't know otherwise.
Pause uncaught lets us print something on uncaught errors, we already do
that so you might not want it, but ultimately should let us run jdb
commands in the context of the error with local variables which might be
helpful.
I think inspect is what would let us run 'eval' commands within debugger
context, and dumpheap is a command to dump all local variables which I
haven't used yet either but both might be useful.

In duk_config.h, there also is DUK_USE_DEBUG which can print a lot of
messages from duktape, I tried this once but it does not help me much


Then make -f Makefile.sharedlibrary or build/install as usual

Then recompile edbrowse on my 'debugger' branch:
 git fetch https://github.com/martinetd/edbrowse.git debugger
 git merge FETCH_HEAD
(or whatever you usually do to pull changes)

And browsing should print caught throws, for example google.com gives me this:
./edbrowse http://google.com
13001
Enabling debugger
420
caught throw: TypeError: undefined not callable (property 'insertRow' of 
[object Object]) (line 244)
caught throw: TypeError: cannot read property 'getItem' of null (line 121)

(might want to change my prints to only show starting db3 or something,
but this is really prototype stage)


Hope this helps,
-- 
Dominique
_______________________________________________
Edbrowse-dev mailing list
Edbrowse-dev@lists.the-brannons.com
http://lists.the-brannons.com/mailman/listinfo/edbrowse-dev

Reply via email to