Fix #111961 r=Mark-Simulacrum
Makes the Python pretty printer library source'able from within GDB after spawn. This makes `rust-gdb` not the required approach. It also provides the possibility for GUI:s that wrap GDB, to debug Rust using the pretty printer library; as well as other projects such as for instance Pernosco, which previously was not possible. This won't introduce any new unexpected behaviors for users of `rust-gdb`
This commit is contained in:
parent
cade26637f
commit
c5145dc87a
1 changed files with 12 additions and 1 deletions
|
|
@ -1,3 +1,14 @@
|
|||
# Add this folder to the python sys path; GDB Python-interpreter will now find modules in this path
|
||||
import sys
|
||||
from os import path
|
||||
self_dir = path.dirname(path.realpath(__file__))
|
||||
sys.path.append(self_dir)
|
||||
|
||||
import gdb
|
||||
import gdb_lookup
|
||||
gdb_lookup.register_printers(gdb.current_objfile())
|
||||
|
||||
# current_objfile can be none; even with `gdb foo-app`; sourcing this file after gdb init now works
|
||||
try:
|
||||
gdb_lookup.register_printers(gdb.current_objfile())
|
||||
except Exception:
|
||||
gdb_lookup.register_printers(gdb.selected_inferior().progspace)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue