]> id.pley.net Git - dotfiles.git/commitdiff
Added lldbinit and kdp-remote commands.
authorJer Noble <jer.noble@apple.com>
Tue, 18 Feb 2014 17:57:17 +0000 (09:57 -0800)
committerJer Noble <jer.noble@apple.com>
Tue, 18 Feb 2014 17:57:17 +0000 (09:57 -0800)
Makefile
lldb/kdpReboot.py [new file with mode: 0644]
lldbinit [new file with mode: 0644]

index 78ab1dc11ba257b17aa44803be25e6482a254e13..7970d7c02e3e9bf0c82be8789bedd7d8439b026d 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
 DOTFILES := $(shell pwd)
 
-all: ~/.aliases ~/.bash_login ~/.ssh/ssh_config ~/.vimrc ~/.zlogin
+all: ~/.aliases ~/.bash_login ~/.ssh/ssh_config ~/.vimrc ~/.zlogin ~/.lldbinit
 ~/.aliases: $(DOTFILES)/aliases
        ln -fs $^ $@
 ~/.bash_login: $(DOTFILES)/bash_login
@@ -11,3 +11,5 @@ all: ~/.aliases ~/.bash_login ~/.ssh/ssh_config ~/.vimrc ~/.zlogin
        ln -fs $^ $@
 ~/.zlogin: $(DOTFILES)/zsh_login
        ln -fs $^ $@
+~/.lldbinit: $(DOTFILES)/lldbinit
+       ln -fs $^ $@
\ No newline at end of file
diff --git a/lldb/kdpReboot.py b/lldb/kdpReboot.py
new file mode 100644 (file)
index 0000000..13e6d62
--- /dev/null
@@ -0,0 +1,14 @@
+import lldb
+
+def kdpReboot(debugger, command, result, internal_dict):
+    if not "kdp" in debugger.GetSelectedTarget().GetProcess().GetPluginName().lower():
+        print "Target is not connected over kdp. Connect to a remote machine with `kdp-remote <hostname>[:<portnum>]`."
+        return False
+
+    print "Rebooting the remote machine."
+    debugger.HandleCommand('process plugin packet send --command 0x13')
+    debugger.HandleCommand('detach')
+    return True
+
+def __lldb_init_module(debugger, internal_dict):
+    debugger.HandleCommand('command script add -f kdpReboot.kdpReboot kdp-reboot')
diff --git a/lldbinit b/lldbinit
new file mode 100644 (file)
index 0000000..c0b50b9
--- /dev/null
+++ b/lldbinit
@@ -0,0 +1,2 @@
+command script import ~/Projects/WebKit.git/OpenSource/Tools/lldb/lldb_webkit.py
+command script import ~/.dotfiles/lldb/kdpReboot.py