warn about missing features

This commit is contained in:
Tom Tromey
2015-05-06 13:59:24 -06:00
parent f11f884f8d
commit 7956c96cae
3 changed files with 39 additions and 3 deletions

View File

@@ -19,16 +19,28 @@ import gdb
import gui.params import gui.params
bugs = { 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 This means that the source windows will not show you where
breakpoints have been set.""", 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 This means that various windows won't be able to react to
commands like "up" or "down".""" commands like "up" or "down"."""
} }
_warning = "See https://sourceware.org/bugzilla/show_bug.cgi?id=%s for more information."
_first_report = True _first_report = True
def notify_bug(bugno): 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]

View File

@@ -15,6 +15,7 @@
import gdb import gdb
import gui.events import gui.events
import gui.adapt
_last_selected_frame = None _last_selected_frame = None
@@ -32,3 +33,5 @@ def check_frame():
# See my gdb branch on github. # See my gdb branch on github.
if hasattr(gdb.events, 'before_prompt'): if hasattr(gdb.events, 'before_prompt'):
gdb.events.before_prompt.connect(check_frame) gdb.events.before_prompt.connect(check_frame)
else:
gui.adapt.notify_bug(13598)

View File

@@ -170,6 +170,25 @@ class _Title(_StoredParameter):
gui.toplevel.state.update_titles() gui.toplevel.state.update_titles()
return "" 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() _SetBase()
_SetTitleBase() _SetTitleBase()
_ShowBase() _ShowBase()
@@ -180,3 +199,5 @@ font_manager = _Font()
_Title('source', '\\W{basename} [GDB Source @\\W{number}]') _Title('source', '\\W{basename} [GDB Source @\\W{number}]')
_Title('display', '\\W{command} [GDB Display @\\W{number}]') _Title('display', '\\W{command} [GDB Display @\\W{number}]')
_Title('log', '[GDB Log @\\W{number}]\\W{default}') _Title('log', '[GDB Log @\\W{number}]\\W{default}')
warn_missing = _Missing()