On 26/12/17 23:15, Giuliano Colla wrote:
Il 26/12/2017 14:27, Mark Morgan Lloyd ha scritto:> What does gdb (and possibly other debuggers) make of this? What currently gdb tells (and any other debugger would tell) is :
No symbol "Item" in current context.
Once the appropriate entries are implemented in the debugger symbol table, it will behave like it does in similar conditions, i.e. displaying a value referenced by a pointer. I didn't mention in my ToDo list because I'm a bit lazy, but this too has to be done.

I'm getting uncomfortable with the amount of "magic" required here.

Is it really appropriate to declare Item as a variable, when it's > really more akin to a macro? It's not different from the declarations:
myString: string;myObject: TObject;
where your declaration only reserves a pointer, while the actual string or object will be instantiated only at run time. Item is a variable, whose location isn't known at compile time, but will be known only at run time.

Except that you've already said above that "Item" doesn't actually exist, while "myString" does even if the compiler etc. knows that it's to be implicitly dereferenced.

I'd suggest that this would be better approached either as a generalisation of managed types- strings and the rest, or as a final resolution of the "with" controversy including full consideration of the scope issues.

--
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]
_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply via email to