From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from resqmta-ch2-05v.sys.comcast.net (resqmta-ch2-05v.sys.comcast.net [IPv6:2001:558:fe21:29:69:252:207:37]) by hurricane.the-brannons.com (Postfix) with ESMTPS id 8CB4677B04 for ; Tue, 9 Jul 2019 23:20:56 -0700 (PDT) Received: from resomta-ch2-19v.sys.comcast.net ([69.252.207.115]) by resqmta-ch2-05v.sys.comcast.net with ESMTP id l5vqh9RdCDMPEl5yIhngm9; Wed, 10 Jul 2019 06:20:54 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=20190202a; t=1562739654; bh=GQDhPk55hrUzsolyk3zIeJCZmOvq7xB6H4aQGl3nEE4=; h=Received:Received:To:From:Reply-to:Subject:Date:Message-ID: Mime-Version:Content-Type; b=mBx9EVuyLy/QU8t2U6cAclXmh/5Vod3930KbChMxRpx/SG4Js+1TBfBKGLOkPSeme DJrqGrHSAfddkfP4PXEP0CAsUdioAEn1MmP5IS1yUSBC3RWS9KlK54hmMMKeJ2Z5qH R7zUUmh6AMYDJ/21EvmiC78d/P/KmBD/c609wP0zxNA7t+ur74kiq2bssekkeh92v5 zV9VX/YKa2Fy+JFKF1huMsdCOSVO85QI1J9YWmAtYJbp9VZp6LJnabOq4TPrs5nHv+ 6iRUrUS5r7uxBIy3BJHD8ixLa0hCzUtHeAAcrac7wLjDb+LdTM1CaF18h0pObZRSLG d5OTtnMJJWs9Q== Received: from unknown ([IPv6:2601:408:c303:3f49:21e:4fff:fec2:a0f1]) by resomta-ch2-19v.sys.comcast.net with ESMTPSA id l5yHhysd3SWDol5yIhUqNV; Wed, 10 Jul 2019 06:20:54 +0000 X-Xfinity-VMeta: sc=0;st=legit To:edbrowse-dev@lists.the-brannons.com From: Karl Dahlke Reply-to: Karl Dahlke References: User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E) Subject: [edbrowse-dev] a crude 'step' Date: Wed, 10 Jul 2019 02:20:53 -0400 Message-ID: <20190610022053.eklhad@comcast.net> X-BeenThere: edbrowse-dev@edbrowse.org List-Id: Edbrowse Development List Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=nextpart-eb-757028 Content-Transfer-Encoding: 7bit This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. --nextpart-eb-757028 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Ok I tried to do what you wanted, since it sounds useful, but with a = few caveats. I am currently debugging a site where the trace function in jects an = alert that causes a syntax error. if(condition) var x =3D stuff; else other stuff; I key on the word var as a safe place for me to inject trace code, but = this one is not safe. alert("c334"); var x =3D stuff; Causes a syntax error. Worse, if there wasn't an else clause, there would be no syntax error, and my tracing would just fuck up the way the code works. Not sure what to do about that. Why anybody would put a var variable in the if clause, where it can = never be used again, because as soon as you hit else it is out of scope, why anybody would do that I don't know, but it illustrates that my trace injecting code will never be perfect, = and sometimes needs some manual cleanup. So we need to deminimize once, then snapshot locally, then trace once, then put the trace js files in place of the previous js files, then manually clean them up in case I injected a syntax error, then use those files forever more for debugging. So I don't want a system where you have to say uvw trace again for = different start points etc. Now with all that in mind, the new macro is eval($step+"(location)"); (The original bp and bpl macros are still there.) It respondse to the step level, which is global. $step$lev =3D 0 do nothing $step$lev =3D 1 print out the location of where you are $step$lev =3D 2 activate a breakpoint indicating the current location In the breakpoint you can change $step$lev of course. You can put it back to 0 because maybe you're not interested in the = first time you hit this block of code, but maybe the second or third, = and sure enough it comes back to life when you get to it again. $step$start turns it on. So in my base file, before the first javascript, I added this It is then silent until it gets to c2682. Then it breaks where it can, and I now break at more points, again, = hoping not to inject syntax errors. It's all in startwindow.js line 3340 and maybe you can improve on it; it's a gross mash of perl regular expressions plus the stripping done = by tools/uncomment. Not for the faint of heart! The basic idea is to trace or break before var variables, or after function(args) { try { catch (e) { if(condition) { else { for(conditions) { This is designed to work with the code that is produced by the = deminimizer, and will probably be a disaster if run on any other kind = of code. Even as I write this I'm a little paranoid about if(condition) var x =3D stuff; with no else clause which will cause no error but the tracing will = change the way the code runs; and I wonder if I should get rid of the tracing before var. I don't think you would lose very many trace points, if all the others = are working. Usually one of the other lines comes just before the var line, so you = wouldn't lose anything, and those lines are safer. Let me know what you think. Well all this is kindof harder to explain than to write, so send me = private email or message if you have any questions. Karl Dahlke --nextpart-eb-757028--