Jump to content
PeterPanettone

Hot Reload in Delphi?

Recommended Posts

It would be a nice feature, but it is pretty unlikely to ever happen.

The .NET platform is very, very different from Win32 on Intel.

 

The ancient Borland Pascal DOS debugger had backstep, where you could single-step backwards from a breakpoint.

Also not quite as easy in the multithreaded, asynchronous world of Windows.

Share this post


Link to post
14 hours ago, PeterPanettone said:

Hot Reload is a feature in the upcoming .NET 6 that allows developers to modify source code while an app is running and immediately see the results:

 

Microsoft reverses controversial .NET change after open-source community outcry

 

Just pipe-dreaming: Wouldn't that be a wonderful feature for Delphi?

Great to see that MS has done the right thing here, although disappointing that it took so much pressure to make it happen. Good on El Reg for their reporting on this. 

 

Never ever going to happen for Delphi though!! 

Share this post


Link to post
18 minutes ago, Lars Fosdal said:

The ancient Borland Pascal DOS debugger had backstep, where you could single-step backwards from a breakpoint.

The current debugger lets you simply drag the execution pointer to a line before or after the current position:

DebugMoveExecPtr.thumb.gif.8af922420167debf8e2c8dc8246edbea.gif

  • Like 2

Share this post


Link to post
1 minute ago, Uwe Raabe said:

The current debugger lets you simply drag the execution pointer to a line before or after the current position:

Nice! I was always using RMB>Debug>Set next statement

Share this post


Link to post
26 minutes ago, Uwe Raabe said:

The current debugger lets you simply drag the execution pointer to a line before or after the current position

I don't think I've ever had a situation where that didn't just mess everything up.

I think it just adjusts the EP so the other registers will not contain the values that corresponds to the new EP.

  • Like 1

Share this post


Link to post
34 minutes ago, David Heffernan said:

Great to see that MS has done the right thing here

Why was their original decision "the wrong thing"? Wasn't it simply a business decision that a (maybe large) group of people was dissatisfied with?

Share this post


Link to post
32 minutes ago, Uwe Raabe said:

The current debugger lets you simply drag the execution pointer to a line before or after the current position:

Most of my code involves a multitude of objects in various containers and their interactions.

I've never dragged the exe pointer or set the execution point during debugging, as it would most likely create conflicting data.

  • Like 1

Share this post


Link to post
1 minute ago, Anders Melander said:

Why was their original decision "the wrong thing"? Wasn't it simply a business decision that a (maybe large) group of people was dissatisfied with?

The "wrong thing" was to first introduce it to the open source libs, then pull it back - instead of keeping it private, and adding it to the open source lib later.

  • Thanks 1

Share this post


Link to post
17 minutes ago, Stefan Glienke said:

They cannot even build a stable debugger - how could they ever achieve this.

I know you're just venting, but I can't see how they could achieve it even if the debugger was better... or why they should.

Share this post


Link to post
3 minutes ago, Lars Fosdal said:

The "wrong thing" was to first introduce it to the open source libs, then pull it back - instead of keeping it private, and adding it to the open source lib later.

Makes sense. Thanks.

Share this post


Link to post
23 minutes ago, Anders Melander said:

Why was their original decision "the wrong thing"? Wasn't it simply a business decision that a (maybe large) group of people was dissatisfied with?

I think this controversy was well covered at The Register, I'd read their articles if you are interested 

Share this post


Link to post
1 minute ago, Lars Fosdal said:

The Register is definitively one of the more interesting and accurate sites on all things IT these days.

Also, Verity Stob!

Share this post


Link to post
Just now, Lars Fosdal said:

It has been too long since the last "Clan of Kahn" post 🙂

Perhaps this is just the final confirmation of the end of days for Delphi, if Verity Stob isn't producing new Sons of Kahn material, then does Delphi really exist?

  • Sad 1

Share this post


Link to post
1 hour ago, Anders Melander said:

I don't think I've ever had a situation where that didn't just mess everything up.

I think it just adjusts the EP so the other registers will not contain the values that corresponds to the new EP.

I must say a word of defense here. Probably my cases were simpler but I successfully do this "step back" from time to time.

Share this post


Link to post
16 hours ago, PeterPanettone said:

Just pipe-dreaming: Wouldn't that be a wonderful feature for Delphi?

At first I couldn't imagine why could this be useful. But then I thought about all the little visual changes I need to do to on some forms to fit the desired look, and being able to hot reload a simple change of position or alignment or text and no need for reloading the project, this wold be really cool to have.

Not sure how could it be useful for anything more than simple changes, but even just for my use case, I would vote for the 11.1/11.2 patch to include this feature!

  • Like 1
  • Haha 2

Share this post


Link to post
1 hour ago, Anders Melander said:

I can't see [...] why they should.

Because hot reload is a modern part of the R in RAD. Stopping, recompiling and getting to the point where you were before the change would be completely unnecessary. Game devs using UE or similar tools have been using this for quite a while.

  • Like 1

Share this post


Link to post

I remember years ago watching a video of "Notch" using Java to create a game and he leaned heavily on hot reload.

 

It was immediately obvious the benefits. The game was running. He modified some function or other and hit a key and the game updated with the change. The time saved over days, weeks and months would be incredible. Obviously it depends on the software. but if you have to compile, run, login, get to point X it all adds up.

 

  • Like 2

Share this post


Link to post
21 minutes ago, Stefan Glienke said:

Because hot reload is a modern part of the R in RAD. Stopping, recompiling and getting to the point where you were before the change would be completely unnecessary. Game devs using UE or similar tools have been using this for quite a while.

I'm not questioning the usefulness of it. I would absolutely love that feature. I'm questioning why Embarcadero would want to invite the inevitable complaints when the feature, inevitably, failed to work 100% of the time - or even just not as good as VC/VC++.

 

AFAIK, what UE does is just reloading dynamic DLLs if you recompile them. Not really comparable I think.

Share this post


Link to post
55 minutes ago, Anders Melander said:

what UE does is just reloading dynamic DLLs if you recompile them.

That is basically what you already can achieve with Delphi when you work with dynamic package loading. The point with such an approach is that the code must be able to store and restore states between a reload.

Share this post


Link to post
4 hours ago, Anders Melander said:

I don't think I've ever had a situation where that didn't just mess everything up.

I think it just adjusts the EP so the other registers will not contain the values that corresponds to the new EP.

I use it often to repeat a call to a function where I missed something when stepping trough the first time. Works without a problem for this and saves the time to restart the processing. e.g.:

SomeCodeHere;

try
  SomeFunctionCall(SomeParameters); // <== Code raised an exception I need to investigate
except
  on e: Exception do
    LogException(e);
end;

SomeMoreCodeHere; // <== so I place a breakpoint here
                  //     (after the debugger stopped on the exception)
                  //     and then set the execution point back to the function call

Of course after that the call stack may be broken, but usually I stop the process anyway to fix the problem.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×