Files
gdb-gui/gui/events.py
Tom Tromey ca645d2e80 add frame support
if you have a gdb that can wrap commands (not yet upstream)
then up/down/frame commands will update the source window
when a selected-frame event is available, we can change
the code to use that instead
2013-06-17 20:30:36 -06:00

33 lines
1007 B
Python

# Copyright (C) 2013 Tom Tromey <tom@trolley.com>
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import gdb
class _Event(object):
def __init__(self):
self.funcs = []
def connect(self, callback):
self.funcs.append(callback)
def disconnect(self, callback):
self.funcs.remove(callback)
def post(self):
for fun in self.funcs:
fun()
frame_changed = _Event()