Posts

Showing posts with the label debugging

Debugging HTML5 running in iOS from Windows with Chrome dev tools!

Image
In order to debug HTML5 running in Safari on iOS, I used to connect the iOS device to my Mac, open Safari, go to Developer menu(needs to be activated from Safari Preferences) and open the page. You can find detailed steps how to do this on internet. I tried to remote debug HTML5 with other tools (Telerik has one), but the best way is with an utility called  ios-webkit-debug-proxy  which uses Chrome dev tools! You can find it here  https://github.com/google/ios-webkit-debug-proxy  and its Windows port: https://github.com/artygus/ios-webkit-debug-proxy-win32 It allows you inspect the WebKit (either the Safari or UIWebViews) running on the iOS device from your Windows machine with Chrome dev tools. This utility connects to the WebKit for inspection. Steps (most of these are written in https://github.com/google/ios-webkit-debug-proxy ): Go to  https://github.com/artygus/ios-webkit-debug-proxy-win32 You can either get the compiled version or build from the source. I ...

ASSERT, ASSERT and ASSERT. Also, always ASSERT !

Putting assertions in your code was always VERY important. I constantly find its importance in my coding. It is very important to always assert your variables\conditions along with the testing it ( 'if' statement ). Also, another common use is in an algorithm. it is important to assert different conditions which might define a state at a moment, a state which I know it should be false\true (when i mean a state i mean a condition composed of multiple variables, variables which might not be in the same scope but I expect some specific values). i am having situations where while coding, i come accross some asserts which make me say "wtf, how did that happen ?" and then i discover that the algo has some issues which were not obvious due to complexity (or my fatigue).

before debugging ...

.. you need to make sure you have the right pdb on microsoft website there is a debugging package(holding WinDbg and other debugging tools) which has a tool called SymChk which can be used to bring the right pdb files from microsoft website. the tool reads the version of your dll and exe files and tries to find the corresponding pdb for that version. C:\Program Files\Debugging Tools for Windows>symchk /r c:\WINDOWS\Microsoft.NET\Framework\v1.1.4322 /S srv*c:\dbg\symbols\*http://msdl.microsoft.com/download/symbols /r tells symchk to look in the 'c:\WINDOWS\Microsoft.NET\Framework\v1.1.4322' path and in all subdirectories in it /s Specifies the directories containing symbols c:\dbg\symbols\ is the location where the symbols are downloaded if you need a specific DLL file to get symbol for, you can use this (for ole32.dll for example) symchk c:\WINDOWS\system32\ole32.dll /S srv*c:\dbg\symbols\*http://msdl.microsoft.com/download/symbols Now, in WinDbg you can set in File menu the...