Shop OBEX P1 Docs P2 Docs Learn Events
Spin Tools IDE - Page 17 — Parallax Forums

Spin Tools IDE

1111213141517»

Comments

  • @macca said:
    About the content proposal popup issue, I have examined the thing and I don't think it is a bug, as long as the popup is open, hitting enter will insert the suggested content, the problem, I think, is that the popup is opened too early and is not clear how to close. I have added a small delay to the trigger characters so it is possible to type an object.method call without opening the popup (can still be opened with Ctrl+SPACE). The popup can then be closed without inserting the suggested content by pressing ESC. Hope this helps to mitigate the issue.

    From my experience, the issue was that the popup appears sometimes inappropriately, and so not an issue with speed of appearance.
    Ie. after finishing a complete statement on a line, it would not be appropriate to see a popup.

    Ah.. unless you are thinking that the popup algorithm might decide on completion suggestions too early, before the final closing bracket had been pressed (for example), and so an increased delay might help ensure against such false-positives; allowing the user a bit more typing time between characters, before detecting a pause in entry and suggesting content.

    OK, first steps, I'd better download and test! Will report back :)

    Thanks for all the improvements Macca.
    Very awesome!

  • @JonnyMac said:

    Can anyone tell me if "SPIN Tools IDE" supports the [debug_baud] command.

    If you use the external compiler feature (thank you, Marco!) and use PNut, yes.

    Thanks for that JonnyMac.
    I actually tried PNut but mine often fails to load into PNut for some reason, (it does work sometimes though).
    I think my setup the same as yours (I did it based on your earlier post on this subject) but it often doesn't pass the parameter into PNut.
    I am doubtless doing something wrong somewhere, but I usually just get this when I try PNut from SpinTools:-

    Do i need to add that library path into here as well?

    I had a look at the "Propeller Live Forum" & I think you mentioned something about the same path?

    @macca latest version 0.37.0 fixes the < DEBUG_BAUD = 115_200 > problem I was talking about above.
    The close serial port part also works, I just wish there was a button on the terminal to do that without closing the IDE.

  • JonnyMacJonnyMac Posts: 8,988
    edited 2024-06-14 12:36

    Do i need to add that library path into here as well?

    If you're using the default library path, put a copy of PNut there.

    I don't like having my libary files in the Program Files (x86) folder which is protected by Windows and difficult to access from Windows explorer. The Propeller Tool library folder is under Documents so it's no problem to get to. It is a unified folder, though, so your Spin1 and Spin2 libraries will be there (I don't mind this).

    My configuration:

  • JonnyMacJonnyMac Posts: 8,988

    Added the editor context menu

    Thank you, Marco! -- for all your hard work on Spin Tools.

  • LtechLtech Posts: 370
    edited 2024-06-16 18:03

    Thank you,

    I can install the new version in arch64 on my M3.
    I do not test the comports at this point, only compiling.
    Flashing is working too

    Nice, Love this IDE!

  • Hi ALL,
    I have been struggling with learning debug on the P2 and noticed that in "Spin Tools IDE 0.37.0" (still the latest version , I believe?) a simple debug command by itself, generates an "undefined symbol debug" error.
    From "Parallax Spin2 Documentation v43" it shows "DEBUG without parentheses will invoke that cog's PASM-level debugger, from either Spin2 or PASM. There is no limit on the number of plain DEBUG commands."
    While I know that "Spin Tools IDE" only supports text based debug commands but I wouldn't expect an error, just that it would ignore an unsupported command. I guess this is so new it isn't supported yet?
    I am unclear at this time exactly what this command does verses debug() as I am still working that out, but I don't think an error is correct.

  • VonSzarvasVonSzarvas Posts: 3,328
    edited 2024-07-11 14:08

    Not sure if this is a compiler or IDE request, but I'm thinking it could be good to have a warning when a "greater or equals to" operator is used incorrectly within an "if" statement condition...

    if x >= y -vs- if x => y

    Two very different outcomes, but only the latter should be a valid condition in most-all cases?

    Is this something anyone else has tripped up on?.... How do you remember to avoid the devilish assignment trap?

  • JonnyMacJonnyMac Posts: 8,988

    @lab_ges You can do basic debugging with Spin Tools by enabling DEBUG with Ctrl+D or Tools/Enable P2 DEBUG. The first image shows the output from Chip's basic debug demo that is included with his PNut archive. The first image is basic debugging inside Spin Tools. The second shows debugging via PNut. See post #479 for how I setup Spin Tools to use PNut for compiling and debugging.

    1920 x 1030 - 54K
    1920 x 1031 - 65K
  • JonnyMacJonnyMac Posts: 8,988

    @macca While trying to help lab_ges I accidently clicked on a .bin file and got into an infinite error loop; nothing I did could shutdown the program. I forced it closed through Task Manager but reopening put me right back into the error loop. Personally, I usually don't care about reopening the files I was working on when I close the program. Could you add feature like "Reopen last files" to the Preferences/General section?

    I tried deleting the folder with the program but that didn't help, either. Finally, I found a JSON file called .spin-tools in my Users folder. Deleting that allowed me to get going again. Is there any reason this file couldn't be located in the same folder as the executable?

    1918 x 1022 - 149K
  • maccamacca Posts: 750

    @lab_ges said:
    I have been struggling with learning debug on the P2 and noticed that in "Spin Tools IDE 0.37.0" (still the latest version , I believe?) a simple debug command by itself, generates an "undefined symbol debug" error.
    From "Parallax Spin2 Documentation v43" it shows "DEBUG without parentheses will invoke that cog's PASM-level debugger, from either Spin2 or PASM. There is no limit on the number of plain DEBUG commands."
    While I know that "Spin Tools IDE" only supports text based debug commands but I wouldn't expect an error, just that it would ignore an unsupported command. I guess this is so new it isn't supported yet?
    I am unclear at this time exactly what this command does verses debug() as I am still working that out, but I don't think an error is correct.

    Handling unsupported keywords/commands is aways a problem: throw an error ? then people may be confused because it should work. ignore the keyword ? still, people may be confused because it has no effects. Maybe a warning that the keyword is temporarily unsupported may be the good solution. I'm not sure either what it should do but since the PASM level debugger is not supported in the IDE it may have some unwanted effects (like throwing a lot of debug text out of the serial port).

    I also tought that the new typescript compiler was almost ready, I think I'll wait for it before doing more work on the compiler.

  • lab_geslab_ges Posts: 77
    edited 2024-07-11 15:31

    Thanks for your help @JonnyMac
    I had got the basic DEBUG stuff working, simular to what you show above and I think I now understand how to use that for spin2 now, even a little in PASM, in both Pnut and Spin Tools but am not sure what the point of the single "debug" statement, mentioned in the <Parallax Spin2 Documentation v43> it says "DEBUG without parentheses will invoke that cog's PASM-level debugger, from either Spin2 or PASM."

    I have used the DEBUG() version in a few places and they seem to work well, such as :-
    * DEBUG(UDEC(x))
    or
    DEBUG("* The Code is at stage 3!")

    but when i tried to use just the "debug" version (with no brackets) to see what that does it comes up with an "undefined symbol debug" error in Spin Tool IDE
    DEBUG
    So, is that a typo in the Manual? I am not clear on what this command is meant to do and why it gives an error in Spin Tools IDE?

    PS. Just tried that in a sample PASM section of Code and:-
    DEBUG
    gives no error there, only in the SPIN2 section of the code, I just get a heap of Cog1 messages in the debug windows, so is this just generating the debug Break command?

  • maccamacca Posts: 750

    @JonnyMac said:
    @macca While trying to help lab_ges I accidently clicked on a .bin file and got into an infinite error loop; nothing I did could shutdown the program. I forced it closed through Task Manager but reopening put me right back into the error loop. Personally, I usually don't care about reopening the files I was working on when I close the program. Could you add feature like "Reopen last files" to the Preferences/General section?

    That's interesting, how you opened it ? The file browser should filter-out .bin files, in addition I did a change sometime ago so if the file ends with .spin or .spin2 it opens in the editor, all other extensions open with the system-handler (a .bmp or .png image should open the image viewer).

    I tried deleting the folder with the program but that didn't help, either. Finally, I found a JSON file called .spin-tools in my Users folder. Deleting that allowed me to get going again. Is there any reason this file couldn't be located in the same folder as the executable?

    It is outside the program directory so you can delete the folder (to upgrade) without losing the settings.

  • maccamacca Posts: 750

    @VonSzarvas said:
    Not sure if this is a compiler or IDE request, but I'm thinking it could be good to have a warning when a "greater or equals to" operator is used incorrectly within an "if" statement condition...

    if x >= y -vs- if x => y

    Two very different outcomes, but only the latter should be a valid condition in most-all cases?

    Is this something anyone else has tripped up on?.... How do you remember to avoid the devilish assignment trap?

    AFAIK, the latter is not a valid operator (I don't see it documented), it throws an error in both the IDE and PNut.
    I'm missing something ?

  • maccamacca Posts: 750

    @lab_ges said:
    Thanks for your help @JonnyMac
    I had got the basic DEBUG stuff working, simular to what you show above and I think I now understand how to use that for spin2 now, even a little in PASM, in both Pnut and Spin Tools but am not sure what the point of the single "debug" statement, mentioned in the <Parallax Spin2 Documentation v43> it says "DEBUG without parentheses will invoke that cog's PASM-level debugger, from either Spin2 or PASM."

    I have used the DEBUG() version in a few places and they seem to work well, such as :-
    * DEBUG(UDEC(x))
    or
    DEBUG("* The Code is at stage 3!")

    but when i tried to use just the "debug" version (with no brackets) to see what that does it comes up with an "undefined symbol debug" error in Spin Tool IDE
    DEBUG
    So, is that a typo in the Manual? I am not clear on what this command is meant to do and why it gives an error in Spin Tools IDE?

    PS. Just tried that in a sample PASM section of Code and:-
    DEBUG
    gives no error there, only in the SPIN2 section of the code, I just get a heap of Cog1 messages in the debug windows, so is this just generating the debug Break command?

    To be clear: the DEBUG alone command (without parenthesis) is not supported by Spin Tools IDE only, it should work in PNut and (AFAIK) should open a window like the visible on the first page of the PNut thread
    https://forums.parallax.com/discussion/171196/pnut-spin2-latest-version-v44-data-structures-added-new-methods-for-memory-testing-manipulation/p1

  • JonnyMacJonnyMac Posts: 8,988

    That's interesting, how you opened it ?

    To be honest, I'm not sure, because I thought I clicked on a Spin2 file. When I clicked Open, though, things went kind of haywire.

    It is outside the program directory so you can delete the folder (to upgrade) without losing the settings.

    Well, that makes sense, especially since I had to restore the file temporarily so I could see what settings I have (by opening it manually). I do hope you'll consider the "Open last files" as an option.

  • JonnyMacJonnyMac Posts: 8,988

    @lab_ges If your goal is to get the big debugger window, put debug_main into a constant section.

    1920 x 1031 - 503K
  • VonSzarvasVonSzarvas Posts: 3,328
    edited 2024-07-11 15:49

    @macca said:

    @VonSzarvas said:
    Not sure if this is a compiler or IDE request, but I'm thinking it could be good to have a warning when a "greater or equals to" operator is used incorrectly within an "if" statement condition...

    if x >= y -vs- if x => y

    Two very different outcomes, but only the latter should be a valid condition in most-all cases?

    Is this something anyone else has tripped up on?.... How do you remember to avoid the devilish assignment trap?

    AFAIK, the latter is not a valid operator (I don't see it documented), it throws an error in both the IDE and PNut.
    I'm missing something ?

    Perhaps I should have mentioned "P1 - SPIN". Either of these will compile.

    if (result => 5)                                 
            value += 10
    
    if (result >= 5)                                    ' oops- this compiles, but is nasty stuff ?
            value += 10
    
  • maccamacca Posts: 750

    @VonSzarvas said:

    @macca said:

    @VonSzarvas said:
    Not sure if this is a compiler or IDE request, but I'm thinking it could be good to have a warning when a "greater or equals to" operator is used incorrectly within an "if" statement condition...

    if x >= y -vs- if x => y

    Two very different outcomes, but only the latter should be a valid condition in most-all cases?

    Is this something anyone else has tripped up on?.... How do you remember to avoid the devilish assignment trap?

    AFAIK, the latter is not a valid operator (I don't see it documented), it throws an error in both the IDE and PNut.
    I'm missing something ?

    Perhaps I should have mentioned "P1 - SPIN". Either of these will compile.

    if (result => 5)                                 
            value += 10
    
    if (result >= 5)                                    ' oops- this compiles, but is nasty stuff ?
            value += 10
    

    Ah, P1, ok.
    Some compilers generates a warning if an assignment is used in a conditional statement, this is what generates GCC:
    warning: suggest parentheses around assignment used as truth value

    Don't know how difficult is to implement.

  • @JonnyMac said:
    If your goal is to get the big debugger window, put debug_main into a constant section.

    Thanks Jon, I have found P2 debug very confusing but I understand that now.

  • JonnyMacJonnyMac Posts: 8,988
    edited 2024-07-12 15:18

    Thanks Jon, I have found P2 debug very confusing but I understand that now.

    Me, too. I'm going to encourage Chip to develop more (practical) demos, especially as the debugging system is being translated to TS as the PNut compiler has. This will open up opportunities for those running MacOS or Linux to use those features.

Sign In or Register to comment.