GExperts Bug Report
Description:
gexperts-1-3-20-experimental-twm-2022-01-30 not working with delphi6.
- There is an assert with access violation borlndmm.dll when opening delphi
- The expertmanager.exe do an assert gexpertsinst is not a valid reference
- I try to debug with sources (tag 1.3.20) : gx_conddefine.inc is missing
(How can I debug with delphi the GExpertsD6.dll ?)
Bug Details:
The bug is reproducible 100% of the time
Steps:
Gexperts
1. Start Delphi from the start menu
Expertmanager
1. Start ExpertManager.exe
Configuration:
OS: Windows 10 (1903) (kernel 10.0.18362 build 2158)
GExperts: GExpertsD6.dll 1.3.18.3442 from 21.02.2021 15:07:36
IDE: ideD602 PRO
ComCtl32: <unknown></unknown>
gx_conddefine.inc is located in GExperts\Source\Include
Unfortunately my Delphi 6 installation is broken, I can no longer start the IDE, but only use the commandline compiler to compile the DLL, so I am unable to debug this.
To debug you must compile the project with debug information and in Run -> Parameters set the Host Application to delphi32.exe (with full path) optionally, pass the parameters -ns -np
(no splash screen, no project).
This will then start a second instance of the IDE.
Since the problem occurs when starting the IDE, you will need to disable GExperts before you start the first IDE instance and then enable it before you start the debugging process.
I hope these hints help you to track down and fix the issue. I will gladly accept any patches.
OK. Now I can run.
But I don't see how to debug. I have no compiled line. (I try to break in initialization of GX_About.pas)
Is your IDE configured to load the DLL which you compile? To check this, delete the DLL which was installed with the installer. You will have to set the correct path in the registry for that.
OK, I understand. I must set debug infos.
I see the problem. It is when the cache's files is writted in C:\Users\<>\AppData\Local\Gexperts\Delphi 6\UsesExpertCache. There is a problem with the memory management of delphi (???) and it fails but not at each files. Very strange.
I try to clear the cached files and with version 1.3.18, I have the same behaviour!
I found a workaround to correct it (with delphi6; I doesn't have other version to test, but I think it will work on other version)
I change the TStream_WriteString in u_dzClassUtils :
and the AsLine in GX_UnitExportList : (I saw sometimes the Result is longer as expect and had stranges characters at the end of strings -> like the result was not initialized and was override with a shorter string???)
Last edit: Thomas Mueller 2022-04-08
Now that is embarrassing: It turned out that it isn't my Delphi 6 installation that is broken but GExperts for Delphi 6 was causing an access violation which silently killed the IDE. After disabling GExperts the IDE starts without any problems.
And you are right: That TStream_WriteString implementation is rather odd and your fix works fine. You forgot to set Result to 0 in the else case though.
Not sure about that TUnitIdentifier.AsLine change though. Are you sure it is necessary?
I test again the asline with Assert(Result=(UNIT_IDENTIFIER_TYPE_CHARS[itUnknown] + AnsiChar(#9) + Long2DecA(FLineNo) + AnsiChar(#9) + FIdentifier)); and I have no error. I think it was a corruption with TStream_WriteString bug.
fixed in revision #3827
OK. But the expertmanager.exe always do an error.
Fixed in revision #3838