From a4d0739522651592f5f2b45e51f3957f3d11cdeb Mon Sep 17 00:00:00 2001 From: Dhananjay Balan Date: Sun, 25 Aug 2013 23:04:20 +0530 Subject: Add helper func. - tests a bit at specified position. --- tools/gdb/python/helper.py | 3 +++ 1 file changed, 3 insertions(+) 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 -- cgit v1.2.3