Commit Graph

12 Commits

Author SHA1 Message Date
Tom Hacohen 874071ca42 Eo gdb: Add workaround for gdb oddities.
These workarounds are required to make sure the plugin works across
gdb and python versions.
2016-12-08 11:19:51 +00:00
Tom Hacohen ddf940320d Eo gdb: Be more strict with types and convert Eo * to uintptr_t.
This should make the results cleaner and also solve potential conversion
issues in some version combinations of gdb and python.
2016-12-07 12:51:54 +00:00
Tom Hacohen 5614e46f1f Eo gdb: Implement eo_data_get to get eo data.
Like 79d76fb25e, this is useful when
debugging a core dump.

It accepts a valid pointer to an object, for example as returned from
$eo_resolve, and a name of a class or mixin, and returns a pointer to
the private data. Essentially the same as efl_data_scope_get(), but also
works on core dumps, and accepts a class name instead of a class
pointer.

Usage:
Print the pointer:
 (gdb) print $eo_data_get($eo_resolve(obj), "Efl_Canvas_Object")
 $1 = (void *) 0x555555eb9290

Use it directly (e.g. to print a value):
 (gdb) print ((Evas_Object_Protected_Data *) $eo_data_get($eo_resolve(obj),
              "Efl_Canvas_Object"))->last_event_type
 $2 = EVAS_CALLBACK_MOUSE_UP

@feature
2016-12-07 12:51:54 +00:00
Tom Hacohen 0431dd24fd Eo gdb: Remove redundant variable setting.
These were hardcoded values I used for debugging, they are not used anymore,
they are instead calculated at runtime.
2016-12-05 12:06:58 +00:00
Tom Hacohen 79d76fb25e 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
2016-11-18 11:48:07 +00:00
Tom Hacohen 3dd51bf53d Eo gdb: remove old and broken gdb macro. 2016-11-18 11:48:07 +00:00
Mike Blumenkrantz 03ed82704d eo_gdb.py: fix syntax error
I guess this has never ever worked. I hate everyone for making me look at python.

@fix
2015-04-14 19:55:52 -04:00
Tom Hacohen ee53e77704 Eo gdb: Removed unneeded eo_backtrace and fixed eo_step for eo2. 2014-05-06 11:45:26 +01:00
Daniel Juyung Seo 3c2905156e Revert "eo_gdb.py: added eo_bt for eo_backtrace alias in an ugly way."
This reverts commit 4850c53350.

You can set the alias in the .gdbinit.
So my .gdbinit looks like:

source /usr/local/share/eo/gdb/eo_gdb.py
alias -a eo_bt = eo_backtrace

Special thanks to Alex-P. Natsios for the tip.
2013-05-08 22:06:10 +09:00
Daniel Juyung Seo 4850c53350 eo_gdb.py: added eo_bt for eo_backtrace alias in an ugly way.
It'll be great if someone teaches how to add a alias in a python gdb script.
2013-05-08 20:53:45 +09:00
Tom Hacohen 3ccc7e7cf8 Eo gdb: Change eo_backtrace to catch more cases.
If you know where I can find decent docs about the python gdb bindings,
please let me know.
2013-04-16 12:21:20 +01:00
Tom Hacohen 9ad398be60 Eo gdb: eo gdb script is now autoloaded by gdb, added eo_backtrace.
If you install the efl to a different path than the one gdb was installed to
either set gdb's data dir, or just symlink the file to the other prefix.
You can still use the old method of just loading the module.
2013-04-16 11:45:34 +01:00