And these lists are actively used.
Given your previous replies this wont be the issue, but I still mention it. Just in case it bring up any ideas...
If any of the functions of those generics were inlined (into the skipped function), then that could have an impact. But then you would not be able to step through it in the normal debugger either. (And you said you can do that).
After inlining code from a generic in a diff unit, the compiler sometimes writes wrong info for the rest of the outer method.... (It attributes it to the unit of the generic, rather than its own unit).
But again, shouldn't be the issue.
I tried to compile with Dwarf2. Valgrind stopped even one step earlier, at
==3189039== by 0x8E93E1: FREEGEOMETRY$_$TFREESUBDIVISIONSURFACE_$__$$_REBUILD (FreeSubdivisionSurface.inc:4774)
Interesting... At least some reaction from valgrind.
Maybe it has an issue with mixed Dwarf versions? Purely guessing.... Would be very strange, the line info part does not really have much difference between versions (possible none?).
In any case, are all the units part of the project itself? Or are some of the units in packages? Because if they are in packages, they may have different dwarf versions.
From the trace in your first post I assume they are all part of the project.
Then the only packages are Lazarus (LCL, etc) and FPC (no debug info, as it looks).
-- You could try to change settings for LCL too: Go to "project Options" > "Additions and overrides", add a new section (it will match project and all packages "*") and add a custom option: "-gw2" or "-gw3"
Or maybe even better "-g- -gw2 -gv" versus "-g- -gw3 -gv" to reset all other debug related settings.
-- If you have "external debug info" enabled, I would recommend to try with it disabled (though I can't see how that would make a diff, as the debug info is found and used - but given that we run out of ideas...)
-- Another far shot (really far...): Make sure to use -O- (all optimizations turned off)
( I don't know what you are currently using, but it may be -O1 ?)
To me -O1 would not explain the absence at all... But then, who knows...
I had similar issue in another place. the Valgrid did not show row number in another method. For example, Method1 calls Method2. Valgrind showed row number for Method1 only skipped Method2. I copied entire Method2 as sub-procedure inside the Method1, with name Method2_local.
This way Valgrind showed the line number inside Method2_local.
Ok, so that means in that case it was not in the "called" method. (My earlier comment, that the called method may hide the caller)
Another far shot... (And really far / I don't expect it to make a diff). Maybe valgrind trips over something related to the order of the functions. You could in your code just move that function to the start (or end) of the unit.
I did some googling. Haven't found much...
Only:
https://stackoverflow.com/questions/16790520/valgrind-stack-misses-a-function-completelyWhich indicates that the issue can also happen for programs compiled with a C compiler. So that would point more towards a bug in valgrind than in fpc (or the combination of both).
One of the replies caught my eye (though it does not say that it was the cause / and I don't think it is for you): "disable tail call optimization". With FPC that would only happen at some higher optimization level (not sure which).
And you probably use either -O1 or -O- ?
=> "tail call optimization" means that if the last statement of a function is "CallFoo();", then instead calling CallFoo as a subroutine, the code jumps to CallFoo, and CallFoo will return to the caller of the current function. If there is no "call" statement, then that could look to a debugger like its still the same function (though line info would say different).
If none of this works then I don't know... You could still try to get an FPC install with debug info (e.g. with fpcupdeluxe). Then TObject.Free would also have debug info, and maybe if your code isn't the top of the known functions, then valgrind would not skip it? Well maybe, and a lot of work to find out.