From 2ea666b3ad4c9f6a2e58c969385e8e391e325ae9 Mon Sep 17 00:00:00 2001 From: Jer Noble Date: Tue, 18 Feb 2014 09:57:17 -0800 Subject: [PATCH] Added lldbinit and kdp-remote commands. --- Makefile | 4 +++- lldb/kdpReboot.py | 14 ++++++++++++++ lldbinit | 2 ++ 3 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 lldb/kdpReboot.py create mode 100644 lldbinit diff --git a/Makefile b/Makefile index 78ab1dc..7970d7c 100644 --- 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 index 0000000..13e6d62 --- /dev/null +++ b/lldb/kdpReboot.py @@ -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 [:]`." + 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 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 -- 2.40.1