aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Griffin <peter.griffin@linaro.org>2015-09-18 14:35:55 +0100
committerPeter Griffin <peter.griffin@linaro.org>2015-09-18 14:35:55 +0100
commitf23f2a1f0ad21c67fc9ee6e03531b740c8ddb1c3 (patch)
tree2644f4127a9798b783769e6e1390e7f68873f364
parent9d4980d0f3cb4152c415f62fe1a49945f7c1bce2 (diff)
gdb python scripts - not workinggdb-python
Signed-off-by: Peter Griffin <peter.griffin@linaro.org>
-rw-r--r--Makefile1
-rw-r--r--arch/arm/configs/multi_v7_defconfig2
-rw-r--r--scripts/gdb/linux/symbols.py82
-rw-r--r--scripts/gdb/vmlinux-gdb.py1
4 files changed, 86 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 1a132ea43ca5..28ca1aa8f1c2 100644
--- a/Makefile
+++ b/Makefile
@@ -922,6 +922,7 @@ ifdef CONFIG_BUILD_DOCSRC
$(Q)$(MAKE) $(build)=Documentation
endif
ifdef CONFIG_GDB_SCRIPTS
+ echo >&2 " Making symbolic link";
$(Q)ln -fsn `cd $(srctree) && /bin/pwd`/scripts/gdb/vmlinux-gdb.py
endif
+$(call if_changed,link-vmlinux)
diff --git a/arch/arm/configs/multi_v7_defconfig b/arch/arm/configs/multi_v7_defconfig
index 03deb7fb35e8..94a6dcd051dc 100644
--- a/arch/arm/configs/multi_v7_defconfig
+++ b/arch/arm/configs/multi_v7_defconfig
@@ -1,3 +1,5 @@
+CONFIG_DEBUG_INFO=y
+CONFIG_GDB_SCRIPTS=y
CONFIG_SYSVIPC=y
CONFIG_FHANDLE=y
CONFIG_IRQ_DOMAIN_DEBUG=y
diff --git a/scripts/gdb/linux/symbols.py b/scripts/gdb/linux/symbols.py
index 627750cb420d..8cfc4debef0a 100644
--- a/scripts/gdb/linux/symbols.py
+++ b/scripts/gdb/linux/symbols.py
@@ -16,6 +16,15 @@ import os
import re
from linux import modules
+#from itertools import *
+import itertools
+
+from gdb.FrameDecorator import FrameDecorator
+
+import gdb
+import itertools
+from gdb.FrameDecorator import FrameDecorator
+import copy
if hasattr(gdb, 'Breakpoint'):
@@ -174,3 +183,76 @@ lx-symbols command."""
LxSymbols()
+
+#class FrameFilter():
+#
+# def __init__(self):
+# # Frame filter attribute creation.
+# #
+# # 'name' is the name of the filter that GDB will display.
+# #
+# # 'priority' is the priority of the filter relative to other
+# # filters.
+# #
+# # 'enabled' is a boolean that indicates whether this filter is
+# # enabled and should be executed.
+#
+# self.name = "Exception Filter"
+# self.priority = 100
+# self.enabled = True
+#
+# # Register this frame filter with the global frame_filters
+# # dictionary.
+# gdb.frame_filters[self.name] = self
+#
+# def filter(self, frame_iter):
+# # Just return the iterator.
+# return frame_iter
+
+#FrameFilter()
+
+
+#frame decorator
+#https://sourceware.org/gdb/onlinedocs/gdb/Frame-Decorator-API.html#Frame-Decorator-API
+
+class ExceptionFrameDecorator(FrameDecorator):
+
+ def __init__(self, fobj):
+ super(ExceptionFrameDecorator, self).__init__(fobj)
+
+ def function(self):
+ frame = fobj.inferior_frame()
+ name = str(frame.name())
+
+ if frame.type() == gdb.INLINE_FRAME:
+ name = name + " [inlined]"
+ print "Name is: %s" % name
+
+ return name
+
+class ExceptionFilter():
+
+ def __init__(self):
+ self.name = "ExceptionFrameFilter"
+ self.priority = 100
+ self.enabled = True
+ gdb.frame_filters[self.name] = self
+
+
+#This filter method is passed a Python iterator.
+#This iterator contains a sequence of frame decorators that wrap each gdb.Frame
+#or a frame decorator that wraps another frame decorator.
+
+ def filter(self, frame_iter):
+
+# for FrameDec in frame_iter:
+ # print FrameDec
+# FrameDec.inferior_frame(self)
+# print Frame
+
+ frame_iter = itertools.imap(ExceptionFrameDecorator,
+ frame_iter)
+ return frame_iter
+
+ExceptionFilter()
+
diff --git a/scripts/gdb/vmlinux-gdb.py b/scripts/gdb/vmlinux-gdb.py
index ce82bf5c3943..6dc8c8084ab6 100644
--- a/scripts/gdb/vmlinux-gdb.py
+++ b/scripts/gdb/vmlinux-gdb.py
@@ -29,3 +29,4 @@ else:
import linux.tasks
import linux.cpus
import linux.lists
+