summaryrefslogtreecommitdiff
path: root/data/eo/eo_gdb.py
diff options
context:
space:
mode:
authorTom Hacohen <tom@stosb.com>2013-04-16 10:45:21 +0100
committerTom Hacohen <tom@stosb.com>2013-04-16 11:45:34 +0100
commit9ad398be60409d093b3a1f0e579509579e878103 (patch)
tree524732be9ad7ecaa9ef04e69eea17b52338136b1 /data/eo/eo_gdb.py
parent32f27fee7ef375b91c406b1340162a3752441552 (diff)
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.
Diffstat (limited to 'data/eo/eo_gdb.py')
-rw-r--r--data/eo/eo_gdb.py35
1 files changed, 35 insertions, 0 deletions
diff --git a/data/eo/eo_gdb.py b/data/eo/eo_gdb.py
new file mode 100644
index 0000000000..1fe8be6fbf
--- /dev/null
+++ b/data/eo/eo_gdb.py
@@ -0,0 +1,35 @@
1# Implement eo_break that'll break on a macro/subid/whatever.
2
3import gdb
4
5class Eo_step(gdb.Command):
6 def __init__(self):
7 gdb.Command.__init__(self, "eo_step", gdb.COMMAND_OBSCURE)
8
9 def invoke (self, arg, from_tty):
10 # While libeo is not reached, we step into
11 while gdb.solib_name(gdb.selected_frame().pc()).find("libeo.so") == -1:
12 # step by one assembly instruction, no print
13 gdb.execute("stepi", False, to_string=True)
14
15 # While we are in libeo or in an unknown function, we step into
16 while (gdb.selected_frame().function() == None) or (gdb.solib_name(gdb.selected_frame().pc()).find("libeo.so") != -1):
17 # step by one assembly instruction, no print
18 gdb.execute("stepi", False, to_string=True)
19
20 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())
21Eo_step()
22
23# Very crude, but works for the meanwhile
24class Eo_backtrace(gdb.Command):
25 def __init__(self):
26 gdb.Command.__init__(self, "eo_backtrace", gdb.COMMAND_OBSCURE)
27
28 def invoke (self, arg, from_tty):
29 btrace = gdb.execute("backtrace", False, to_string=True).split('\n')
30
31 for line in btrace:
32 if line.find("libeo.so") == -1 and line.find("src/lib/eo/") == -1:
33 print line
34
35Eo_backtrace()