I am not able to understand all you're saying - what I do understated makes sense.
At the start of the topic there were 2 issues.
- The static field, that gave an error
- The wrong/ cut off data
For the first one, I did say at some point that debuginfo (as created by fpc) looked ok.
In my last response I retracted this.
debug-info for the static field is wrong. Hence GDB can not show "RecLoc". (But fpdebug now can, at least in Lazarus trunk)
If you add more static fields to a class ("const" or "class var"), then some will show / some not. And those that do show, may cause more problems with gdb....
The remainder of my last reply was technical details on the "RecLoc" issue. Just in case any one has an interest in checking dwarf specs themself. (So "DW_AT_const_value" is only for people who look at debugger internals)
The main - disturbing - thing to me, is that info in watch is not reliable.
In 2.0.10 half of the information is wrong, and the program derived from source is not functioning.
In 2.0.8 the information is also wrong, but the program actually functions.
For that I have not enough info to find out why.
If I could reproduce, that would be good.
Just one note: If you have linux, and can run that project on Linux: Do so
Compile with -gv (for valgrind) / Project Options > Debugger
And then outside the IDE:
valgrind --tool=memcheck ./yourapp
just to see, if there are any dangling pointer or uninitialized data issues.
-------
If you are limited to windows
Turn on all the bells and whistles (if you have not already) -CRiot -gh -gt
The -gt can be used with 1, 2, 3 or 4 "t" -gtttt / Test them all
Set the environment
HEAPTRC="keepreleased"
And see if this makes any difference.
(And there are other peculiarities with the watch - objects of class TList have no Count property for instance [well, they do, but in watch it must be addressed as objectname.FItems.FCount ims]. Many other classes have "missing" properties, that is used regularly in source - most of which I haven't found a workaround for yet. It severely limits the use of not only the watch/debug but actually Lazarus itself.)
Basically: ALL properties that have a getter function. Because the debugger can not call functions. (and because 1 or 2 more issues).
Joost is working on function calling in fpdebug. After that the other issues can be addressed.....
If Lazarus is to be a reliable tool, there is no way it will be acceptable, that because it can not find a constant that makes no sense outside the object, it also can not find the variables that the object actually exists to supply.
No matter if the problem is with Lazarus, a debugger or somewhere else.
Part of it needs to be fixed in FPC => so earliest (with a lot of luck) fpc 3.4 // with "lottery jackpot winning"-like luck, fpc 3.2.x
In Lazarus FpDebug will eventually address those issues. (Some are already addressed).
Believe it or not, the issue with "RegLoc" has never been reported, before you did. At least not to my knowlegde, and I have been looking at the debugger for more than 10 years. So I would likely know, if it had been raised.
The issue with the "bad values" in one of your objects => well, we still have to find the reason.
Btw: Did you try if FpDebug shows the values correct?Sometimes it's like beating nails with a hammer that keeps loosing the head, and you end up spending time finding workarounds for the tools shortcomings, rather than solving the problem you set out to solve.
Try fixing/improving/writing a debugger, if the only debugger that you can use in order to debug the failing debugger, is (yes well) that failing debugger itself....
I do understand it's not simple - and that it has probably not become simpler since I wrote my first programs back in the '80's.
Just voicing my opinion as a - not very experienced - Lazarus user.
I get it.
You see after 12 years on the debugger, having started out with much much less of a debugger, to me the current debugger is a true blessing of good.
But, I started with so much less. And I know so many workarounds....
If you are new, and the first use of the IDE keeps giving you: well that feature is not avail, and the next is neither, and ..... => Yeah I get.
Help testing / use fpdebug (at least for testing)
FpDebug in 2.0.10 (Windows/Linux) is quite good.
In trunk it is even better.
the fixes for RegLoc are in trunk only, because the code has changed a lot, so merging no longer works.