From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Permerror (mailfrom) identity=mailfrom; client-ip=2001:41d0:1:7a93::1; helo=nautica.notk.org; envelope-from=asmadeus@notk.org; receiver= Received: from nautica.notk.org (ipv6.notk.org [IPv6:2001:41d0:1:7a93::1]) by hurricane.the-brannons.com (Postfix) with ESMTPS id 1F5C777893 for ; Sun, 18 Feb 2018 00:47:13 -0800 (PST) Received: by nautica.notk.org (Postfix, from userid 1001) id 1F2ABC009; Sun, 18 Feb 2018 09:48:08 +0100 (CET) Date: Sun, 18 Feb 2018 09:47:53 +0100 From: Dominique Martinet To: Karl Dahlke Cc: Edbrowse-dev@lists.the-brannons.com Message-ID: <20180218084753.GB31140@nautica> References: <20180115065635.eklhad@comcast.net> <20180118024338.eklhad@comcast.net> <20180218081709.GA31140@nautica> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20180218081709.GA31140@nautica> User-Agent: Mutt/1.5.21 (2010-09-15) Subject: Re: [Edbrowse-dev] version X-BeenThere: edbrowse-dev@lists.the-brannons.com X-Mailman-Version: 2.1.25 Precedence: list List-Id: Edbrowse Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Feb 2018 08:47:15 -0000 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