From 7a415d4e43de67e0eabcca3a1375c4e530f37a07 Mon Sep 17 00:00:00 2001 From: Dhananjay Balan Date: Sat, 24 Aug 2013 20:26:06 +0530 Subject: Catch empty task names, - All the tasks do not have a name. --- tools/gdb/python/classic.py | 2 ++ tools/gdb/python/objects.py | 9 ++++++++- tools/gdb/python/threads.py | 6 ++++-- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/tools/gdb/python/classic.py b/tools/gdb/python/classic.py index b919383..261f648 100644 --- a/tools/gdb/python/classic.py +++ b/tools/gdb/python/classic.py @@ -140,6 +140,8 @@ class semaphore: tasks = wait_queue.tasks() print ' Queue: len = %d, state = %s' % (len(tasks), wait_queue.state()) + print ' Tasks:' + print ' Name (c:current, r:real), (id)' for t in range(0, len(tasks)): print ' ', tasks[t].brief(), ' (%08x)' % (tasks[t].id()) else: diff --git a/tools/gdb/python/objects.py b/tools/gdb/python/objects.py index 58c2730..f4ae5e1 100644 --- a/tools/gdb/python/objects.py +++ b/tools/gdb/python/objects.py @@ -253,4 +253,11 @@ class control: def name(self): is_string = information.is_string(self._id.api(), self._id._class()) - return str(name(self.object['name'], is_string)) \ No newline at end of file + val = str(name(self.object['name'],is_string)) + + # Normal comaprision is a bit tricky with quotes + # 0 '\000' in hex == '3020275c30303027' + if val.encode('hex') == '3020275c30303027': + val = "" + + return val \ No newline at end of file diff --git a/tools/gdb/python/threads.py b/tools/gdb/python/threads.py index 77c7efa..7098481 100644 --- a/tools/gdb/python/threads.py +++ b/tools/gdb/python/threads.py @@ -6,7 +6,6 @@ # import gdb - import chains import objects @@ -134,7 +133,10 @@ class control: return self.object.id() def name(self): - return self.object.name() + val = self.object.name() + if val == "": + val = '*' + return val def current_state(self): return state(self.ctrl['current_state']).to_string() -- cgit v1.2.3