summaryrefslogtreecommitdiff
path: root/data/eo/eo_gdb.py
diff options
context:
space:
mode:
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()