Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
devops
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
devops
Commits
f9ae1831
Commit
f9ae1831
authored
Sep 20, 2021
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pyinject.gdb: GDB commands to inspect Python processes by injecting/running Python code
parent
ac28b90c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
0 deletions
+21
-0
pyinject.gdb
pyinject.gdb
+21
-0
No files found.
pyinject.gdb
0 → 100644
View file @
f9ae1831
# pyinject.gdb provides GDB commands to inject code into Python processes.
# see also: https://pyrasite.readthedocs.io/
# xpyrun "<code>" runs python <code>.
define xpyrun
set $_gstate = (int)PyGILState_Ensure()
set $_unused_int = (int)PyRun_SimpleString($arg0)
set $_unused_void = (void)PyGILState_Release($_gstate)
end
# xpybt prints python-level backtrace to program stdout.
define xpybt
xpyrun "import traceback; traceback.print_stack()"
end
# xpymemtop prints top py-memory usage to program stdout.
define xpymemtop
xpyrun "import objgraph; objgraph.show_most_common_types()"
end
# vim: ft=gdb
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment