mirror of
https://github.com/tromey/gdb-gui.git
synced 2025-12-16 07:10:04 +01:00
allow breakpoint deletion from source window
This commit is contained in:
@@ -50,6 +50,12 @@ def _breakpoint_deleted(bp):
|
||||
if len(_breakpoint_source_map[entry]) == 0:
|
||||
gui.events.location_changed.post(entry, False)
|
||||
|
||||
def any_breakpoint_at(filename, lineno):
|
||||
entry = (filename, lineno)
|
||||
if entry not in _breakpoint_source_map:
|
||||
return False
|
||||
return len(_breakpoint_source_map[entry]) > 0
|
||||
|
||||
if not hasattr(gdb.events, 'breakpoint_created'):
|
||||
gui.adapt.notify_bug(15620)
|
||||
else:
|
||||
|
||||
@@ -313,8 +313,12 @@ class SourceWindow(gui.updatewindow.UpdateWindow):
|
||||
return
|
||||
if event.button.get_button()[1] != 1:
|
||||
return
|
||||
fun = Invoker("break %s:%d" % (self.view.get_buffer().filename,
|
||||
textiter.get_line() + 1))
|
||||
filename = self.view.get_buffer().filename
|
||||
line = textiter.get_line() + 1
|
||||
if gui.bpcache.any_breakpoint_at(filename, line):
|
||||
fun = Invoker("clear %s:%d" % (filename,line))
|
||||
else:
|
||||
fun = Invoker("break %s:%d" % (filename, line))
|
||||
fun()
|
||||
|
||||
def _do_scroll(self, buff, srcline):
|
||||
|
||||
Reference in New Issue
Block a user