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
ln -fs $^ $@
~/.zlogin: $(DOTFILES)/zsh_login
ln -fs $^ $@
+~/.lldbinit: $(DOTFILES)/lldbinit
+ ln -fs $^ $@
\ No newline at end of file
--- /dev/null
+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')