source: rtems-tools/tools/gdb/python/configuration.py @ 3162858

4.104.115
Last change on this file since 3162858 was 3162858, checked in by Chris Johns <chrisj@…>, on 08/26/14 at 04:57:57

gdb-python: Update so 'rtems task' lists the classic tasks.

This is a first pass at cleaning up the support. To use:

$ waf configure --prefix=$HOME/development/rtems/4.11
$ waf build install

Start GDB and break at Init:

(gdb) py import rtems
(gdb) rtems task

will list the classic API tasks.

  • Property mode set to 100644
File size: 3.3 KB
Line 
1# RTEMS Tools Project (http://www.rtems.org/)
2# Copyright 2014 Chris Johns (chrisj@rtems.org)
3# All rights reserved.
4#
5# This file is part of the RTEMS Tools package in 'rtems-tools'.
6#
7# Redistribution and use in source and binary forms, with or without
8# modification, are permitted provided that the following conditions are met:
9#
10# 1. Redistributions of source code must retain the above copyright notice,
11# this list of conditions and the following disclaimer.
12#
13# 2. Redistributions in binary form must reproduce the above copyright notice,
14# this list of conditions and the following disclaimer in the documentation
15# and/or other materials provided with the distribution.
16#
17# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
21# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27# POSSIBILITY OF SUCH DAMAGE.
28#
29
30#
31# RTEMS Configuration Table
32#
33
34import gdb
35
36def _table():
37    return gdb.parse_and_eval('Configuration')
38
39def fields():
40    return [field.name for field in _table().type.fields()]
41
42def mp():
43    return '_Configuration_MP_table' in fields()
44
45def smp():
46    if 'smp_enabled' in fields():
47        return int(_table()['smp_enabled']) != 0
48    return False
49
50def maximum_processors():
51    if smp():
52        return int(_table()['maximum_processors'])
53    return 1
54
55def work_space_size():
56    return long(_table()['work_space_size'])
57
58def stack_space_size():
59    return long(_table()['stack_space_size'])
60
61def maximum_extensions():
62    return long(_table()['maximum_extensions'])
63
64def maximum_keys():
65    return long(_table()['maximum_keys'])
66
67def maximum_key_value_pairs():
68    return long(_table()['maximum_key_value_pairs'])
69
70def microseconds_per_tick():
71    return long(_table()['microseconds_per_tick'])
72
73def nanoseconds_per_tick():
74    return long(_table()['nanoseconds_per_tick'])
75
76def ticks_per_timeslice():
77    return long(_table()['ticks_per_timeslice'])
78
79def idle_task():
80    return long(_table()['idle_task'])
81
82def idle_task_stack_size():
83    return long(_table()['idle_task_stack_size'])
84
85def interrupt_stack_size():
86    return long(_table()['interrupt_stack_size'])
87
88def stack_allocate_init_hook():
89    return long(_table()['stack_allocate_init_hook'])
90
91def stack_allocate_hook():
92    return long(_table()['stack_allocate_hook'])
93
94def stack_free_hook():
95    return long(_table()['stack_free_hook'])
96
97def do_zero_of_workspace():
98    return int(_table()['do_zero_of_workspace']) != 0
99
100def unified_work_area():
101    return int(_table()['unified_work_area']) != 0
102
103def stack_allocator_avoids_work_space():
104    return long(_table()['stack_allocator_avoids_work_space'])
105
106def number_of_initial_extensions():
107    return int(_table()['number_of_initial_extensions'])
108
109def user_extension_table():
110    return _table()['User_extension_table']
Note: See TracBrowser for help on using the repository browser.