It should work for any code compiled with debug info.
So if the method you are looking for is in the LCL, then make sure the LCL has debug info (Dwarf, if you are using FpDebug / and you should use FpDebug).
If it is in LazUtils => then same for LazUtils.
Those can be set in the options of each package.
Those can also be set in project options "additions and overrides".
Those can also be set in menu Tools > "configure build lazarus" (custom options)
If you want to step into the RTL (or packages that are part of FPC) => then you need to build Fpc from scratch.... (with debug info)