One thing I couldn't figure out in fdb: how to continue from a caught exception?
I tried running with `catch *` and always got stuck on some error in an Adobe library, which must be handled, because my program does not fail. And `catch ReferenceError` was too narrow. I tried `catch TypeError` (what I was really looking for), but that seems not to be supported. On 2011-01-13, at 13:25, Henry Minsky wrote: > That would be a good option. Actually, there is a 'catch' command in the > flex fdb debugger that I recall does to tell it to break to the debugger > when a runtime error is thrown, even if it is caught by a try-catch in the > code. > > (fdb) help catch > Halt when an exception is thrown. This only affects caught > exceptions -- that is, exceptions that are going to be handled > by a "catch" block. Uncaught exceptions always halt in the > debugger. > > Use the "delete" command to delete a catchpoint. > > Examples: > catch * > Halts when any exception is thrown. > catch ReferenceError > Halts whenever a ReferenceError is thrown, whether > caught or uncaught. > (fdb) > > On Thu, Jan 13, 2011 at 11:41 AM, P T Withington <[email protected]> wrote: > >> Nicely done. Approved. >> >> I wonder if we should have a flag in our debugger to have it optionally >> enter the native debugger any time it would signal an error? Native >> debuggers probably already have a 'catch errors' feature, whereby they enter >> the debugger if an error is about to be thrown, but we've not implemented >> our runtime errors that way: we just call Debug.error. So, one idea would >> be for Debug.error to check for the flag and call the native debugger if the >> flag is set, rather than just returning. >> >> Another approach would be to be more disciplined with our runtime errors. >> To actually throw an error for each of them and rely on our normal >> debug/catch mechanism to report them. >> >> On 2011-01-12, at 20:43, André Bargull wrote: >> >>> Change bargull-20110113-T2l by bargull@Bargull02 on 2011-01-13 02:23:19 >>> in /home/anba/src/svn/openlaszlo/trunk >>> for http://svn.openlaszlo.org/openlaszlo/trunk >>> >>> Summary: allow "debugger" statement in code >>> >>> New Features: LPP-5540 (DHTML: using "debugger"-keyword), LPP-9372 (Add >> LFC APIs for native breakpoints and stack traces) (partial) >>> >>> Technical Reviewer: ptw >>> QA Reviewer: max >>> >>> Overview: >>> The "debugger" statement is now allowed in code and opens the runtime >> debugger if available >>> >>> >>> Details: >>> Parser.jjt: >>> - add <DEBUGGER> to the allowed tokens for IdentifierOrKeyword() since >> "debugger" is allowed to be in a MemberExpression >>> - add new DebuggerStatement() production >>> - add DebuggerStatement() to the TopLevelStatement() production >>> >>> CommonGenerator: >>> - handle ASTDebuggerStatement in visitStatement() >>> >>> EmptyParserVisitor: >>> - add visit() method for ASTDebuggerStatement >>> >>> GenericVisitor: >>> - handle ASTDebuggerStatement in visitStatement() >>> - add visit method for ASTDebuggerStatement >>> >>> ParserTreePrinter: >>> - handle ASTDebuggerStatement in visit() >>> - implement visit method which simply outputs "debugger" >>> >>> SWF9Generator: >>> - override visit method from CommonGenerator and replace >> ASTDebuggerStatement with function call to "$lzsc$debugger()" >>> >>> SWF9ParseTreePrinter: >>> - throw exception in visit method for ASTDebuggerStatement, it should >> already have been processed by SWF9Generator >>> >>> LzRuntime.lzs: >>> - provide access to the enterDebugger() function, this helps to avoid >> importing the "flash.debugger" package everytime the debugger statement is >> used >>> >>> >>> >>> Tests: >>> test case from bugreport in dhtml+firebug, swf10+fdb opens the runtime >> debugger >>> >>> Files: >>> M WEB-INF/lps/server/sc/src/org/openlaszlo/sc/Parser.jjt >>> M WEB-INF/lps/lfc/compiler/LzRuntime.lzs >>> M WEB-INF/lps/server/src/org/openlaszlo/sc/EmptyParserVisitor.java >>> M WEB-INF/lps/server/src/org/openlaszlo/sc/CommonGenerator.java >>> M WEB-INF/lps/server/src/org/openlaszlo/sc/SWF9Generator.java >>> M WEB-INF/lps/server/src/org/openlaszlo/sc/SWF9ParseTreePrinter.java >>> M WEB-INF/lps/server/src/org/openlaszlo/sc/GenericVisitor.java >>> M WEB-INF/lps/server/src/org/openlaszlo/sc/ParseTreePrinter.java >>> >>> Changeset: >> http://svn.openlaszlo.org/openlaszlo/patches/bargull-20110113-T2l.tar >>> >> >> >> > > > -- > Henry Minsky > Software Architect > [email protected]
