1 # Copyright (C) 2010-2012 Free Software Foundation, Inc.
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; either version 3 of the License, or
6 # (at your option) any later version.
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
13 # You should have received a copy of the GNU General Public License
14 # along with this program. If not, see <http://www.gnu.org/licenses/>.
18 # Auto-load all functions/commands.
20 # Modules to auto-load, and the paths where those modules exist.
23 'gdb.function': os
.path
.join(gdb
.PYTHONDIR
, 'gdb', 'function'),
24 'gdb.command': os
.path
.join(gdb
.PYTHONDIR
, 'gdb', 'command')
27 # Iterate the dictionary, collating the Python files in each module
28 # path. Construct the module name, and import.
30 for module
, location
in module_dict
.iteritems():
31 if os
.path
.exists(location
):
32 py_files
= filter(lambda x
: x
.endswith('.py') and x
!= '__init__.py',
35 for py_file
in py_files
:
36 # Construct from foo.py, gdb.module.foo
37 py_file
= module
+ '.' + py_file
[:-3]
39 exec('import ' + py_file
)
41 print >> sys
.stderr
, traceback
.format_exc()
This page took 0.030875 seconds and 5 git commands to generate.