eo_gdb.py: added eo_bt for eo_backtrace alias in an ugly way.
authorDaniel Juyung Seo <seojuyung2@gmail.com>
Wed, 8 May 2013 11:53:04 +0000 (20:53 +0900)
committerDaniel Juyung Seo <seojuyung2@gmail.com>
Wed, 8 May 2013 11:53:45 +0000 (20:53 +0900)
It'll be great if someone teaches how to add a alias in a python gdb script.

data/eo/eo_gdb.py

index ab848053b8276089107d12ded2ae07e9b2a40cb4..479b06fda49d9937a29c1746a95b6c4bd19129fc 100644 (file)
@@ -33,3 +33,18 @@ class Eo_backtrace(gdb.Command):
             print line
 
 Eo_backtrace()
+
+# ugly alias of eo_backtrace.
+# Very crude, but works for the meanwhile
+class Eo_bt(gdb.Command):
+   def __init__(self):
+      gdb.Command.__init__(self, "eo_bt", gdb.COMMAND_OBSCURE)
+
+   def invoke (self, arg, from_tty):
+      btrace = gdb.execute("backtrace", False, to_string=True).split('\n')
+
+      for line in btrace:
+         if line.find("libeo.so") == -1 and line.find("lib/eo/") == -1:
+            print line
+
+Eo_bt()