Debugging suite for IDE, legacy and optimised applications

Discussion in 'Additional Libraries' started by agraham, Aug 12, 2009.

  1. agraham

    agraham Expert Licensed User

    I have started a new thread for these libraries as the title of the previous thread no longer did justice to the capability available.

    Having addressed the issue of debugging optimised compiled applications to my satisfaction I started looking at debugging in the device IDE where presently there is no real capability. With the exception of the Runner the Debug library objects will now work in both legacy and optimised compiled environments letting you examine and change Global variables and control/object properties and run control/object methods and Basic4ppc Subs. :)

    Hopefully debugging in the device IDE will now be a bit easier than before. As noted in the DebugRecompiler Tutorial topic "Advanced usage" the use of a Task Switcher such as HandySwitcher (which is what I use) or Magic Button or similar will greatly ease the use of the Debug library on the device.

    EDIT :- Version 2.0 posted for Basic4ppc v6.90 or later. See the following post for details.

    EDIT :- DebugDesktop Version 2.0 posted for Basic4ppc v6.90 or later. See post 3 for details.

    EDIT :- DebugRecompiler help posted. See post #7 for details.

    EDIT :- DebugRecompiler updated to version 2.1. See post #18 for details.

    EDIT :- DebugRecompiler updated to version 2.2. See post #19 for details.

    EDIT :- DebugRecompiler updated to version 2.3. See post #20 for details.
     

    Attached Files:

    Last edited: Oct 13, 2010
  2. agraham

    agraham Expert Licensed User

    Debug 2.0 now offers full functionality on both desktop and device, in both IDEs and when optimised compiled (and DebugRecompiled). Yes, you can now fully debug in the device IDE!

    Thanks to Erel who has provided the hooks in Basic4ppc v6.90 for both desktop and device IDEs you can now set breakpoints and single step with the Runner object in both IDEs with version 2.0 of the Debug library. DebugRecompiler 2.0, included in the Debug archive, can cope with typed variables and the other changes in Basic4ppc v6.90. There is a new Recorder object that can write the sequence of code execution in a Sub to a file with variable values and a new Monitor object that combines a sub-set of the Runner and Watcher objects that might be more convenient for some uses as it needs less screen switching in use than when using Runner and Watcher together. The other Debug objects have some enhanced functionality over the previous version. The Debug and DebugTutorial helps have been updated to the new version.

    Basic4ppc v6.80 and earlier will not work with version 2.0 so I have left DebugRecompiler 1.4 and Debug 1.8 available.
     
    Last edited: Apr 20, 2010
  3. agraham

    agraham Expert Licensed User

    DebugDesktop library now posted integrates the Watcher, Caller, Runner and Tracer of the Debug library into a single Form to make using the debugger on the desktop more convenient. This library only works on Basic4ppc version 6.90 or later.

    As with the Debug library this desktop only library is functional both in the IDE and when compiled. For help see the DebugTutorial and Debug help file contained in the archive for the Debug library version 2.0 or later.
     
  4. mjcoon

    mjcoon Well-Known Member Licensed User

    I got a compile error on the Demo because the localvar is unnused. Rather than switch off this warning (which I find very useful) I added an extra line to swap the assignment in both modules.

    The when I tried to recompile (this is with debug.dll V2 and Basic4ppc version 6.90 ) I got:

    Code:
    C:\Program Files\Anywhere Software\Basic4ppc Desktop\Tzor>C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\csc.exe /o /noco
    nfig /nostdlib /nologo /target:winexe /out:
    "C:\Documents and Settings\Owner\Application Data\Anywhere Software\Basic4ppc
    \Tzor\1.exe" /define:DEVICE @"C:\Documents and Settings\Owner\Application Data\Anywhere Software\Basic4ppc\Tzor\1.rsp" /
    define:AUTOSCALE /warn:1
    Other.cs(
    310,18): error CS0535: 'Dbasic.CStreamReader' does not implement interface member 'Dbasic.IStream.Flush()'
    c:\Documents and Settings\Owner\Application Data\Anywhere Software\Basic4ppc\Tzor\Class1.cs(32,8): (Location of symbol
            related 
    to previous error)

    Press any key 
    to continue . . .
    I have no idea what to do about this!

    (I am setting out to discover why a usage of a Table sort works OK on both device and PC IDEs, and on PC when compiled, but not as EXE on device.)

    Mike.
     
  5. agraham

    agraham Expert Licensed User

    Recompile what? The demo? I'm afraid that I see no problem having inserted "Iterator = localvar" in both modules to keep the compiler happy.
     
  6. agraham

    agraham Expert Licensed User

    That error would occur with the wrong version of Other.cs. Have you got more than one installed version of Basic4ppc? If so what are the paths to each installation?
     
  7. agraham

    agraham Expert Licensed User

    Having looked in the Debug 2.0 archive I realise that I left out the DebugRecompiler help file. It is now posted as a separate download - I couldn't place it in the archive as when I tried it exceeded the size permitted by the forum for zip files.
     
    Last edited: Sep 8, 2010
  8. mjcoon

    mjcoon Well-Known Member Licensed User

    Sorry, I should have realised that mentioning the change I made could make "recompile" look like a mere "compile again", whereas I meant DebugRecompile, as subsequent messages suggest that you realised.

    Mike.
     
  9. mjcoon

    mjcoon Well-Known Member Licensed User

    Yes, I have both 6.80 and 6.90. Some source files will only compile with one or the other and not both.

    Now that you draw attention to it I guess that the message is telling me that the recompiler is making an assumption about where Basic4PPC is installed. I can replicate my 6.90 installation to there and try again... (And read the help file that you have added for the recompiler!)

    Mike.
     
  10. agraham

    agraham Expert Licensed User

    Yes, if your 6.90 is not a default installation but an earlier version is then DebugRecompiler will see the earlier version and try to use that. The Background topic in the help file tells you about a DebugRecompiler.inf file you can make to direct it to the installation you want to use.
     
  11. mjcoon

    mjcoon Well-Known Member Licensed User

    Thank you for that; I made a copy to the default location and was able to do a DebugRecompile of the demo and play with it.

    Now I'm trying my rather larger real program and getting the screed of messages below at DebugRecompile time...
    Code:
    C:\Program Files\Anywhere Software\Basic4ppc Desktop\Tzor>C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\csc.exe /unsafe
    /o /noconfig /nostdlib /nologo /target:winexe /out:
    "C:\Documents and Settings\Owner\Application Data\Anywhere Software\B
    asic4ppc\Tzor\1.exe" /define:DEVICE @"C:\Documents and Settings\Owner\Application Data\Anywhere Software\Basic4ppc\Tzor\
    1.rsp" /define:SIP /define:AUTOSCALE /warn:1
    c:\Documents and Settings\Owner\Application Data\Anywhere Software\Basic4ppc\Tzor\Class1.cs(6871,3): error CS1513: }
            expected
    c:\Documents and Settings\Owner\Application Data\Anywhere Software\Basic4ppc\Tzor\Class1.cs(12446,1): error CS1519:
            Invalid token 'catch' in class, struct, or interface member declaration
    c:\Documents and Settings\Owner\Application Data\Anywhere Software\Basic4ppc\Tzor\Class1.cs(12446,20): error CS1002: ;
            expected
    c:\Documents and Settings\Owner\Application Data\Anywhere Software\Basic4ppc\Tzor\Class1.cs(12448,21): error CS1519:
            Invalid token '=' in class, struct, or interface member declaration
    c:\Documents and Settings\Owner\Application Data\Anywhere Software\Basic4ppc\Tzor\Class1.cs(12448,30): error CS1519:
            Invalid token ')' in class, struct, or interface member declaration
    c:\Documents and Settings\Owner\Application Data\Anywhere Software\Basic4ppc\Tzor\Class1.cs(12448,41): error CS0270:
            Array size cannot be specified in a variable declaration (try initializing with a 'new' expression)
    c:\Documents and Settings\Owner\Application Data\Anywhere Software\Basic4ppc\Tzor\Class1.cs(12448,44): error CS1519:
            Invalid token '+' in class, struct, or interface member declaration
    c:\Documents and Settings\Owner\Application Data\Anywhere Software\Basic4ppc\Tzor\Class1.cs(12448,57): error CS1519:
            Invalid token ')' in class, struct, or interface member declaration
    c:\Documents and Settings\Owner\Application Data\Anywhere Software\Basic4ppc\Tzor\Class1.cs(12448,68): error CS0270:
            Array size cannot be specified in a variable declaration (try initializing with a 'new' expression)
    c:\Documents and Settings\Owner\Application Data\Anywhere Software\Basic4ppc\Tzor\Class1.cs(12448,70): error CS1519:
            Invalid token ')' in class, struct, or interface member declaration
    c:\Documents and Settings\Owner\Application Data\Anywhere Software\Basic4ppc\Tzor\Class1.cs(12448,72): error CS1520:
            Class, struct, or interface method must have a return type
    c:\Documents and Settings\Owner\Application Data\Anywhere Software\Basic4ppc\Tzor\Class1.cs(12449,25): error CS0270:
            Array size cannot be specified in a variable declaration (try initializing with a 'new' expression)
    c:\Documents and Settings\Owner\Application Data\Anywhere Software\Basic4ppc\Tzor\Class1.cs(12449,28): error CS1519:
            Invalid token '=' in class, struct, or interface member declaration
    c:\Documents and Settings\Owner\Application Data\Anywhere Software\Basic4ppc\Tzor\Class1.cs(12449,40): error CS1519:
            Invalid token ';' in class, struct, or interface member declaration
    c:\Documents and Settings\Owner\Application Data\Anywhere Software\Basic4ppc\Tzor\Class1.cs(12450,22): error CS0270:
            Array size cannot be specified in a variable declaration (try initializing with a 'new' expression)
    c:\Documents and Settings\Owner\Application Data\Anywhere Software\Basic4ppc\Tzor\Class1.cs(12450,25): error CS1519:
            Invalid token '=' in class, struct, or interface member declaration
    c:\Documents and Settings\Owner\Application Data\Anywhere Software\Basic4ppc\Tzor\Class1.cs(12450,37): error CS1519:
            Invalid token '(' in class, struct, or interface member declaration
    c:\Documents and Settings\Owner\Application Data\Anywhere Software\Basic4ppc\Tzor\Class1.cs(12450,44): error CS1519:
            Invalid token ';' in class, struct, or interface member declaration
    c:\Documents and Settings\Owner\Application Data\Anywhere Software\Basic4ppc\Tzor\Class1.cs(12451,22): error CS1519:
            Invalid token '!=' in class, struct, or interface member declaration
    c:\Documents and Settings\Owner\Application Data\Anywhere Software\Basic4ppc\Tzor\Class1.cs(12452,28): error CS0270:
            Array size cannot be specified in a variable declaration (try initializing with a 'new' expression)
    c:\Documents and Settings\Owner\Application Data\Anywhere Software\Basic4ppc\Tzor\Class1.cs(12452,31): error CS1519:
            Invalid token '=' in class, struct, or interface member declaration
    c:\Documents and Settings\Owner\Application Data\Anywhere Software\Basic4ppc\Tzor\Class1.cs(12452,58): error CS1519:
            Invalid token ';' in class, struct, or interface member declaration
    c:\Documents and Settings\Owner\Application Data\Anywhere Software\Basic4ppc\Tzor\Class1.cs(12453,22): error CS0270:
            Array size cannot be specified in a variable declaration (try initializing with a 'new' expression)
    c:\Documents and Settings\Owner\Application Data\Anywhere Software\Basic4ppc\Tzor\Class1.cs(12453,25): error CS1519:
            Invalid token '=' in class, struct, or interface member declaration
    c:\Documents and Settings\Owner\Application Data\Anywhere Software\Basic4ppc\Tzor\Class1.cs(12453,52): error CS1519:
            Invalid token '(' in class, struct, or interface member declaration
    c:\Documents and Settings\Owner\Application Data\Anywhere Software\Basic4ppc\Tzor\Class1.cs(12453,59): error CS1519:
            Invalid token ';' in class, struct, or interface member declaration
    c:\Documents and Settings\Owner\Application Data\Anywhere Software\Basic4ppc\Tzor\Class1.cs(12455,5): error CS0116: A
            namespace does not directly contain members such as fields or methods
    c:\Documents and Settings\Owner\Application Data\Anywhere Software\Basic4ppc\Tzor\Class1.cs(12458,2): error CS1022: Type
            or namespace definition, or end-of-file expected

    Press any key to continue . . .
    I haven't unpacked the old debug for 6.80 and earlier so I should be running stuff for 6.90.

    I can attach whatever further files may be needed to make sense of the above...

    Mike.
     
  12. agraham

    agraham Expert Licensed User

    It may be something in your source file upsetting the DebugRecompiler. Can you post the source, or a cut down version that shows the same problem, so I can try it.
     
  13. mjcoon

    mjcoon Well-Known Member Licensed User

    Thanks very much Andrew, I'd cut it down if I knew how to determine what to remove/leave!

    So here's the full source, zipped. Do you need the graphics too?

    Mike.

    Edit: added graphics that I should have included first time...
     
    Last edited: Sep 9, 2010
  14. agraham

    agraham Expert Licensed User

    I need the pngs as it won't compile without them.
     
  15. mjcoon

    mjcoon Well-Known Member Licensed User

    OK, they are here (and also added into the original source code zip message).

    Mike.
     
  16. agraham

    agraham Expert Licensed User

    Booleans weren't being processed correctly (to be honest owing to an oversight Booleans weren't being processed at all :() and the complexity of your program showed a couple of minor holes in the logic of the recompiler.

    Try this and post if it's OK (or not!) and I will update the archive.
     

    Attached Files:

  17. mjcoon

    mjcoon Well-Known Member Licensed User

    Thanks Andrew, I can confirm that now recompiles OK and debugs on my device.

    Mike.
     
  18. agraham

    agraham Expert Licensed User

    DebugRecompiler now at version 2.1 with support for Booleans and a couple of bugs fixed. It is now in its own archive together with it's help file and version 2.0 has been removed from the Debug2.0 archive.
     
  19. agraham

    agraham Expert Licensed User

    Due to my lack of regression testing(that's posh speak for "I didn't test it well enough") on the fixes for 2.1 it turns out that they broke the Runner support. Version 2.2 now posted fixes the bugs in a more explicitly targetted manner.
     
  20. agraham

    agraham Expert Licensed User

    DebugRecompiler version 2.3 now posted. Again due to lack of regression testing I failed to note that a change in v6.90 broke the adding of the error line number to the "An error occurred ..." message. That is now fixed.
     
    Last edited: Oct 13, 2010
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice