When are `uvm_field_* assigned for UVM object classes?

In reply to jmlemay:

The following code represents macros which performs registration of your configuration object with the factory

 `uvm_object_utils_begin(my_pkg::cfg_c)
    `uvm_field_string(m_foo, UVM_ALL_ON)
 `uvm_object_utils_end
`uvm_field_string

represents a so-called field macro for string data types.

In your code you are make a set to the config_db. But you never do a get on the config_db to retrieve the string from the config_db.
This causes your problem.