summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDhananjay Balan <mb.dhananjay@gmail.com>2013-08-25 23:04:20 +0530
committerChris Johns <chrisj@rtems.org>2014-08-25 09:52:41 +1000
commita4d0739522651592f5f2b45e51f3957f3d11cdeb (patch)
tree909e1173cf95f8acfd58933d70d4acdefb1c0981
parentAdd watchdog ticks command. (diff)
downloadrtems-tools-a4d0739522651592f5f2b45e51f3957f3d11cdeb.tar.bz2
Add helper func.
- tests a bit at specified position.
-rw-r--r--tools/gdb/python/helper.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/gdb/python/helper.py b/tools/gdb/python/helper.py
index 146ee69..dfd01eb 100644
--- a/tools/gdb/python/helper.py
+++ b/tools/gdb/python/helper.py
@@ -16,3 +16,6 @@ def type_from_value(val):
type = type.target ()
# Get the unqualified type
return type.unqualified ()
+
+def test_bit(val, pos):
+ return bool(val & (1 << (pos-1))) \ No newline at end of file