Last active
March 17, 2025 17:13
-
-
Save tyhoff/060e480b6cf9ad35dfd2ba9d01cad4b6 to your computer and use it in GitHub Desktop.
Revisions
-
tyhoff revised this gist
Apr 13, 2020 . No changes.There are no files selected for viewing
-
tyhoff revised this gist
Apr 13, 2020 . No changes.There are no files selected for viewing
-
tyhoff revised this gist
Apr 12, 2020 . 1 changed file with 4 additions and 6 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,11 +5,9 @@ # Convert GDB to interpret in Python python import os,subprocess,sys # Execute a Python using the user's shell and pull out the sys.path (for site-packages) paths = subprocess.check_output('python -c "import os,sys;print(os.linesep.join(sys.path).strip())"',shell=True).decode("utf-8").split() # Extend GDB's Python's search path sys.path.extend(paths) end -
tyhoff revised this gist
Jul 25, 2019 . No changes.There are no files selected for viewing
-
tyhoff created this gist
Jul 15, 2019 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,15 @@ # All of your normal .gdbinit commands, functions, and setup tasks # Update GDB's Python paths with the `sys.path` values of the local Python installation, # whether that is brew'ed Python, a virtualenv, or another system python. # Convert GDB to interpret in Python python import sys import os import subprocess # Execute a Python using the user's shell and pull out the sys.path from that version paths = eval(subprocess.check_output('python -c "import sys;print(sys.path)"', shell=True).strip()) # Extend the current GDB instance's Python paths sys.path.extend(paths) end