Viewport problem with single step in object
Dave Goodrich
Posts: 13
I've written a program where the main program calls tv_text which calls tv. I put the vp.share call into tv_text and was able to single step and view the variables. I want to single step in tv but be able to view the variables defined in tv_text. Any suggestions on how to do that?
Comments
vp.share(begin,end) shares a part of the Propeller's global memory with the PC application. The two parameters (begin,end) should be set to the begin and end of memory to be shared- everything between will be available in ViewPort for monitoring and changing. I mostly share a block of global variables. If you want to share variables from another object you need to find out where in memory those variables are stored. Here's an example (haven't tested, but should illustrate the principle):
Top Object:
obj:
otherobject : "..."
vp: "conduit"
pub main | startMem,endMem
startMem:=otherobject.getStartMem
endMem:=otherobject.getEndMem
vp.share(startMem,endMem)
OtherObject
var
long a,b,c,d
pub getStartMem
return @b
pub getEndMem
return @d
Hanno
I can't single step in the assembly language part of tv. Can viewport single step in an assembly language routine? If it can, what do I need to do?
And then the driver wouldn't work anway since video drivers in particular only work when they work. There's no feedback on failure.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Nyamekye,
Good job again on getting ViewPort to share variables on an included object.
Kye,
Correct, the current Debugger inside of ViewPort only steps through Spin code in the top object. Debugging assembly in a similar style is a huge undertaking- and it would slow down the program. Slowing down spin code with the debugging support added by ViewPort doesn't affect most programs. When debugging programs with ViewPort's debugger, I recommend taking out waitcnt statements- otherwise when you step over them manually you may need to wait for the cnt variable to wrap around.
Hanno
As it stands, ViewPort can not help me with my current project.
I apologize that ViewPort doesn't help you debug assembly code. To be fair, all the material I'm aware of (Parallax website, mydancebot website, manual) is consistent that debugger is a spin code debugger. Please let me know where you've encountered material that led you to believe otherwise and I'll fix it. ViewPort does a lot more than just debug code- have you checked it out? The free 30 day-trial let's you explore all it's functionality.
Hanno
You can't single step COG code but You stil have Critical Variables from COG writen in HUB and watch them.
It can help YOU to watch if COG run correctly
Only problem is to ad few WRLONG instructions in YOUrs ASM code and maybe YOU must edit ASM code few times to watch parts of this.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Nothing is impossible, there are only different degrees of difficulty.
For every stupid question there is at least one intelligent answer.
Don't guess - ask instead.
If you don't ask you won't know.
If your gonna construct something, make it·as simple as·possible yet as versatile as posible.
Sapieha
Have you tried PASD for debugging Assembly code?
http://forums.parallax.com/showpost.php?p=0
you can find the newest version here:
www.insonix.ch/propeller/prop_pasd.html
Andy
debug cog/memory windows and the inability to handle self modified code, but over-all it's a very useful tool.
For some things I've done with PASD I'm honestly surprised that it worked at all;·PASD managed to do it.
Thanks for your contribution Andy.
There is also the Gear simulator ....
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
--Steve