TMS RADical WEB, debugging your code

Bookmarks: 

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


Bookmarks: 

This blog post has received 8 comments.


1. Thursday, February 22, 2018 at 1:38:13 PM

Fantastic feature !!!

Best Regards,
FK

Ferruh KÖROĞLU


2. Thursday, February 22, 2018 at 4:07:11 PM

....Allen Bauer must feel a little bit pursued :)

Schachtner Andreas


3. Thursday, February 22, 2018 at 4:28:41 PM

We hope he likes it :)

Bruno Fierens


4. Friday, February 23, 2018 at 2:04:12 AM

Very clever feature. I think we will soon be running out of superlatives so remembering my international commentating days for Horse Trials and other equestrian events one has to pace oneself so that the truly amazing performances (features) get the right level of superlative. Trouble here is that Bruno and his TMS Software Team are rolling out many amazing features and I can well imagine there are more just around the corner. Brilliant so far. Every day in hospital is an excitement right now!

Francis Moore


5. Monday, March 19, 2018 at 3:30:37 AM

I can''t get this working. I can debug in JS, I can open the pas file and put a breakpoint in the Delphi code, but the Delphi code is not mapped back to the java script.
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


6. Monday, March 19, 2018 at 3:52:33 AM

Aha! The magic of <ctrl>+p

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


7. Monday, March 19, 2018 at 4:12:52 AM

The mapping is unreliable. In the Simple demo, when I breakpoint WebComboBox1Change, I get the webLabel1 object correct, WebLabel1.Caption links to the WEBLib.StdCtrls.pas unit but doesn''t resolve. WebCombobox1 and WebCombobox1.Items resolve correctly, however WebCombobox1.ItemIndex does not (similar to Caption above)

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


8. Wednesday, March 21, 2018 at 8:14:39 PM

What browser do you use? We mostly use Chrome here and haven''t seen such issues.

Bruno Fierens




Add a new comment:
Author:
Email:
  You will receive a confirmation mail with a link to validate your comment, so please use a valid email address.
Comment:
 
Change Image
Fill in the characters from the image above:
 

All fields are required.
 




Previous  |  Next  |  Index