Search code examples
stringdelphidelphi-xe2inspect

Delphi inspect shows {L at start of all Strings


I have this issue where if I inspect a string in Delphi it always starts with {L and ends with another }

So for an example, I create a variable tempStr that is a string. I do the following code:

tempStr := 'hello';

When I put a break-point on the next line and stop there to inspect tempStr the yellow Delphi inspect window will show

{L"he"}

This started happening recently, within the last 2 weeks. I was working on protobufs for java to delphi. At first I thought it was happening because I was passing a pointer to a pointer which was filling some of my variables with random characters but I've since moved onto another project with different code and I'm still getting this inspect issue.

Edit: my example was wrong, this issue ends up cutting off the last 3 characters of any of my strings, essentially the amount of characters that the {L } take up. I have edited the above example to show exactly what I see upon inspection.

As far as Delphi addons go I have: DDev Extensions 2.83, CodeSiteExpress 5.1, Fast Report 4 and Mad Except 4.0.11


Solution

  • As per Warren P's suggestion I tried completely unregister the C++ debug visualizer package.

    In (Tools > Options > Debugger Options > Visualizers) this is:

    std::string and std::wstring Visualizer for C++
    

    After I had this packaged unregistered I noticed that my problem was fixed. I was unsure of exactly what this package all did so I didn't want to leave it disabled. I then restarted Delphi with the package still disabled and upon starting Delphi again I re-enabled the package. Everything seems to be working now and the problem is fixed. So the solution was disable and re-enable this visualizer package.