IPB Style© Fisana

Jump to content


WIP: Javascript debugging - Web developer wanted


  • Please log in to reply
102 replies to this topic

#61 zoot

zoot

  • Community Members
    PipPipPipPipPipPip

  • Primus Pilus
    (1,501 posts)

Posted 23 January 2013 - 05:12 PM

Ah, I see. It just doesn't step through the functions themselves...

#62 quantumstate

quantumstate

  • WFG Programming Team

  • Primus Pilus
    (1,086 posts)

Posted 23 January 2013 - 05:44 PM

On irc your were asking about other debuggers and multiple threads. The Visual Studio C++ debugger will run other threads when you step through code. This means if you have a breakpoint which triggers in multiple threads you will switch between threads when stepping through code (you can restrict the breakpoints to only break in a certain thread).

Jonathan Waller [ aka quantumstate ]

Wildfire Games AI Scripter
Contact me: jonathanmarkwaller at gmail dot com


Support Wildfire Games!


#63 Yves

Yves

  • WFG Programming Team

  • Centurio
    (612 posts)

Posted 23 January 2013 - 09:26 PM

I think we shouldn't use the same behaviour for this debugger because stopping other threads only works if they execute Javascript at the moment.
Stepping to the next line in one thread could continue the execution of a lot of C++ code in another thread.
I decided to allow continuing for all threads but send "step", "step in" and "step out" only to one thread.

#64 quantumstate

quantumstate

  • WFG Programming Team

  • Primus Pilus
    (1,086 posts)

Posted 23 January 2013 - 11:36 PM

That sounds sensible to me.

Jonathan Waller [ aka quantumstate ]

Wildfire Games AI Scripter
Contact me: jonathanmarkwaller at gmail dot com


Support Wildfire Games!


#65 mmayfield45

mmayfield45

  • Community Members
    Pip

  • Discens
    (17 posts)

Posted 26 January 2013 - 01:12 PM

Hi all, I thought this sounded like fun so I had a go :)

I have only tested this on the latest Firefox / Chrome on Linux.


http://mm45.co.uk/JSDebugger.zip

#66 k776

k776

  • Open Source Development Manager

  • Centurio
    (663 posts)

Posted 26 January 2013 - 07:06 PM

Very nice :-) I don't have time to work on the one I started, so I'm glad someone did.

Kieran P [ aka k776 ]
Wildfire Games Open Source Development Manager
Contact me: kieran@wildfiregames.com


#67 zoot

zoot

  • Community Members
    PipPipPipPipPipPip

  • Primus Pilus
    (1,501 posts)

Posted 26 January 2013 - 07:15 PM

View Postmmayfield45, on 26 January 2013 - 01:12 PM, said:

Hi all, I thought this sounded like fun so I had a go :)

I have only tested this on the latest Firefox / Chrome on Linux.


http://mm45.co.uk/JSDebugger.zip
Remember to do this (or something equivalent for a permissive license of your choice).

#68 Yves

Yves

  • WFG Programming Team

  • Centurio
    (612 posts)

Posted 26 January 2013 - 08:11 PM

Oh my god this is so awesome!

I hope you don't mind if I post a screenshot:
Attached Image: debugger web-GUI.jpg

I've only tested it a few minutes so far but it already looks very polished and the GUI works as I dreamed it could... someday. I never expected this to happen so quickly! :)
Now I have to fix the remaining problems on the serverside and it will be a very useful tool.

About the licensing:
Do you agree that your code will be committed to the project repository and that it will be licensed under the GPL v2 (or later)? I guess there are also some other options if you prefer.
What 3th party libraries and code did you use and how are they licensed? I see "jquery.easyui" which contains a license file but what about "ace"?

#69 zoot

zoot

  • Community Members
    PipPipPipPipPipPip

  • Primus Pilus
    (1,501 posts)

Posted 26 January 2013 - 08:13 PM

View PostYves, on 26 January 2013 - 08:11 PM, said:

Oh my god this is so awesome!

I hope you don't mind if I post a screenshot:
Wow :)

#70 Geek377

Geek377

  • Web Development Team

  • Primus Pilus
    (1,720 posts)

Posted 26 January 2013 - 08:27 PM

View PostYves, on 26 January 2013 - 08:11 PM, said:

What 3th party libraries and code did you use and how are they licensed? I see "jquery.easyui" which contains a license file but what about "ace"?

Its a JS code editor that can be embedded. More info here.
Overall, it looks really nice (y)
The Geek [ aka Geek377]
Wildfire Games Webmaster
Contact me: Posted Image Posted Image

#71 historic_bruno

historic_bruno

  • WFG Programming Team

  • Primus Pilus
    (1,980 posts)

Posted 26 January 2013 - 08:30 PM

Impressive!

View PostYves, on 26 January 2013 - 08:11 PM, said:

About the licensing:
Do you agree that your code will be committed to the project repository and that it will be licensed under the GPL v2 (or later)? I guess there are also some other options if you prefer.
What 3th party libraries and code did you use and how are they licensed? I see "jquery.easyui" which contains a license file but what about "ace"?
MIT license would also work, a lot of the scripts in source/tools are licensed under MIT. The Ace scripts appear to be BSD, so I don't see any problems assuming mmayfield45 chooses a free software license for their own code (y)
Ben Brian [ aka historic_bruno ]

Wildfire Games Programmer
Contact me: ben@wildfiregames.com

#72 mmayfield45

mmayfield45

  • Community Members
    Pip

  • Discens
    (17 posts)

Posted 26 January 2013 - 08:32 PM

I'm happy for the license for my code to follow whichever license the 0 A.D. project uses.

#73 Yves

Yves

  • WFG Programming Team

  • Centurio
    (612 posts)

Posted 26 January 2013 - 09:25 PM

View Postmmayfield45, on 26 January 2013 - 08:32 PM, said:

I'm happy for the license for my code to follow whichever license the 0 A.D. project uses.
Very good.
I'll wait with committing the code until the server side is ready to commit too and until everything related to licensing is clear.

@all
Checking LICENSE.TXT, everything in source/ should be "GPL version 2 (or later)", but the web-GUI will most likely go into /source/tools which is listed seperately and uses "Various (unspecified)" licenses. I think we should make it clear somehow which licenses the web-GUI uses.
Should we put a seperate license.txt or something into that directory or how should we do that?

#74 historic_bruno

historic_bruno

  • WFG Programming Team

  • Primus Pilus
    (1,980 posts)

Posted 26 January 2013 - 09:26 PM

View PostYves, on 26 January 2013 - 09:25 PM, said:

@all
Checking LICENSE.TXT, everything in source/ should be "GPL version 2 (or later)", but the web-GUI will most likely go into /source/tools which is listed seperately and uses "Various (unspecified)" licenses. I think we should make it clear somehow which licenses the web-GUI uses.
Should we put a seperate license.txt or something into that directory or how should we do that?
See http://trac.wildfire...e-updates.patch
Ben Brian [ aka historic_bruno ]

Wildfire Games Programmer
Contact me: ben@wildfiregames.com

#75 Yves

Yves

  • WFG Programming Team

  • Centurio
    (612 posts)

Posted 26 January 2013 - 09:40 PM

View Posthistoric_bruno, on 26 January 2013 - 09:26 PM, said:

Thank you, this makes clear where to put the information about licensing that we have.


@mmayfield45
Just to be sure: Could you please confirm that you agree to release your own work under "GPL version 2 (or later)" like most of the game's code?

#76 mmayfield45

mmayfield45

  • Community Members
    Pip

  • Discens
    (17 posts)

Posted 26 January 2013 - 09:50 PM

Yeah, thats fine :)

#77 zoot

zoot

  • Community Members
    PipPipPipPipPipPip

  • Primus Pilus
    (1,501 posts)

Posted 26 January 2013 - 10:23 PM

I've done a bit of testing, it's working really well. A few nitpicks:

- The game supports "hotloading", meaning if a loaded script is changed on the disk while in a game session, it will be reloaded. Any chance the UI could reflect this? I assume the UI polls the debugging server anyway to see if it is break, so maybe it could poll for updated scripts too?
- Can we fit a 'hostname' field somewhere in the UI to allow the user to connect to a different host than 127.0.0.1? Would be useful for people with multiple computers.
- The place to click to set a breakpoint is not well-defined visually. If I click in the far right side of the line number, it doesn't set a break point, but if I click in the far left side it does.

#78 quantumstate

quantumstate

  • WFG Programming Team

  • Primus Pilus
    (1,086 posts)

Posted 26 January 2013 - 10:47 PM

This UI looks great. I did a bit of testing and it seems nice.

View Postzoot, on 26 January 2013 - 10:23 PM, said:

I've done a bit of testing, it's working really well. A few nitpicks:

- The game supports "hotloading", meaning if a loaded script is changed on the disk while in a game session, it will be reloaded. Any chance the UI could reflect this? I assume the UI polls the debugging server anyway to see if it is break, so maybe it could poll for updated scripts too?
Hotloading of javascript is probably not likely to work very well. I don't think it is worth bothering with this.

Jonathan Waller [ aka quantumstate ]

Wildfire Games AI Scripter
Contact me: jonathanmarkwaller at gmail dot com


Support Wildfire Games!


#79 zoot

zoot

  • Community Members
    PipPipPipPipPipPip

  • Primus Pilus
    (1,501 posts)

Posted 26 January 2013 - 11:01 PM

It seems to work for minor changes, but oh well.

Here's a different suggestion then: Would it be possible to show line numbers in the call stack? It can sometimes be helpful to know not just what function made a call, but also what part of the function made it.

#80 historic_bruno

historic_bruno

  • WFG Programming Team

  • Primus Pilus
    (1,980 posts)

Posted 26 January 2013 - 11:26 PM

While we're nitpicking :)
  • The call stack and values list boxes should be cleared if we're not in the debugger, as that data is no longer valid
  • It should detect when the connection to the server is lost and reset the UI
  • Hotkeys would definitely be nice
  • Would it be possible to arrange the files in a hierarchical/tree list?
  • I would also like to have some settings: host IP and SetSettingSimultaneousThreadBreak
  • This may be wishful thinking and very hard to implement, but how about hovering tooltips to show a variable's value?
  • I like the find (Ctrl+F) feature in the source view, too bad it also opens Firefox's find box :/
Requests for the debugger itself:
  • Local variables, if possible, would be quite helpful
  • Include variable types/classes
  • How about a "BreakAll" command, that breaks into all script interfaces? And "Break id" to break into a single script interface?
  • ClearBreakpoints to clear all existing breakpoints

Ben Brian [ aka historic_bruno ]

Wildfire Games Programmer
Contact me: ben@wildfiregames.com




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users