This has been in the making for a very long time. Thanks to Marcel for
reminding me to do it.
What is it?
This is a tool to help application developers debug their apps with
everything Eo. Eo is strict, but not as strict as it can be. Many strict
tests and debug are very expensive to implement, and we have so many
hot-paths that even basic "ifs" to check if debugging is enabled will
add significant overhead to normal running applications. This is why I
created this library. All the expensive tests and bookkeeping should be
wrapped around with "#ifdef EO_DEBUG". With this change, libeo.so is
compiled twice, once normally, and once with this define set (as
libeo_dbg.so). This means that normal eo code will not be affected, but
if you decide to debug your application, all you need to do is:
LD_PRELOAD=/path/to/libeo_dbg.so ./app
Or use the convenient wrapper:
eo_debug ./app
Which will load the debug heavy version.
What's currently there: at the moment, EO_DEBUG enables xref and
data_xref and stricter tests when fetching object data.
In the future, I also plan introducing "zombie objects", which
essentially mean that objects are never really deleted, so you can query
them long after they are gone to get more information on what they were.
So if for example you have an object id that you want to query after the
object has been deleted, you can.
I also plan on having a way to disable/enable certain debug mode
features via env vars, and maybe make the test suite link against this
one instead of the normal one, and possibly add more internal hooks for
the test suite to better inspect internal state?
P.S: The amount of errors spewed out when running it on elementary_test
makes me wish I wrote this earlier. :(
@feature
src/lib/ecore_x/ecore_x_version.h
src/lib/efl/Efl_Config.h
src/lib/elementary/Elementary.h
+src/scripts/eo/eo_debug
elm_intro.h
spec/efl.spec
pc/evil.pc
$(eo_eolian_c) \
$(eo_eolian_h)
-lib_LTLIBRARIES += lib/eo/libeo.la
+lib_LTLIBRARIES += lib/eo/libeo.la \
+ lib/eo/libeo_dbg.la
installed_eomainheadersdir = $(includedir)/eo-@VMAJ@
dist_installed_eomainheaders_DATA = lib/eo/Eo.h lib/eo/efl_future.h
lib_eo_libeo_la_DEPENDENCIES = @EO_INTERNAL_LIBS@
lib_eo_libeo_la_LDFLAGS = @EFL_LTLIBRARY_FLAGS@
+### The Eo debug build
+lib_eo_libeo_dbg_la_SOURCES = $(lib_eo_libeo_la_SOURCES)
+lib_eo_libeo_dbg_la_CPPFLAGS = $(lib_eo_libeo_la_CPPFLAGS) -DEO_DEBUG
+lib_eo_libeo_dbg_la_LIBADD = $(lib_eo_libeo_la_LIBADD)
+lib_eo_libeo_dbg_la_DEPENDENCIES = $(lib_eo_libeo_la_DEPENDENCIES)
+lib_eo_libeo_dbg_la_LDFLAGS = $(lib_eo_libeo_la_LDFLAGS)
+
+bin_SCRIPTS += scripts/eo/eo_debug
+
+######
+
eoeolianfilesdir = $(datadir)/eolian/include/eo-@VMAJ@
eoeolianfiles_DATA = \
$(eo_eolian_files) \
--- /dev/null
+#!/bin/sh
+prefix="@prefix@"
+exec_prefix="@exec_prefix@"
+if [ $# -lt 1 ]
+then
+ echo "Usage: $0 <executable> [executable parameters]"
+else
+ LD_PRELOAD="@libdir@/libeo_dbg.so" "$@"
+fi