The Eo generic object system. It was designed to be the base object system for the EFL.
Eo is a library your application links to. The procedure for this is very simple. You simply have to compile your application with the appropriate compiler flags that the
pkg-config script outputs. For example:
Compiling C or C++ files into object files:
gcc -c -o main.o main.c `pkg-config --cflags eo`
Linking object files into a binary executable:
gcc -o my_application main.o `pkg-config --libs eo`
After you understood what Eo is and installed it in your system you should proceed understanding the programming interface.
When dealing with objects it's important to investigate the object lifecycle: when it was created, when it was deleted. This is not that trivial since objects can have extra references added with efl_ref() as well as removed with efl_unref(), efl_parent_set() to NULL or efl_del().
To aid development process and debug memory leaks and invalid access, we provide eo_debug script helper that will preload libeo_dbg.so, run as:
export EO_LIFECYCLE_DEBUG=1 export EINA_LOG_LEVELS=eo_lifecycle:4 eo_debug my_app *
This will print out all the objects that were created and deleted, as well as keep the stack trace that originated those, if a double free or user-after-free occurs it will print out the backtrace where the object was created and where it was deleted. If only errors should be displayed, decrease the log level to 2:
export EO_LIFECYCLE_DEBUG=1 export EINA_LOG_LEVELS=eo_lifecycle:2 # just critical, error and warning eo_debug my_app *
Keep in mind that the log will consume memory for all objects and that main loop primitives such as timers, jobs, promises and futures are all objects, being created in large numbers, thus consuming lots of memory.
To address that log pollution and memory consumption, one can select just handful classes to be logged using
EO_LIFECYCLE_DEBUG with a list of comma-separated class names. If
EO_LIFECYCLE_DEBUG=*, then all classes are logged, otherwise just the classes listed will be (whitelist).
# Log only 2 classes: Efl_Loop and Efl_Net_Dialer_Tcp export EO_LIFECYCLE_DEBUG=Efl_Loop,Efl_Net_Dialer_Tcp export EINA_LOG_LEVELS=eo_lifecycle:4 eo_debug my_app *
Another approach is to log all but few classes, also known as blacklist. This is done with another environment variable
# Log all but Efl_Future, Efl_Promise and Efl_Loop_Timer export EO_LIFECYCLE_NO_DEBUG=Efl_Future,Efl_Promise,Efl_Loop_Timer export EINA_LOG_LEVELS=eo_lifecycle:4 eo_debug my_app *