aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Kiszka <jan.kiszka@siemens.com>2015-02-17 16:47:52 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2015-02-17 17:34:55 -0500
commita9c5bcfa43420365535ef42c1ff1e83aa056f25e (patch)
tree5eb8b9f771cc15f370316a73849d57b46b35998d
parent158daf167377dfc49ce6d70f70fd7c6fab2df987 (diff)
scripts/gdb: disable pagination while printing from breakpoint handler
While reporting the (refreshed) list of modules on automatic updates we may hit the page boundary of the output console and cause a stop if pagination is enabled. However, gdb does not accept user input while running over the breakpoint handler. So we get stuck, and the user is forced to interrupt gdb. Resolve this by disabling pagination during automatic symbol updates. We restore the user's configuration once done. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Jason Wessel <jason.wessel@windriver.com> Cc: Andi Kleen <andi@firstfloor.org> Cc: Ben Widawsky <ben@bwidawsk.net> Cc: Borislav Petkov <bp@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--scripts/gdb/linux/symbols.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/scripts/gdb/linux/symbols.py b/scripts/gdb/linux/symbols.py
index bf05e451c586..cd5bea965d4e 100644
--- a/scripts/gdb/linux/symbols.py
+++ b/scripts/gdb/linux/symbols.py
@@ -34,12 +34,23 @@ if hasattr(gdb, 'Breakpoint'):
34 # enforce update if object file is not found 34 # enforce update if object file is not found
35 cmd.module_files_updated = False 35 cmd.module_files_updated = False
36 36
37 # Disable pagination while reporting symbol (re-)loading.
38 # The console input is blocked in this context so that we would
39 # get stuck waiting for the user to acknowledge paged output.
40 show_pagination = gdb.execute("show pagination", to_string=True)
41 pagination = show_pagination.endswith("on.\n")
42 gdb.execute("set pagination off")
43
37 if module_name in cmd.loaded_modules: 44 if module_name in cmd.loaded_modules:
38 gdb.write("refreshing all symbols to reload module " 45 gdb.write("refreshing all symbols to reload module "
39 "'{0}'\n".format(module_name)) 46 "'{0}'\n".format(module_name))
40 cmd.load_all_symbols() 47 cmd.load_all_symbols()
41 else: 48 else:
42 cmd.load_module_symbols(module) 49 cmd.load_module_symbols(module)
50
51 # restore pagination state
52 gdb.execute("set pagination %s" % ("on" if pagination else "off"))
53
43 return False 54 return False
44 55
45 56