mirror of
https://github.com/tromey/gdb-gui.git
synced 2025-12-16 07:10:04 +01:00
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
This commit is contained in:
32
gui/events.py
Normal file
32
gui/events.py
Normal file
@@ -0,0 +1,32 @@
|
||||
# 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()
|
||||
Reference in New Issue
Block a user