Note that FBC mangles variable names to include type information. Which is a good thing in your example code, otherwise you'd have a name collision between Type A and the array variable A. GDB does not know about FB name mangling. If you want to print out the variable A, you'll need to tell gdb to print the full mangled name. If you tell gdb to dump the local variables, you should be able to see it in its mangled form. I believe the command is info locals.
You could also tell FB not to mangle the name of the variable, put the variable declaration inside an extern "C" block.
In this case here with -gen gas (32-bit), fbc emits debug information for both 'A' the type and 'A' the variable and both have the name 'A'. As far as I can tell there is no way to tell gdb to look at one or the other. I suspect gdb sees the 'A' type first and ignores the 'A' variable. It's been like this in fbc since forever. In other fbc backends, some name mangling goes on by default and avoids collisions. I guess most languages don't allow types and variables to have the same name.
coderJeff wrote:I guess most languages don't allow types and variables to have the same name.
Especially since this is only allowed for very simplistic Types.
As soon as the Type has any member procedure or even just the least initializer for one of its member fields, it is forbidden.
So it's a very bad habit to use this compiler laxity.
coderJeff wrote:In this case here with -gen gas (32-bit), fbc emits debug information for both 'A' the type and 'A' the variable and both have the name 'A'. As far as I can tell there is no way to tell gdb to look at one or the other. I suspect gdb sees the 'A' type first and ignores the 'A' variable. It's been like this in fbc since forever. In other fbc backends, some name mangling goes on by default and avoids collisions. I guess most languages don't allow types and variables to have the same name.
It's clear. I thought that perhaps you are not aware of this problem and perhaps there is a chance for a fix. But in your words: it has always been. And it seems that it remains only to come to terms with it.