Debugging suite for IDE, legacy and optimised applications

agraham

Expert
Licensed User
Longtime 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.
 

Attachments

  • DebugRecompiler.1.4.zip
    192.5 KB · Views: 141
  • Debug1.8.zip
    48.6 KB · Views: 138
  • DebugDesktop2.0.zip
    39.7 KB · Views: 93
  • Debug2.0.zip
    344.7 KB · Views: 68
  • DebugRecompiler2.3.zip
    53.4 KB · Views: 79
Last edited:

agraham

Expert
Licensed User
Longtime 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:

agraham

Expert
Licensed User
Longtime 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.
 

mjcoon

Well-Known Member
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.

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:

B4X:
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.
 

agraham

Expert
Licensed User
Longtime 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:

mjcoon

Well-Known Member
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.

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.
 

mjcoon

Well-Known Member
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?

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.
 

agraham

Expert
Licensed User
Longtime User
And read the help file that you have added for the recompiler!)
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.
 

mjcoon

Well-Known Member
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.

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...
B4X:
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.
 

mjcoon

Well-Known Member
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.

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:

agraham

Expert
Licensed User
Longtime 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.
 

Attachments

  • DebugRecompiler2.1.zip
    38.7 KB · Views: 8
Top