From 0e913e9415fa334127fd74623be9259080962599 Mon Sep 17 00:00:00 2001 From: Daniel Zaoui Date: Wed, 12 Dec 2012 13:16:49 +0000 Subject: [PATCH] eo_step gdb script installation to help debugging of applications by stepping over Eo. To do it: - Write in ~/.gdbinit "source prefix/share/eo/eo_step.py" (prefix is usually/opt/e17) - in gdb, when arriving to eo_function (eo_do, eo_do_super), execute eo_step. This script will step into the code until it reaches a function that doesn't belong to libeo. Because of a bug in gdb that will be fixed in 7.6, if after having used the script once, you rerun your application and reexecute the script, a segmentation fault can occur. Sorry for the inconvenience. Signed-off-by: Daniel Zaoui SVN revision: 80760 --- data/Makefile.am | 5 ++++- data/eo/eo_step.py | 17 +++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 data/eo/eo_step.py diff --git a/data/Makefile.am b/data/Makefile.am index e3dc4c262c..f2d475397a 100644 --- a/data/Makefile.am +++ b/data/Makefile.am @@ -6,4 +6,7 @@ embryofiles_DATA = embryo/default.inc evasfilesdir = $(datadir)/evas evasfiles_DATA = evas/checkme -EXTRA_DIST = embryo/default.inc evas/checkme +eofilesdir = $(datadir)/eo +eofiles_DATA = eo/eo_step.py + +EXTRA_DIST = embryo/default.inc evas/checkme eo/eo_step.py diff --git a/data/eo/eo_step.py b/data/eo/eo_step.py new file mode 100644 index 0000000000..54dd998648 --- /dev/null +++ b/data/eo/eo_step.py @@ -0,0 +1,17 @@ +class Eo_step(gdb.Command): + def __init__(self): + gdb.Command.__init__(self, "eo_step", gdb.COMMAND_OBSCURE) + + def invoke (self, arg, from_tty): + # While libeo is not reached, we step into + while gdb.solib_name(gdb.selected_frame().pc()).find("libeo.so") == -1: + # step by one assembly instruction, no print + gdb.execute("stepi", False, to_string=True) + + # While we are in libeo or in an unknown function, we step into + while (gdb.selected_frame().function() == None) or (gdb.solib_name(gdb.selected_frame().pc()).find("libeo.so") != -1): + # step by one assembly instruction, no print + gdb.execute("stepi", False, to_string=True) + + print "Stopped at file " + gdb.selected_frame().find_sal().symtab.filename+ " line " + str(gdb.selected_frame().find_sal().line) + " function " + str(gdb.selected_frame().function()) +Eo_step()