Created
January 12, 2017 17:19
-
-
Save davidfooks/f88f397f809bd152ec7b676d412274dd to your computer and use it in GitHub Desktop.
Example gdb command in python
This file contains 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 characters
print("Loaded python script!") | |
import gdb | |
class HelloWorldCommand (gdb.Command): | |
"MyCommand! yay." | |
def __init__ (self): | |
super(HelloWorldCommand, self).__init__("helloworld", gdb.COMMAND_USER, gdb.COMPLETE_NONE, True) | |
def invoke(self, arg, from_tty): | |
print("Hello world") | |
print(str(arg)) | |
print(str(from_tty)) | |
HelloWorldCommand() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment