Handle gdb-pt-dump permission error gracefully (#1426)

pull/1429/head
Gulshan Singh 3 years ago committed by GitHub
parent d52011877b
commit 5b32e6831c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -404,7 +404,17 @@ def kernel_vmmap_via_page_tables():
import pt
p = pt.PageTableDump()
p.lazy_init()
try:
p.lazy_init()
except PermissionError:
print(
M.error(
"Permission error when attempting to parse page tables with gdb-pt-dump.\n"
+ "Either change the kernel-vmmap setting, re-run GDB as root, or disable `ptrace_scope` (`echo 0 | sudo tee /proc/sys/kernel/yama`)"
)
)
return tuple([])
pages = p.backend.parse_tables(p.cache, p.parser.parse_args(""))
retpages = []

Loading…
Cancel
Save