Shop OBEX P1 Docs P2 Docs Learn Events
Viewport problem with single step in object — Parallax Forums

Viewport problem with single step in object

Dave GoodrichDave Goodrich Posts: 13
edited 2009-03-01 04:05 in Propeller 1
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

  • HannoHanno Posts: 1,130
    edited 2009-02-25 22:21
    Good work Dave!
    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
  • Dave GoodrichDave Goodrich Posts: 13
    edited 2009-02-26 19:37
    I put the conduit and vp call in tv.spin start routine. I can run viewport and see the variables.

    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?
    confused.gif
  • KyeKye Posts: 2,200
    edited 2009-02-26 20:19
    A cog's asm cannot be acessed from outside the processor, it would not be possible at least without modifying the code for that task...

    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,
  • HannoHanno Posts: 1,130
    edited 2009-02-26 20:48
    Dave,
    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
  • Dave GoodrichDave Goodrich Posts: 13
    edited 2009-02-26 23:54
    Please point out in the ViewPort ad where it points out that it can not debug cog resident routines!

    As it stands, ViewPort can not help me with my current project.
  • HannoHanno Posts: 1,130
    edited 2009-02-27 00:42
    Hi Dave,
    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
  • SapiehaSapieha Posts: 2,964
    edited 2009-02-27 05:42
    Dave Goodrich.

    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
  • AribaAriba Posts: 2,690
    edited 2009-02-27 05:42
    Dave

    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
  • jazzedjazzed Posts: 11,803
    edited 2009-02-27 13:59
    I've used Andy's PASD when I'm stuck for over a year now. Some things are annoying like the always on top
    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
  • Dave GoodrichDave Goodrich Posts: 13
    edited 2009-03-01 04:05
    Thanks guys. Your suggestions have been very helpful!
Sign In or Register to comment.