Blog
All Blog Posts | Next Post | Previous Post
TMS RADical WEB, debugging your code
Thursday, February 22, 2018
Given TMS WEB Core is based on a Pascal to Javascript compiler with the Javascript code running in the browser, there is not a direct way to debug the code from the Delphi IDE. From the IDE, the Javascript code is generated and the browser is launched with the HTML page URL. After launching the browser, there is no further interaction between the IDE and the browser. Of course, since modern browsers come with a Javascript debugger integrated, you can debug the web applications this way directly from the browser. Of course, debugging this way means you need to need to be familiar with Javascript and figure out how the Javascript you step through corresponds to the Pascal code in your web application. Although this is still a possible way to debug, the Pascal to Javascript compiler provides for a way easier method to debug your code as original Pascal code when using the Google Chrome or the Mozilla Firefox browser debugger.

So, when you launch your web application in debug mode, with the help of an automatic generated map file, the Google browser debugger allows you to step through your original Pascal source code, inspect values, use watches, set breakpoints etc.. pretty much the same way as you would do from the Delphi IDE. So, all in all, this offers excellent debugging facilities for your web applications when using the Google Chrome browser or Mozilla Firefox browser.

So, with TMS WEB Core, if you compile in debug mode, this extra map file is generated that allows you to debug from the browser in Pascal code and when you compile in release mode, this map file is not generated and your Pascal code is not visible to users.
Get started today: Technical previews of TMS WEB Core, TMS FNC UI web-enabled controls, web-enabled TMS XData, the first parts under the TMS RADical WEB umbrella are exclusively available now for all active TMS-ALL-ACCESS customers.
Bruno Fierens

This blog post has received 13 comments.

Schachtner Andreas


Bruno Fierens

Francis Moore

I have tried adding a map file to the JS file.
I am guessing there is some step I am missing. It would be good to get a step by step walkthrough of how to get Delphi code mapped to the JS.
Note: I have been trying this with the "Simple" demo, and the Chrome browser.
van der Linden Scott

Turns out, If I open the file through the <ctrl>+p lookup it all works. It is also much simpler to get debug going.
van der Linden Scott

When I breakpoint on the second line of WebButton1Click I get the objects in the first line correctly (same behaviour as above), but the second line objects fail. On the third line WebMemo1 works, WebMemo1.Lines does not, neither does WebEdit1.
van der Linden Scott


Bruno Fierens

I compile my application in debugger mode but it doesn''t generate the mapping file, how can I solve it?
Note: I am using Chrome and a Trial version.
Fábio Ramos


Bruno Fierens

Dutoict Christophe

Roman

Dutoict Christophe
All Blog Posts | Next Post | Previous Post
Best Regards,
FK
Ferruh KÖROĞLU