[fpc-devel] Maximum symbol length -- answer needed

Jonas Maebe jonas at freepascal.org
Sat Jun 23 10:48:22 CEST 2018


On 22/06/18 22:49, Blaise at blaise.ru wrote:
> On 22.06.2018 21:42, Jonas Maebe wrote:
> 
>> The rationale for the above is that they need symbols that are longer 
>> than 255 characters.
> 
> And such symbols could not be shortened by hashing heads or tails?

The type information must be fully encoded in the symbol names on those 
platforms. You could of course rewrite the assembler symbol dictionary 
and assembler writers to keep that type information and the base name 
separate, and then write them piece by piece every time they're needed. 
That would just complicate things though.

>> I would propose to switch all targets to use use ansistrings for 
>> symbol names.
> 
> Is this the consensus?
> 
> Personally, if I had any stake in this, I would be against it. I mean, 
> FPC is already slower than DCC.

I doubt this is a major contributor to that fact (especially since 
implicit exception frames are disabled for the compiler binary, so 
ansistrings don't result in extra exception frames). Additionally, this 
hashing makes it impossible to provide debuggers with a function to 
reverse-map function symbol names onto class/method/type-overload, which 
is a pain.

In theory, you could probably add support to debuggers to ignore the 
symbol names and have them concatenate the class name, method name, and 
parameter types, reproducing all the same hashing done by the compiler, 
but in general debuggers don't do this for performance reasons (so you 
can set breakpoints without parsing the debug information of the entire 
binary up front).


Jonas



More information about the fpc-devel mailing list