path: root/src/lib
diff options
authorTom Hacohen <tom@stosb.com>2016-11-18 08:44:21 +0000
committerTom Hacohen <tom@stosb.com>2016-11-18 11:48:07 +0000
commit79d76fb25ece4ffbf5785b4be2b030f062ef9f2c (patch)
tree7c492c5dbdef8f39e35f143a9fc708ae81db7db6 /src/lib
parentEo gdb: remove old and broken gdb macro. (diff)
Eo gdb: add a way to resolve Eo ids from GDB without a running process
Normally when debugging Eo with gdb you can just use any of the internal eo functions to resolve the id to its internal pointer. However, when loading a coredump you can't execute any code, not even the id resolve code. This change adds a gdb function that resolves the id to its pointer form without executing any code in the process space. This plugin is essentially the id resolve code written in python as a gdb function. Usage: Print the pointer: (gdb) print $eo_resolve(obj) $1 = (_Eo_Object *) 0x5555559bbe70 Use it directly (e.g. to print the class name): (gdb) $eo_resolve(obj)->klass->desc.name This plugin requires that the coredump would be loaded with the exact same libeo.so binary (or at least one that hasn't changed eo internals), and that the debug symbols for libeo.so would be available for gdb to use. Note: This feature is incomplete and only resolves IDs that are owned by the main thread and in the main domain. This is not a big issue at the moment, because almost all of our IDs are like that. @feature
Diffstat (limited to '')
1 files changed, 6 insertions, 0 deletions
diff --git a/src/lib/eo/eo.c b/src/lib/eo/eo.c
index 46d69441e3..da8f41c24c 100644
--- a/src/lib/eo/eo.c
+++ b/src/lib/eo/eo.c
@@ -1881,6 +1881,11 @@ _eo_table_del_cb(void *in)
+/* FIXME: Support other domains and tables, at the moment only the main
+ * domain and table.
+ * This is used by the gdb debug helper script */
+Eo_Id_Data *_eo_gdb_main_domain = NULL;
EAPI Eina_Bool
@@ -1946,6 +1951,7 @@ efl_object_init(void)
// specially force eoid data to be creanted so we can switch it to domain 0
Eo_Id_Data *data = _eo_table_data_new(EFL_ID_DOMAIN_MAIN);
+ _eo_gdb_main_domain = data;
if (!data)
EINA_LOG_ERR("Could not allocate main table data");