summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDhananjay Balan <mb.dhananjay@gmail.com>2013-08-24 20:26:06 +0530
committerChris Johns <chrisj@rtems.org>2014-08-25 09:52:41 +1000
commit7a415d4e43de67e0eabcca3a1375c4e530f37a07 (patch)
treeec23de4245f303b20e3713d006ba91397981ea74
parenta245635a2e3c7b9ef5ebfc480b6115544c3d4340 (diff)
downloadrtems-tools-7a415d4e43de67e0eabcca3a1375c4e530f37a07.tar.bz2
Catch empty task names,
- All the tasks do not have a name.
-rw-r--r--tools/gdb/python/classic.py2
-rw-r--r--tools/gdb/python/objects.py9
-rw-r--r--tools/gdb/python/threads.py6
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()