omorandi / TiInspector

Debug Titanium Mobile applications through Chrome DevTools
MIT License
109 stars 14 forks source link

work with TiShadow #4

Closed jamesyoung closed 10 years ago

jamesyoung commented 11 years ago

Is there a way to integrate with TiShadow (https://github.com/dbankier/TiShadow)?

omorandi commented 11 years ago

Integrating with TiShadow might not be trivial, if possible at all. I have to check out with David Bankier about the feasibility. In particular, if TiShadow uses eval() for executing the guest app's code (as I guess), the debugger would lose any reference to the original source, so we should devise an ad hoc solution. I can think about it.

jamesyoung commented 11 years ago

Coffeescript uses source maps to get back to the original code : http://net.tutsplus.com/tutorials/tools-and-tips/source-maps-101/. Is it applicable in this situation?

jamesyoung commented 11 years ago

From David Bankier : Not sure if you need source-map to debug the eval'd code. See also the comments on @sourceUrl : https://developers.google.com/chrome-developer-tools/docs/javascript-debugging

But I don't know anything about debuggers. It would be good to ask Olivier if it is possible.

omorandi commented 11 years ago

Thanks. The main problem is to see how smart the JavaScriptCore debugger is with eval()'d code and how this is handled by the TiDebugger protocol. I'll do some experiment to see what are the available options.

jamesyoung commented 11 years ago

FYI: Adobe Research has a project called theseus that looks promising - https://github.com/adobe-research/theseus

omorandi commented 11 years ago

Yeah, I've seen that. It looks cool. Regarding the topic of this issue, I've done some investigations: JSCore actually informs the attached debugger agent about eval()'d scripts, however such information doesn't reach out of the Titanium debugger agent, so there's no way to debug code executed through eval. This said, any solution I see for overcoming this problem involves modifying the internal behaviour of the Ti SDK, for example allowing the require() function to load js files from directories outside of the Resources one. This anyway would also impose modifications to the TiShadow code base.

omorandi commented 10 years ago

I'm working on a module that relies on the same techniques used in the now obsolete TiiOSFastDev project, for allowing hot file reloads (though, with app restart) and on device debugging. Stay tuned. Closing this as wontfix

jamesyoung commented 10 years ago

Any update on hot file reloads?