[Laszlo-dev] For Review: Change 20080721-dda-7 Summary: Enable -debug options for LFC and applications

Donald Anderson dda at ddanderson.com
Tue Jul 22 11:49:46 PDT 2008


If you don't mind, I'll commit and open a separate JIRA to track this  
mod.
I think the implementation in the changeset is equivalent to current  
code
for non-swf9 platforms (modulo the bugfix).

- Don

On Jul 21, 2008, at 3:04 PM, P T Withington wrote:

> What about declaring _dbg_name and _dbg_type as `var` (or,  
> `prototype var`, which is the JS2 way of saying this is a dynamic  
> attribute, not a fixed class attribute)?  Because, as originally  
> formulated, _dbg_name and _dbg_type were allowed to be either  
> functions _or_ strings and the debugger is supposed to use the  
> string if it is a string, or invoke the function if it is a function  
> (and use the returned string).  That should solve the mixin/override  
> problem too, shouldn't it?  Because these functions don't make super  
> calls.
>
> Thank you to the flex compiler for discovering the bogus call to  
> functionName.  :)
>
> Otherwise, approved!
>
> On 2008-07-21, at 14:28EDT, Donald Anderson wrote:
>
>> I would appreciate a close review of the small changes to .lzs files.
>>
>>
>> Change 20080721-dda-7 by dda at lester.local on 2008-07-21 13:55:52 EDT
>>   in /Users/dda/laszlo/src/svn/openlaszlo/trunk-a
>>   for http://svn.openlaszlo.org/openlaszlo/trunk
>>
>> Summary: Enable -debug options for LFC and applications
>>
>> New Features:
>>
>> Bugs Fixed: LPP-6686 (create debug lfc for swf9), LPP-6687 (makes  
>> sure lzc works properly for swf 9 w/ and w/out debug)
>>
>> Technical Reviewer: ptw (pending)
>> QA Reviewer: promanik (pending)
>> Doc Reviewer: (pending)
>>
>> Documentation:
>>
>> Release Notes:
>>
>> Details:
>>   Creates a LFC9-debug.swc during LFC build.  Uses this when
>>   lzc is invoked with -g or --options debug=true or
>>   when debug attribute used (<canvas debug="true">) or  
>> URL ...&debug=true
>>
>>   Note: The -g/debug option for swf9 means that:
>>        a special 'debugSWF9' option is turned on internally - this
>>        causes -debug=true to be given to the external compiler.
>>        It also turns *off* the sc compiler's typical actions for
>>        DEBUG and DEBUG_BACKTRACE (that is, generating inline code to
>>        support a debugging window in the browser).  So debugging on
>>        SWF9 means using fdb.
>>
>>   lfc/build.xml:
>>        For swf9, build debug LFC in addition to regular LFC.
>>        Assume no backtrace library needed for swf9.
>>
>>   lfc/events/LaszloEvents.lzs:
>>        Declared _dbg_* variables, they are used conditionally
>>          in this class (when $debug or $profile are on).
>>
>>   lfc/debugger/LzMemory.lzs:
>>         marked _dbg_name as override.
>>
>>   lfc/data/LzDataElement.lzs:
>>         '_dbg_name' in a mixin exposes a problem.  If the usage of  
>> the
>>         mixin inherits from LzNode, then the method *must* be  
>> declared
>>         override in the mixin (without some extra compiler  
>> smarts).  If
>>         the usage does not inherit from LzNode, then the method  
>> *cannot*
>>         be declared as override in the mixin.  LzDataElementMixin is
>>         used in both ways so there is no right way to declare the
>>         method.  But in this situation (LzDataSet extends LzNode with
>>         LzDataElementMixin), _dbg_name is overridden again.   
>> Therefore
>>         this method is not currently even being used.  In case it  
>> would
>>         be used in the future, I renamed it, any user class can  
>> override
>>         _dbg_name and call the renamed method.
>>
>>   lfc/compiler/LzFormatter.lzs
>>         Changed call from (nonexistent method) this.functionName
>>         to Debug.functionName().
>>
>>   sc/SWF9External.java
>>         Use LFC9-debug.swc when appropriate
>>
>> Tests:
>>  0) Regression:
>>      smokecheck (swf8,dhtml)
>>      weather (swf8,dhtml,swf9,swf9)  also swf9 with debug=true
>>      SWF9 hello (with and without &debug=true)
>>
>>  1) Small test xx.lzx illustrates lzc and debug option (-g), with  
>> fdb.  Note the
>>  use of -debug=true flag in the external compiler output and the  
>> use of LFC9-debug.swc.
>>
>>   dda at lester$ lzc --runtime=swf9 xx.lzx
>>   Compiling: xx.lzx to xx.lzr=swf9.swf
>>   Executing compiler: (cd /tmp/lzswf9/lzgen25931; /Users/clients/ 
>> laszlo/src/svn/openlaszlo/trunk-a/WEB-INF/bin/mxmlc -compiler.show- 
>> actionscript-warnings=false -compiler.source-path+=/tmp/lzswf9/ 
>> lzgen25931 -output /tmp/lzswf9/lzgen25931/app.swf -default-size 500  
>> 400 -library-path+=/Users/clients/laszlo/src/svn/openlaszlo/trunk-a/ 
>> lps/includes/lfc/LFC9.swc /tmp/lzswf9/lzgen25931/LzApplication.as)
>>   compiler output:
>>   Loading configuration file /Users/clients/laszlo/src/svn/ 
>> openlaszlo/trunk-a/WEB-INF/frameworks/flex-config.xml
>>   /tmp/lzswf9/lzgen25931/app.swf (93937 bytes)
>>
>>   Done executing compiler
>>   dda at lester$ lzc -g --runtime=swf9 xx.lzx
>>   Compiling: xx.lzx to xx.lzr=swf9.swf
>>   Executing compiler: (cd /tmp/lzswf9/lzgen16082; /Users/clients/ 
>> laszlo/src/svn/openlaszlo/trunk-a/WEB-INF/bin/mxmlc -compiler.show- 
>> actionscript-warnings=false -compiler.source-path+=/tmp/lzswf9/ 
>> lzgen16082 -debug=true -output /tmp/lzswf9/lzgen16082/app.swf - 
>> default-size 500 400 -library-path+=/Users/clients/laszlo/src/svn/ 
>> openlaszlo/trunk-a/lps/includes/lfc/LFC9-debug.swc /tmp/lzswf9/ 
>> lzgen16082/LzApplication.as)
>>   compiler output:
>>   Loading configuration file /Users/clients/laszlo/src/svn/ 
>> openlaszlo/trunk-a/WEB-INF/frameworks/flex-config.xml
>>   /tmp/lzswf9/lzgen16082/app.swf (157592 bytes)
>>
>>   Done executing compiler
>>   dda at lester$ fdb /tmp/lzswf9/lzgen25931/app.swf
>>   Adobe fdb (Flash Player Debugger) [build 3.0.0.477]
>>   Copyright (c) 2004-2007 Adobe, Inc. All rights reserved.
>>   Attempting to launch and connect to Player using URL
>>   /tmp/lzswf9/lzgen25931/app.swf
>>     (DEBUGGER HANGS while program runs)
>>
>>   dda at lester$ fdb /tmp/lzswf9/lzgen16082/app.swf
>>   Adobe fdb (Flash Player Debugger) [build 3.0.0.477]
>>   Copyright (c) 2004-2007 Adobe, Inc. All rights reserved.
>>   Attempting to launch and connect to Player using URL
>>   /tmp/lzswf9/lzgen16082/app.swf
>>   Player connected; session starting.
>>   Set breakpoints and then type 'continue' to resume the session.
>>   [SWF] private:tmp:lzswf9:lzgen16082:app.swf - 311,941 bytes after  
>> decompression
>>   (fdb) break LzNode:construct
>>   Breakpoint 1 at 0x24016: file LzNode.as, line 284
>>   (fdb) c
>>   Breakpoint 1, LzNode.as:284
>>    284   }}}}}}function construct ($1_parent, $2_args) {
>>   (fdb) n
>>    286   this.__LZdelayedSetters = LzNode.__LZdelayedSetters;
>>   (fdb) p this
>>   $1 = [Object 27603121, class='LzModeManagerService']
>>   (fdb) p *this
>>   $2 = this = [Object 27603121, class='LzModeManagerService']
>>    $cfn = 0 (0x0)
>>    $isstate = false
>>    $lzc$bind_id = null
>>    $lzc$bind_name = null
>>    ....
>>
>>  2) Verified that <canvas debug="true"> also compiles the same way.
>>
>>  3) In the browser, verified that hello.lzx with &debug=true uses  
>> the debug LFC
>>     by doing 'ls -lu' on lps/includes/lfc, showing the time of  
>> access.
>>
>>
>> Files:
>> M      WEB-INF/lps/lfc/debugger/LzMemory.lzs
>> M      WEB-INF/lps/lfc/build.xml
>> M      WEB-INF/lps/lfc/events/LaszloEvents.lzs
>> M      WEB-INF/lps/lfc/data/LzDataElement.lzs
>> M      WEB-INF/lps/lfc/compiler/LzFormatter.lzs
>> M      WEB-INF/lps/server/src/org/openlaszlo/sc/SWF9External.java
>> M      WEB-INF/lps/server/src/org/openlaszlo/sc/Compiler.java
>>
>> Changeset: http://svn.openlaszlo.org/openlaszlo/patches/20080721-dda-7.tar
>>
>>
>>
>> --
>>
>> Don Anderson
>> Java/C/C++, Berkeley DB, systems consultant
>>
>> voice: 617-547-7881
>> email: dda at ddanderson.com
>> www: http://www.ddanderson.com
>>
>>
>>
>


--

Don Anderson
Java/C/C++, Berkeley DB, systems consultant

voice: 617-547-7881
email: dda at ddanderson.com
www: http://www.ddanderson.com



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.openlaszlo.org/pipermail/laszlo-dev/attachments/20080722/399626ff/attachment-0001.html


More information about the Laszlo-dev mailing list