diff --git a/gui/adapt.py b/gui/adapt.py index aab72b4..f3b7bfc 100644 --- a/gui/adapt.py +++ b/gui/adapt.py @@ -19,16 +19,28 @@ import gdb import gui.params bugs = { - "15620": """Your gdb doesn't have a "new breakpoint" event. + 15620: """Your gdb doesn't have a "new breakpoint" event. This means that the source windows will not show you where breakpoints have been set.""", - "13598": """Your gdb doesn't have a "before prompt" event. + 13598: """Your gdb doesn't have a "before prompt" event. This means that various windows won't be able to react to commands like "up" or "down".""" } +_warning = "See https://sourceware.org/bugzilla/show_bug.cgi?id=%s for more information." + _first_report = True def notify_bug(bugno): - + if not gui.params.warn_missing.value: + return + if not (bugno in bugs): + return + print "################" + print bugs[bugno] + print _warning % bugno + print "" + print "You can use 'set gui mention-missing off' to disable this message." + print "################" + del bugs[bugno] diff --git a/gui/framecache.py b/gui/framecache.py index faa8d4f..dbdaf2c 100644 --- a/gui/framecache.py +++ b/gui/framecache.py @@ -15,6 +15,7 @@ import gdb import gui.events +import gui.adapt _last_selected_frame = None @@ -32,3 +33,5 @@ def check_frame(): # See my gdb branch on github. if hasattr(gdb.events, 'before_prompt'): gdb.events.before_prompt.connect(check_frame) +else: + gui.adapt.notify_bug(13598) diff --git a/gui/params.py b/gui/params.py index e324133..4cc59cf 100644 --- a/gui/params.py +++ b/gui/params.py @@ -170,6 +170,25 @@ class _Title(_StoredParameter): gui.toplevel.state.update_titles() return "" +class _Missing(_StoredParameter): + # Silly gdb requirement. + "" + + set_doc = "Set whether to mention missing gdb features." + show_doc = "Show whether to mention missing gdb features." + + def __init__(self): + super(_Missing, self).__init__('%s', 'mention-missing', True, + gdb.COMMAND_NONE, gdb.PARAM_BOOLEAN) + + @in_gdb_thread + def get_show_string(self, pvalue): + if self.value: + v = "on" + else: + v = "off" + return "Whether to warn about missing gdb features: " + v + _SetBase() _SetTitleBase() _ShowBase() @@ -180,3 +199,5 @@ font_manager = _Font() _Title('source', '\\W{basename} [GDB Source @\\W{number}]') _Title('display', '\\W{command} [GDB Display @\\W{number}]') _Title('log', '[GDB Log @\\W{number}]\\W{default}') + +warn_missing = _Missing()