mirror of
https://github.com/tromey/gdb-gui.git
synced 2025-12-16 07:10:04 +01:00
warn about missing features
This commit is contained in:
18
gui/adapt.py
18
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]
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user