Changeset 10bcd5d in rtems-tools for tools/gdb


Ignore:
Timestamp:
Jun 24, 2013, 4:10:59 AM (6 years ago)
Author:
Dhananjay Balan <mb.dhananjay@…>
Branches:
4.10, 4.11, e9f48e9face6c4dea62712d73b35412c0fe10332
Children:
ce55b57
Parents:
56a70ae
git-author:
Dhananjay Balan <mb.dhananjay@…> (06/24/13 04:10:59)
git-committer:
Chris Johns <chrisj@…> (08/24/14 23:52:40)
Message:

Update chains structures

  • Fixes chains structure parsing
  • Fix Semaphore node parsing
Location:
tools/gdb/python
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • tools/gdb/python/chains.py

    r56a70ae r10bcd5d  
    1515
    1616    def null(self):
    17         return self.node_val['next'] == 0
     17        if not self.node_val:
     18            return True
     19        return False
    1820
    1921    def next(self):
    2022        if not self.null():
    21             self.node_val = self.node_val['next'].dereference()
     23            self.node_val = self.node_val['next']
    2224
    2325    def previous(self):
    2426        if not self.null():
    25             self.node_val = self.node_val['previous'].dereference()
     27            self.node_val = self.node_val['previous']
    2628
    2729    def cast(self, typename):
     
    3032            return self.node_val.cast(nodetype)
    3133        return None
     34
    3235
    3336class control:
     
    3841
    3942    def first(self):
    40         return node(self.ctrl['first'].dereference())
     43        t = node(self.ctrl['Head']['Node'])
     44        return t
    4145
    4246    def last(self):
  • tools/gdb/python/objects.py

    r56a70ae r10bcd5d  
    6363            _class = id._class()
    6464            index = id.index()
     65        return self.object_return(api, _class, index)
     66
     67    def object_return(self, api, _class, index):
    6568        n = self.name(api, _class)
    6669        self.load(n)
     
    97100          'node':  (16, 23),
    98101          'api':   (24, 26),
    99           'class': (27, 31) } 
     102          'class': (27, 31) }
    100103        ]
    101104
     
    148151                   'fixed_memory_pools')
    149152        }
    150    
     153
    151154    def __init__(self, id):
    152155        if type(id) != gdb.Value and type(id) != int and type(id) != unicode:
  • tools/gdb/python/threads.py

    r56a70ae r10bcd5d  
    1515    node = chain.first()
    1616    while not node.null():
    17         print node.addr
    1817        tasks.append(control(node.cast('Thread_Control')))
    1918        node.next()
     
    6362        WAITING_ON_THREAD_QUEUE | \
    6463        INTERRUPTIBLE_BY_SIGNAL
    65    
     64
    6665    masks = {
    6766        ALL_SET : 'all-set',
     
    8685        WAITING_FOR_RWLOCK : 'waiting-for-rwlock'
    8786        }
    88        
     87
    8988    def __init__(self, s):
    9089        self.s = s
     
    122121    def block2n(self):
    123122        return task_chain(chains.control(self.info['Block2n']))
    124        
     123
    125124    def queue(self):
    126125        return task_chain(chains.control(self.info['queue']))
    127126
    128127class control:
    129    
     128
    130129    def __init__(self, ctrl):
    131130        self.ctrl = ctrl
    132131        self.object = objects.control(ctrl['Object'])
    133        
     132
    134133    def id(self):
    135134        return self.object.id()
     
    182181    def state(self):
    183182        return state(self.que['state']).to_string()
    184        
     183
    185184    def tasks(self):
    186185        if self.fifo():
     
    189188            t = []
    190189            for ph in range(0, self.priority_headers):
    191                 t.extend(task_chain(chains.control(self.que['Queues']['Fifo'])))
     190                t.extend(task_chain(chains.control( \
     191                    self.que['Queues']['Priority'][ph])))
    192192        return t
    193193
Note: See TracChangeset for help on using the changeset viewer.