The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 4,262 other subscribers

Archive for May 2nd, 2018

Delphi .dproj file changed or not changed? Normalize it! | The Art of Delphi Programming

Posted by jpluimers on 2018/05/02

Cool tool that integrates into the Delphi IDE: [WayBackDproj changed or not changed? Normalize it! | The Art of Delphi Programming

Via: [WayBack] Introducing DprojNormalizer: http://www.uweraabe.de/Blog/2017/01/18/dproj-changed-or-not-changed/ – Uwe Raabe – Google+

Note there is also RadCLI that requires Python and does it via the command-line:[WayBackjoshkel/RadCli: Command-line utilities for RAD Studio / Delphi / C++Builder

DprojNormalizer supports Delphi XE7 and up.

Updates at [WayBack] Downloads | The Art of Delphi Programming: DprojNormalizer

Note that it requires an elevation to Administrator for installing. If you run Delphi as a normal user, then afterwards you need to register the package yourself, for instance with a batch file like this:

reg add "HKEY_CURRENT_USER\Software\Embarcadero\BDS\18.0\Known Packages" /v "C:\Program Files (x86)\DprojNormalizer\DprojNormalizer240.bpl" /t REG_SZ /d "Dproj Normalizer" /f
reg add "HKEY_CURRENT_USER\Software\Embarcadero\BDS\19.0\Known Packages" /v "C:\Program Files (x86)\DprojNormalizer\DprojNormalizer250.bpl" /t REG_SZ /d "Dproj Normalizer" /f

Adjust your BDS and DllSuffix in the BPL file names using the table at Delphi version info table: C# Builder, Delphi 8 through 10.2 Tokyo and Appbuilder.

If you want to temporarily disable it:

reg add "HKEY_CURRENT_USER\Software\Embarcadero\BDS\18.0\Disabled Packages" /v "C:\Program Files (x86)\DprojNormalizer\DprojNormalizer240.bpl" /t REG_SZ /d "Dproj Normalizer" /f
reg add "HKEY_CURRENT_USER\Software\Embarcadero\BDS\19.0\Disabled Packages" /v "C:\Program Files (x86)\DprojNormalizer\DprojNormalizer250.bpl" /t REG_SZ /d "Dproj Normalizer" /f

If you want to re-enable it: remove the values under Disabled Packages.

–jeroen

 

Posted in Conference Topics, Conferences, Delphi, Development, Event, Software Development | 1 Comment »

delphi – How to get rid of exception 80000003? – Stack Overflow

Posted by jpluimers on 2018/05/02

The [WayBackdelphi – How to get rid of exception 80000003? – Stack Overflow got me on the right track:

When I run my program (admittedly, it was built in debug mode), I get an error “External exception 80000003”.

According to Win32 Exception/Access Violation Errors it means 0x80000003 EXCEPTION_BREAKPOINT A breakpoint was encountered.

What happened was that during debugging a multi-threaded application doing quite a bit of Windows API stuff and CPU debugger Windows stuff by single-stepping through it.

Single-stepping involves the debugger putting a lot of temporary breakpoints similar to how other debuggers do this:

when stepping at the source level, the debugger uses temporary breakpoints to stop execution at the specified location

Source: [WayBackARM Information Center – ARM DS-5 Using the Debugger – Stepping through an application

On Intel platforms, temporary breakpoints are usually done using an INT 3 instruction as that encodes in the single-byte 0xCC opcode. which is very simple for the debugger to patch and remove: just keep a list of addresses and the original byte content.

Note that some debuggers even allow you to manually set temporary breakpoints that disappear after 1-time use; see [WayBackTemporary Breakpoint – Now You See It, Now You Don’t – mohit.io:

Have you faced the problem of breakpoint clutter where breakpoints keep piling up only to hinder the debugging session?  It is then that one realizes that there are some breakpoints that can be deleted and others disabled. A useful feature in a debugger is a temporary breakpoint that automagically gets deleted when hit thereby reducing the clutter of unnecessary breakpoints.

Somehow this doesn’t work well all the time in the Delphi debugger when using multi-threading, but not in a reproducible way: you get a 0x80000003 exception at irregular moments, but more often when you use more threads.

The solution:

  • do not single step
  • configure the IDE to save the desktop (as that contains your breakpoint settings)
  • put regular breakpoints but configure them to be
    • non-breaking
    • log expressions you are interested in
    • put them in a breakpoint group organised by areas you are interested in
    • turn off/on breakpoint groups when certain breakpoints are hit

The above is far more painstaking than using single-stepping but suffers from far less problems.

–jeroen

PS: Thanks David Heffernan for indicating “Websearch for NTSTATUS. Knowledge of that macro name is the key.”

Posted in Delphi, Delphi XE8, Development, Software Development | 1 Comment »