diff --git a/Makefile b/Makefile index 702cf98..fe2976f 100644 --- a/Makefile +++ b/Makefile @@ -1,2 +1,5 @@ all: cd padre && cargo build + +clean: + cd padre && cargo clean diff --git a/autoload/padre/debugger.vim b/autoload/padre/debugger.vim index e9a189f..6c56e4f 100644 --- a/autoload/padre/debugger.vim +++ b/autoload/padre/debugger.vim @@ -135,7 +135,7 @@ function! padre#debugger#Debug(...) endfunction function! padre#debugger#Run() - call padre#socket#Send({"cmd": "run"}, function('padre#debugger#RunCallback')) + call padre#socket#Send({"cmd": "run"}, function('padre#debugger#GenericCallback')) endfunction function! padre#debugger#Stop() @@ -161,7 +161,7 @@ function! padre#debugger#Stop() endfunction function! s:SetBreakpointInDebugger(line, file) - call padre#socket#Send({"cmd": "breakpoint", "file": a:file, "line": str2nr(a:line)}, function('padre#debugger#BreakpointCallback')) + call padre#socket#Send({"cmd": "breakpoint", "file": a:file, "line": str2nr(a:line)}, function('padre#debugger#GenericCallback')) endfunction function! padre#debugger#Breakpoint() @@ -173,19 +173,19 @@ function! padre#debugger#Breakpoint() endfunction function! padre#debugger#StepIn() - call padre#socket#Send({"cmd": "stepIn"}, function('padre#debugger#StepInCallback')) + call padre#socket#Send({"cmd": "stepIn"}, function('padre#debugger#GenericCallback')) endfunction function! padre#debugger#StepOver() - call padre#socket#Send({"cmd": "stepOver"}, function('padre#debugger#StepOverCallback')) + call padre#socket#Send({"cmd": "stepOver"}, function('padre#debugger#GenericCallback')) endfunction function! padre#debugger#PrintVariable(variable) - call padre#socket#Send({"cmd": "print", "variable": a:variable}, function('padre#debugger#PrintVariableCallback')) + call padre#socket#Send({"cmd": "print", "variable": a:variable}, function('padre#debugger#GenericCallback')) endfunction function! padre#debugger#Continue() - call padre#socket#Send({"cmd": "continue"}, function('padre#debugger#ContinueCallback')) + call padre#socket#Send({"cmd": "continue"}, function('padre#debugger#GenericCallback')) endfunction """""""""""""""" @@ -198,63 +198,12 @@ function! padre#debugger#SignalPADREStarted() endfor endfunction -function! padre#debugger#RunCallback(channel_id, data) +function! padre#debugger#GenericCallback(channel_id, data) if a:data['status'] != 'OK' call padre#debugger#Log(2, 'Error: ' . string(a:data)) - return - endif - - if has_key(a:data, 'pid') - call padre#debugger#Log(4, 'Process ' . a:data['pid'] . ' Running') endif endfunction -function! padre#debugger#BreakpointCallback(channel_id, data) - if a:data['status'] == 'OK' - elseif a:data['status'] == 'PENDING' - call padre#debugger#Log(4, 'Breakpoint pending') - else - call padre#debugger#Log(2, 'Error: ' . string(a:data)) - endif -endfunction - -function! padre#debugger#BreakpointSet(fileName, lineNum) - let l:msg = 'Breakpoint set file=' . a:fileName . ', line=' . a:lineNum - call padre#debugger#Log(4, l:msg) -endfunction - -function! padre#debugger#StepInCallback(channel_id, data) - if a:data['status'] != 'OK' - call padre#debugger#Log(2, 'Error: ' . string(a:data)) - endif -endfunction - -function! padre#debugger#StepOverCallback(channel_id, data) - if a:data['status'] != 'OK' - call padre#debugger#Log(2, 'Error: ' . string(a:data)) - endif -endfunction - -function! padre#debugger#ContinueCallback(channel_id, data) - if a:data['status'] != 'OK' - call padre#debugger#Log(2, 'Error: ' . string(a:data)) - endif -endfunction - -function! padre#debugger#PrintVariableCallback(channel_id, data) - let l:status = remove(a:data, 'status') - if l:status != 'OK' - call padre#debugger#Log(2, 'Error printing variable: ' . string(a:data)) - return - endif - - let l:variable_name = remove(a:data, 'variable') - - execute "let l:json = system('python -m json.tool', '" . substitute(json_encode(a:data), "'", "''", "g") . "')" - let l:msg = 'Variable ' . l:variable_name . "=\n" . l:json - call padre#debugger#Log(4, l:msg) -endfunction - function! padre#debugger#JumpToPosition(file, line) let l:msg = 'Stopped file=' . a:file . ' line=' . a:line call padre#debugger#Log(4, l:msg) diff --git a/ci/install-rust.yml b/ci/install-rust.yml index 8504c12..4274253 100644 --- a/ci/install-rust.yml +++ b/ci/install-rust.yml @@ -2,7 +2,8 @@ steps: - script: | set -e curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain stable - echo "##vso[task.setvariable variable=PATH;]$PATH:$HOME/.cargo/bin" + echo "##vso[task.setvariable variable=PATH;]$HOME/.cargo/bin:$PATH" + rustup update displayName: Install rust - script: | diff --git a/padre/Cargo.lock b/padre/Cargo.lock index ee9f9ab..d94a29e 100644 --- a/padre/Cargo.lock +++ b/padre/Cargo.lock @@ -2,1415 +2,972 @@ # It is not intended for manual editing. [[package]] name = "aho-corasick" -version = "0.7.6" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8716408b8bc624ed7f65d223ddb9ac2d044c0547b6fa4b0d554f3a9540496ada" dependencies = [ - "memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "memchr", ] [[package]] name = "ansi_term" version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b" dependencies = [ - "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.8", ] [[package]] name = "arc-swap" -version = "0.4.2" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7b8a9123b8027467bce0099fe556c628a53c8d83df0507084c31e9ba2e39aff" [[package]] -name = "arrayvec" -version = "0.4.11" +name = "atty" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" dependencies = [ - "nodrop 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", + "hermit-abi", + "libc", + "winapi 0.3.8", ] [[package]] -name = "atty" -version = "0.2.13" +name = "base64" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", -] +checksum = "b41b7ea54a0c9d92199de89e20e58d49f02f8e699814ef3fdf266f6f748d15c7" [[package]] -name = "autocfg" -version = "0.1.6" +name = "bitflags" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" [[package]] -name = "base64" -version = "0.9.3" +name = "block-buffer" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0940dc441f31689269e10ac70eb1002a3a1d3ad1390e030043662eb7fe4688b" dependencies = [ - "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "safemem 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "block-padding", + "byte-tools", + "byteorder", + "generic-array", ] [[package]] -name = "base64" -version = "0.10.1" +name = "block-padding" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa79dedbb091f449f1f39e53edf88d5dbe95f895dae6135a8d7b881fb5af73f5" dependencies = [ - "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "byte-tools", ] [[package]] -name = "bitflags" -version = "1.1.0" +name = "byte-tools" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" [[package]] name = "byteorder" -version = "1.3.2" +version = "1.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de" [[package]] name = "bytes" -version = "0.4.12" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", -] +checksum = "130aac562c0dd69c56b3b1cc8ffd2e17be31d0b6c25b61c96b76231aa23e39e1" [[package]] name = "c2-chacha" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "214238caa1bf3a496ec3392968969cab8549f96ff30652c9e56885329315f6bb" dependencies = [ - "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "ppv-lite86 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "ppv-lite86", ] -[[package]] -name = "cc" -version = "1.0.40" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "cfg-if" -version = "0.1.9" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" [[package]] name = "clap" version = "2.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5067f5bb2d80ef5d68b4c87db81601f0b75bca627bc2ef76b141d7b846a3c6d9" dependencies = [ - "ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", - "atty 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", - "bitflags 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "strsim 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", - "textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", - "unicode-width 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "vec_map 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ansi_term", + "atty", + "bitflags", + "strsim", + "textwrap", + "unicode-width", + "vec_map", ] [[package]] -name = "cloudabi" -version = "0.0.3" +name = "digest" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5" dependencies = [ - "bitflags 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "generic-array", ] [[package]] -name = "core-foundation" -version = "0.6.4" +name = "fake-simd" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "core-foundation-sys 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", -] +checksum = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" [[package]] -name = "core-foundation-sys" -version = "0.6.2" +name = "fnv" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fad85553e09a6f881f739c29f0b00b0f01357c743266d478b68951ce23285f3" [[package]] -name = "crossbeam-deque" -version = "0.7.1" +name = "fuchsia-zircon" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" dependencies = [ - "crossbeam-epoch 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", - "crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", + "bitflags", + "fuchsia-zircon-sys", ] [[package]] -name = "crossbeam-epoch" -version = "0.7.2" +name = "fuchsia-zircon-sys" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" + +[[package]] +name = "futures" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c329ae8753502fb44ae4fc2b622fa2a94652c41e795143765ba0927f92ab780" dependencies = [ - "arrayvec 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)", - "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", - "crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "memoffset 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", - "scopeguard 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", ] [[package]] -name = "crossbeam-queue" -version = "0.1.2" +name = "futures-channel" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0c77d04ce8edd9cb903932b608268b3fffec4163dc053b3b402bf47eac1f1a8" dependencies = [ - "crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-core", + "futures-sink", ] [[package]] -name = "crossbeam-utils" -version = "0.6.6" +name = "futures-core" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f25592f769825e89b92358db00d26f965761e094951ac44d3663ef25b7ac464a" + +[[package]] +name = "futures-executor" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f674f3e1bcb15b37284a90cedf55afdba482ab061c407a9c0ebbd0f3109741ba" dependencies = [ - "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-core", + "futures-task", + "futures-util", ] [[package]] -name = "fnv" -version = "1.0.6" +name = "futures-io" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a638959aa96152c7a4cddf50fcb1e3fede0583b27157c26e67d6f99904090dc6" [[package]] -name = "foreign-types" -version = "0.3.2" +name = "futures-macro" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a5081aa3de1f7542a794a397cde100ed903b0630152d0973479018fd85423a7" dependencies = [ - "foreign-types-shared 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro-hack", + "proc-macro2", + "quote", + "syn", ] [[package]] -name = "foreign-types-shared" -version = "0.1.1" +name = "futures-sink" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3466821b4bc114d95b087b850a724c6f83115e929bc88f1fa98a3304a944c8a6" [[package]] -name = "fuchsia-cprng" -version = "0.1.1" +name = "futures-task" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b0a34e53cf6cdcd0178aa573aed466b646eb3db769570841fda0c7ede375a27" [[package]] -name = "fuchsia-zircon" -version = "0.3.3" +name = "futures-util" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22766cf25d64306bedf0384da004d05c9974ab104fcc4528f1236181c18004c5" dependencies = [ - "bitflags 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-utils", + "proc-macro-hack", + "proc-macro-nested", + "slab", ] [[package]] -name = "fuchsia-zircon-sys" -version = "0.3.3" +name = "generic-array" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c68f0274ae0e023facc3c97b2e00f076be70e254bc851d972503b328db79b2ec" +dependencies = [ + "typenum", +] [[package]] -name = "futures" -version = "0.1.28" +name = "getrandom" +version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7abc8dd8451921606d809ba32e95b6111925cd2906060d2dcc29c070220503eb" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] [[package]] -name = "getrandom" -version = "0.1.11" +name = "hermit-abi" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1010591b26bbfe835e9faeabeb11866061cc7dcebffd56ad7d0942d0e61aefd8" dependencies = [ - "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", - "wasi 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libc", +] + +[[package]] +name = "http" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b708cc7f06493459026f53b9a61a7a121a5d1ec6238dee58ea4941132b30156b" +dependencies = [ + "bytes", + "fnv", + "itoa", ] [[package]] name = "httparse" version = "1.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd179ae861f0c2e53da70d892f5f3029f9594be0c41dc5269cd371691b1dc2f9" [[package]] -name = "hyper" -version = "0.10.16" +name = "idna" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02e2673c30ee86b5b96a9cb52ad15718aa1f966f5ab9ad54a8b95d5ca33120a9" dependencies = [ - "base64 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)", - "httparse 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "language-tags 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", - "mime 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", - "num_cpus 1.10.1 (registry+https://github.com/rust-lang/crates.io-index)", - "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", - "traitobject 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "typeable 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "unicase 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", + "matches", + "unicode-bidi", + "unicode-normalization", ] [[package]] -name = "idna" -version = "0.1.5" +name = "input_buffer" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19a8a95243d5a0398cae618ec29477c6e3cb631152be5c19481f80bc71559754" dependencies = [ - "matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", - "unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "unicode-normalization 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes", ] [[package]] name = "iovec" -version = "0.1.2" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2b3ea6ff95e175473f8ffe6a7eb7c00d054240321b84c57051175fe3c1e075e" dependencies = [ - "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + "libc", ] [[package]] name = "itoa" -version = "0.4.4" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8b7a7c0c47db5545ed3fef7468ee7bb5b74691498139e4b3f6a20685dc6dd8e" [[package]] name = "kernel32-sys" version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" dependencies = [ - "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.2.8", + "winapi-build", ] -[[package]] -name = "language-tags" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "lazy_static" -version = "1.3.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.62" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "lock_api" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "owning_ref 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "log" -version = "0.3.9" +version = "0.2.67" source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", -] +checksum = "eb147597cdf94ed43ab7a9038716637d2d1bf2bc571da995d0028dec06bd3018" [[package]] name = "log" version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7" dependencies = [ - "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if", ] [[package]] name = "matches" version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" [[package]] name = "memchr" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "memoffset" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "mime" -version = "0.2.6" +version = "2.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", -] +checksum = "3728d817d99e5ac407411fa471ff9800a778d88a24685968b36824eaf4bee400" [[package]] name = "mio" -version = "0.6.19" +version = "0.6.21" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "302dec22bcf6bae6dfb69c647187f4b4d0fb6f535521f7bc022430ce8e12008f" dependencies = [ - "fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", - "fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", - "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "miow 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)", - "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if", + "fuchsia-zircon", + "fuchsia-zircon-sys", + "iovec", + "kernel32-sys", + "libc", + "log", + "miow 0.2.1", + "net2", + "slab", + "winapi 0.2.8", ] [[package]] name = "mio-named-pipes" version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f5e374eff525ce1c5b7687c4cef63943e7686524a387933ad27ca7ec43779cb3" dependencies = [ - "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "mio 0.6.19 (registry+https://github.com/rust-lang/crates.io-index)", - "miow 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", + "log", + "mio", + "miow 0.3.3", + "winapi 0.3.8", ] [[package]] name = "mio-uds" version = "0.6.7" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "966257a94e196b11bb43aca423754d87429960a768de9414f3691d6957abf125" dependencies = [ - "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", - "mio 0.6.19 (registry+https://github.com/rust-lang/crates.io-index)", + "iovec", + "libc", + "mio", ] [[package]] name = "miow" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c1f2f3b1cf331de6896aabf6e9d55dca90356cc9960cca7eaaf408a355ae919" dependencies = [ - "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", - "ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "kernel32-sys", + "net2", + "winapi 0.2.8", + "ws2_32-sys", ] [[package]] name = "miow" version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "396aa0f2003d7df8395cb93e09871561ccc3e785f0acb369170e8cc74ddf9226" dependencies = [ - "socket2 0.3.11 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "native-tls" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "openssl 0.10.24 (registry+https://github.com/rust-lang/crates.io-index)", - "openssl-probe 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "openssl-sys 0.9.49 (registry+https://github.com/rust-lang/crates.io-index)", - "schannel 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)", - "security-framework 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "security-framework-sys 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "tempfile 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "socket2", + "winapi 0.3.8", ] [[package]] name = "net2" version = "0.2.33" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42550d9fb7b6684a6d404d9fa7250c2eb2646df731d1c06afc06dcee9e1bcf88" dependencies = [ - "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if", + "libc", + "winapi 0.3.8", ] [[package]] -name = "nodrop" -version = "0.1.13" +name = "opaque-debug" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c" [[package]] -name = "num_cpus" -version = "1.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" +name = "padre" +version = "0.2.0" dependencies = [ - "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", + "clap", + "futures", + "padre_core", + "padre_lldb", + "padre_node", + "padre_python", + "serde", + "serde_derive", + "serde_json", + "tokio", ] [[package]] -name = "openssl" -version = "0.10.24" -source = "registry+https://github.com/rust-lang/crates.io-index" +name = "padre_core" +version = "0.2.0" dependencies = [ - "bitflags 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", - "foreign-types 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", - "openssl-sys 0.9.49 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes", + "futures", + "lazy_static", + "pin-project", + "regex", + "serde", + "serde_derive", + "serde_json", + "tokio", + "tokio-util", ] [[package]] -name = "openssl-probe" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "openssl-sys" -version = "0.9.49" -source = "registry+https://github.com/rust-lang/crates.io-index" +name = "padre_lldb" +version = "0.2.0" dependencies = [ - "autocfg 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "cc 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", - "pkg-config 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", - "vcpkg 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes", + "futures", + "lazy_static", + "padre_core", + "regex", + "tokio", + "tokio-util", ] [[package]] -name = "owning_ref" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" +name = "padre_node" +version = "0.2.0" dependencies = [ - "stable_deref_trait 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes", + "futures", + "lazy_static", + "padre_core", + "regex", + "serde", + "serde_derive", + "serde_json", + "tokio", + "tokio-tungstenite", + "tokio-util", + "url", ] [[package]] -name = "padre" -version = "0.1.0" +name = "padre_python" +version = "0.2.0" dependencies = [ - "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", - "clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-process 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-signal 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", - "websocket 0.22.4 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes", + "futures", + "lazy_static", + "padre_core", + "regex", + "tokio", ] [[package]] -name = "parking_lot" -version = "0.7.1" +name = "percent-encoding" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" + +[[package]] +name = "pin-project" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7804a463a8d9572f13453c516a5faea534a2403d7ced2f0c7e100eeff072772c" dependencies = [ - "lock_api 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot_core 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "pin-project-internal", ] [[package]] -name = "parking_lot_core" -version = "0.4.0" +name = "pin-project-internal" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "385322a45f2ecf3410c68d2a549a4a2685e8051d0f278e39743ff4e451cb9b3f" dependencies = [ - "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "smallvec 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2", + "quote", + "syn", ] [[package]] -name = "percent-encoding" -version = "1.0.1" +name = "pin-project-lite" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "237844750cfbb86f67afe27eee600dfbbcb6188d734139b534cbfbf4f96792ae" [[package]] -name = "pkg-config" -version = "0.3.15" +name = "pin-utils" +version = "0.1.0-alpha.4" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5894c618ce612a3fa23881b152b608bafb8c56cfc22f434a3ba3120b40f7b587" [[package]] name = "ppv-lite86" -version = "0.2.5" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74490b50b9fbe561ac330df47c08f3f33073d2d00c150f719147d7c54522fa1b" [[package]] -name = "proc-macro2" -version = "1.0.1" +name = "proc-macro-hack" +version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecd45702f76d6d3c75a80564378ae228a85f0b59d2f3ed43c91b4a69eb2ebfc5" dependencies = [ - "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2", + "quote", + "syn", ] [[package]] -name = "quote" -version = "1.0.2" +name = "proc-macro-nested" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "proc-macro2 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", -] +checksum = "369a6ed065f249a159e06c45752c780bda2fb53c995718f9e484d08daa9eb42e" [[package]] -name = "rand" -version = "0.6.5" +name = "proc-macro2" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c09721c6781493a2a492a96b5a5bf19b65917fe6728884e7c44dd0c60ca3435" dependencies = [ - "autocfg 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", - "rand_chacha 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "rand_hc 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rand_isaac 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "rand_jitter 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", - "rand_os 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", - "rand_pcg 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "rand_xorshift 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-xid", ] [[package]] -name = "rand" -version = "0.7.0" +name = "quote" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bdc6c187c65bca4260c9011c9e3132efe4909da44726bad24cf7572ae338d7f" dependencies = [ - "getrandom 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", - "rand_chacha 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "rand_core 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rand_hc 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2", ] [[package]] -name = "rand_chacha" -version = "0.1.1" +name = "rand" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" dependencies = [ - "autocfg 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "getrandom", + "libc", + "rand_chacha", + "rand_core", + "rand_hc", ] [[package]] name = "rand_chacha" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03a2a90da8c7523f554344f921aa97283eadf6ac484a6d2a7d0212fa7f8d6853" dependencies = [ - "c2-chacha 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "rand_core 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "c2-chacha", + "rand_core", ] [[package]] name = "rand_core" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "rand_core" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "rand_core" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "getrandom 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "rand_hc" -version = "0.1.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" dependencies = [ - "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "getrandom", ] [[package]] name = "rand_hc" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" dependencies = [ - "rand_core 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "rand_isaac" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "rand_jitter" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", - "rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "rand_os" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)", - "fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", - "rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "rand_pcg" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "autocfg 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "rand_xorshift" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "rdrand" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core", ] [[package]] name = "redox_syscall" version = "0.1.56" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2439c63f3f6139d1b57529d16bc3b8bb855230c8efcc5d3a896c8bea7c3b1e84" [[package]] name = "regex" -version = "1.2.1" +version = "1.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "322cf97724bea3ee221b78fe25ac9c46114ebb51747ad5babd51a2fc6a8235a8" dependencies = [ - "aho-corasick 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)", - "memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "regex-syntax 0.6.11 (registry+https://github.com/rust-lang/crates.io-index)", - "thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", + "aho-corasick", + "memchr", + "regex-syntax", + "thread_local", ] [[package]] name = "regex-syntax" -version = "0.6.11" +version = "0.6.16" source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "remove_dir_all" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "rustc_version" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", -] +checksum = "1132f845907680735a84409c3bebc64d1364a5683ffbce899550cd09d5eaefc1" [[package]] name = "ryu" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "safemem" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "schannel" -version = "0.1.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "scopeguard" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "scopeguard" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "security-framework" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "core-foundation 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", - "core-foundation-sys 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", - "security-framework-sys 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "security-framework-sys" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "core-foundation-sys 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "semver" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "semver-parser" -version = "0.7.0" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa8506c1de11c9c4e4c38863ccbe02a305c8188e85a05a784c9e11e1c3910c8" [[package]] name = "serde" -version = "1.0.99" +version = "1.0.104" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "414115f25f818d7dfccec8ee535d76949ae78584fc4f79a6f45a904bf8ab4449" [[package]] name = "serde_derive" -version = "1.0.99" +version = "1.0.104" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "128f9e303a5a29922045a830221b8f78ec74a5f544944f3d5984f8ec3895ef64" dependencies = [ - "proc-macro2 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2", + "quote", + "syn", ] [[package]] name = "serde_json" -version = "1.0.40" +version = "1.0.48" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9371ade75d4c2d6cb154141b9752cf3781ec9c05e0e5cf35060e1e70ee7b9c25" dependencies = [ - "itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", - "ryu 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)", + "itoa", + "ryu", + "serde", ] [[package]] -name = "sha1" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "signal-hook" -version = "0.1.10" +name = "sha-1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7d94d0bede923b3cea61f3f1ff57ff8cdfd77b400fb8f9998949e0cf04163df" dependencies = [ - "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", - "signal-hook-registry 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "block-buffer", + "digest", + "fake-simd", + "opaque-debug", ] [[package]] name = "signal-hook-registry" -version = "1.1.1" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94f478ede9f64724c5d173d7bb56099ec3e2d9fc2774aac65d34b8b890405f41" dependencies = [ - "arc-swap 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", + "arc-swap", + "libc", ] [[package]] name = "slab" version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8" [[package]] name = "smallvec" -version = "0.6.10" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c2fb2ec9bcd216a5b0d0ccf31ab17b5ed1d627960edff65bbe95d3ce221cefc" [[package]] name = "socket2" version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8b74de517221a2cb01a53349cf54182acdc31a074727d3079068448c0676d85" dependencies = [ - "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", - "redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if", + "libc", + "redox_syscall", + "winapi 0.3.8", ] -[[package]] -name = "stable_deref_trait" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "strsim" version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" [[package]] name = "syn" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "proc-macro2 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "tempfile" -version = "3.1.0" +version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "123bd9499cfb380418d509322d7a6d52e5315f064fe4b3ad18a53d6b92c07859" dependencies = [ - "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", - "redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)", - "remove_dir_all 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2", + "quote", + "unicode-xid", ] [[package]] name = "textwrap" version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" dependencies = [ - "unicode-width 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-width", ] [[package]] name = "thread_local" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "time" -version = "0.1.42" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d40c6d1b69745a6ec6fb1ca717914848da4b44ae29d9b3080cbee91d72a69b14" dependencies = [ - "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", - "redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static", ] [[package]] name = "tokio" -version = "0.1.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", - "mio 0.6.19 (registry+https://github.com/rust-lang/crates.io-index)", - "num_cpus 1.10.1 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-codec 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-current-thread 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-executor 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-fs 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-io 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-reactor 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-sync 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-tcp 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-threadpool 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-timer 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-udp 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-uds 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "tokio-codec" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-io 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "tokio-current-thread" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-executor 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "tokio-executor" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "tokio-fs" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-io 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-threadpool 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "tokio-io" -version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "tokio-process" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "crossbeam-queue 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "mio 0.6.19 (registry+https://github.com/rust-lang/crates.io-index)", - "mio-named-pipes 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-io 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-reactor 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-signal 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "tokio-reactor" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "mio 0.6.19 (registry+https://github.com/rust-lang/crates.io-index)", - "num_cpus 1.10.1 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", - "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-executor 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-io 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-sync 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "tokio-signal" -version = "0.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", - "mio 0.6.19 (registry+https://github.com/rust-lang/crates.io-index)", - "mio-uds 0.6.7 (registry+https://github.com/rust-lang/crates.io-index)", - "signal-hook 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-executor 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-io 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-reactor 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "tokio-sync" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "tokio-tcp" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", - "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "mio 0.6.19 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-io 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-reactor 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "tokio-threadpool" -version = "0.1.15" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fa5e81d6bc4e67fe889d5783bd2a128ab2e0cfa487e0be16b6a8d177b101616" dependencies = [ - "crossbeam-deque 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", - "crossbeam-queue 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "num_cpus 1.10.1 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", - "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-executor 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes", + "fnv", + "futures-core", + "iovec", + "lazy_static", + "libc", + "memchr", + "mio", + "mio-named-pipes", + "mio-uds", + "pin-project-lite", + "signal-hook-registry", + "slab", + "tokio-macros", + "winapi 0.3.8", ] [[package]] -name = "tokio-timer" -version = "0.2.11" +name = "tokio-macros" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0c3acc6aa564495a0f2e1d59fab677cd7f81a19994cfc7f3ad0e64301560389" dependencies = [ - "crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", - "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-executor 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2", + "quote", + "syn", ] [[package]] -name = "tokio-tls" -version = "0.2.1" +name = "tokio-tungstenite" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8b8fe88007ebc363512449868d7da4389c9400072a3f666f212c7280082882a" dependencies = [ - "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", - "native-tls 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-io 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", + "futures", + "log", + "pin-project", + "tokio", + "tungstenite", ] [[package]] -name = "tokio-udp" -version = "0.1.3" +name = "tokio-util" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "571da51182ec208780505a32528fc5512a8fe1443ab960b3f2f3ef093cd16930" dependencies = [ - "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "mio 0.6.19 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-codec 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-io 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-reactor 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes", + "futures-core", + "futures-sink", + "log", + "pin-project-lite", + "tokio", ] [[package]] -name = "tokio-uds" -version = "0.2.5" +name = "tungstenite" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfea31758bf674f990918962e8e5f07071a3161bd7c4138ed23e416e1ac4264e" dependencies = [ - "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", - "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "mio 0.6.19 (registry+https://github.com/rust-lang/crates.io-index)", - "mio-uds 0.6.7 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-codec 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-io 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-reactor 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "base64", + "byteorder", + "bytes", + "http", + "httparse", + "input_buffer", + "log", + "rand", + "sha-1", + "url", + "utf-8", ] [[package]] -name = "traitobject" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "typeable" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "unicase" -version = "1.4.2" +name = "typenum" +version = "1.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", -] +checksum = "6d2783fe2d6b8c1101136184eb41be8b1ad379e4657050b8aaff0c79ee7575f9" [[package]] name = "unicode-bidi" version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5" dependencies = [ - "matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "matches", ] [[package]] name = "unicode-normalization" -version = "0.1.8" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5479532badd04e128284890390c1e876ef7a993d0570b3597ae43dfa1d59afa4" dependencies = [ - "smallvec 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)", + "smallvec", ] [[package]] name = "unicode-width" -version = "0.1.6" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "caaa9d531767d1ff2150b9332433f32a24622147e5ebb1f26409d5da67afd479" [[package]] name = "unicode-xid" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c" [[package]] name = "url" -version = "1.7.2" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "829d4a8476c35c9bf0bbce5a3b23f4106f79728039b726d292bb93bc106787cb" dependencies = [ - "idna 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", - "percent-encoding 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "idna", + "matches", + "percent-encoding", ] [[package]] -name = "vcpkg" -version = "0.2.7" +name = "utf-8" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05e42f7c18b8f902290b009cde6d651262f956c98bc51bca4cd1d511c9cd85c7" [[package]] name = "vec_map" version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "version_check" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05c78687fb1a80548ae3250346c3db86a80a7cdd77bda190189f2d0a0987c81a" [[package]] name = "wasi" -version = "0.5.0" +version = "0.9.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "websocket" -version = "0.22.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "base64 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", - "bitflags 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", - "hyper 0.10.16 (registry+https://github.com/rust-lang/crates.io-index)", - "native-tls 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", - "sha1 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-codec 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-io 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-reactor 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-tcp 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-tls 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "unicase 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", -] +checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" [[package]] name = "winapi" version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" [[package]] name = "winapi" -version = "0.3.7" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8093091eeb260906a183e6ae1abdba2ef5ef2257a21801128899c3fc699229c6" dependencies = [ - "winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", ] [[package]] name = "winapi-build" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" [[package]] name = "winapi-i686-pc-windows-gnu" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "ws2_32-sys" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e" dependencies = [ - "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.2.8", + "winapi-build", ] - -[metadata] -"checksum aho-corasick 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)" = "58fb5e95d83b38284460a5fda7d6470aa0b8844d283a0b614b8535e880800d2d" -"checksum ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b" -"checksum arc-swap 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "854ede29f7a0ce90519fb2439d030320c6201119b87dab0ee96044603e1130b9" -"checksum arrayvec 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)" = "b8d73f9beda665eaa98ab9e4f7442bd4e7de6652587de55b2525e52e29c1b0ba" -"checksum atty 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)" = "1803c647a3ec87095e7ae7acfca019e98de5ec9a7d01343f611cf3152ed71a90" -"checksum autocfg 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "b671c8fb71b457dd4ae18c4ba1e59aa81793daacc361d82fcd410cef0d491875" -"checksum base64 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0b25d992356d2eb0ed82172f5248873db5560c4721f564b13cb5193bda5e668e" -"checksum base64 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)" = "489d6c0ed21b11d038c31b6ceccca973e65d73ba3bd8ecb9a2babf5546164643" -"checksum bitflags 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3d155346769a6855b86399e9bc3814ab343cd3d62c7e985113d46a0ec3c281fd" -"checksum byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a7c3dd8985a7111efc5c80b44e23ecdd8c007de8ade3b96595387e812b957cf5" -"checksum bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)" = "206fdffcfa2df7cbe15601ef46c813fce0965eb3286db6b56c583b814b51c81c" -"checksum c2-chacha 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7d64d04786e0f528460fc884753cf8dddcc466be308f6026f8e355c41a0e4101" -"checksum cc 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)" = "b548a4ee81fccb95919d4e22cfea83c7693ebfd78f0495493178db20b3139da7" -"checksum cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "b486ce3ccf7ffd79fdeb678eac06a9e6c09fc88d33836340becb8fffe87c5e33" -"checksum clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5067f5bb2d80ef5d68b4c87db81601f0b75bca627bc2ef76b141d7b846a3c6d9" -"checksum cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" -"checksum core-foundation 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)" = "25b9e03f145fd4f2bf705e07b900cd41fc636598fe5dc452fd0db1441c3f496d" -"checksum core-foundation-sys 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e7ca8a5221364ef15ce201e8ed2f609fc312682a8f4e0e3d4aa5879764e0fa3b" -"checksum crossbeam-deque 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b18cd2e169ad86297e6bc0ad9aa679aee9daa4f19e8163860faf7c164e4f5a71" -"checksum crossbeam-epoch 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "fedcd6772e37f3da2a9af9bf12ebe046c0dfe657992377b4df982a2b54cd37a9" -"checksum crossbeam-queue 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7c979cd6cfe72335896575c6b5688da489e420d36a27a0b9eb0c73db574b4a4b" -"checksum crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)" = "04973fa96e96579258a5091af6003abde64af786b860f18622b82e026cca60e6" -"checksum fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "2fad85553e09a6f881f739c29f0b00b0f01357c743266d478b68951ce23285f3" -"checksum foreign-types 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -"checksum foreign-types-shared 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" -"checksum fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" -"checksum fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" -"checksum fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" -"checksum futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)" = "45dc39533a6cae6da2b56da48edae506bb767ec07370f86f70fc062e9d435869" -"checksum getrandom 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)" = "fc344b02d3868feb131e8b5fe2b9b0a1cc42942679af493061fc13b853243872" -"checksum httparse 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "cd179ae861f0c2e53da70d892f5f3029f9594be0c41dc5269cd371691b1dc2f9" -"checksum hyper 0.10.16 (registry+https://github.com/rust-lang/crates.io-index)" = "0a0652d9a2609a968c14be1a9ea00bf4b1d64e2e1f53a1b51b6fff3a6e829273" -"checksum idna 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "38f09e0f0b1fb55fdee1f17470ad800da77af5186a1a76c026b679358b7e844e" -"checksum iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "dbe6e417e7d0975db6512b90796e8ce223145ac4e33c377e4a42882a0e88bb08" -"checksum itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "501266b7edd0174f8530248f87f99c88fbe60ca4ef3dd486835b8d8d53136f7f" -"checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" -"checksum language-tags 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a91d884b6667cd606bb5a69aa0c99ba811a115fc68915e7056ec08a46e93199a" -"checksum lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bc5729f27f159ddd61f4df6228e827e86643d4d3e7c32183cb30a1c08f604a14" -"checksum libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)" = "34fcd2c08d2f832f376f4173a231990fa5aef4e99fb569867318a227ef4c06ba" -"checksum lock_api 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "62ebf1391f6acad60e5c8b43706dde4582df75c06698ab44511d15016bc2442c" -"checksum log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "e19e8d5c34a3e0e2223db8e060f9e8264aeeb5c5fc64a4ee9965c062211c024b" -"checksum log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7" -"checksum matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" -"checksum memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "88579771288728879b57485cc7d6b07d648c9f0141eb955f8ab7f9d45394468e" -"checksum memoffset 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ce6075db033bbbb7ee5a0bbd3a3186bbae616f57fb001c485c7ff77955f8177f" -"checksum mime 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "ba626b8a6de5da682e1caa06bdb42a335aee5a84db8e5046a3e8ab17ba0a3ae0" -"checksum mio 0.6.19 (registry+https://github.com/rust-lang/crates.io-index)" = "83f51996a3ed004ef184e16818edc51fadffe8e7ca68be67f9dee67d84d0ff23" -"checksum mio-named-pipes 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "f5e374eff525ce1c5b7687c4cef63943e7686524a387933ad27ca7ec43779cb3" -"checksum mio-uds 0.6.7 (registry+https://github.com/rust-lang/crates.io-index)" = "966257a94e196b11bb43aca423754d87429960a768de9414f3691d6957abf125" -"checksum miow 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f2f3b1cf331de6896aabf6e9d55dca90356cc9960cca7eaaf408a355ae919" -"checksum miow 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "396aa0f2003d7df8395cb93e09871561ccc3e785f0acb369170e8cc74ddf9226" -"checksum native-tls 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "4b2df1a4c22fd44a62147fd8f13dd0f95c9d8ca7b2610299b2a2f9cf8964274e" -"checksum net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)" = "42550d9fb7b6684a6d404d9fa7250c2eb2646df731d1c06afc06dcee9e1bcf88" -"checksum nodrop 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)" = "2f9667ddcc6cc8a43afc9b7917599d7216aa09c463919ea32c59ed6cac8bc945" -"checksum num_cpus 1.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "bcef43580c035376c0705c42792c294b66974abbfd2789b511784023f71f3273" -"checksum openssl 0.10.24 (registry+https://github.com/rust-lang/crates.io-index)" = "8152bb5a9b5b721538462336e3bef9a539f892715e5037fda0f984577311af15" -"checksum openssl-probe 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "77af24da69f9d9341038eba93a073b1fdaaa1b788221b00a69bce9e762cb32de" -"checksum openssl-sys 0.9.49 (registry+https://github.com/rust-lang/crates.io-index)" = "f4fad9e54bd23bd4cbbe48fdc08a1b8091707ac869ef8508edea2fec77dcc884" -"checksum owning_ref 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "49a4b8ea2179e6a2e27411d3bca09ca6dd630821cf6894c6c7c8467a8ee7ef13" -"checksum parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ab41b4aed082705d1056416ae4468b6ea99d52599ecf3169b00088d43113e337" -"checksum parking_lot_core 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "94c8c7923936b28d546dfd14d4472eaf34c99b14e1c973a32b3e6d4eb04298c9" -"checksum percent-encoding 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "31010dd2e1ac33d5b46a5b413495239882813e0369f8ed8a5e266f173602f831" -"checksum pkg-config 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)" = "a7c1d2cfa5a714db3b5f24f0915e74fcdf91d09d496ba61329705dda7774d2af" -"checksum ppv-lite86 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "e3cbf9f658cdb5000fcf6f362b8ea2ba154b9f146a61c7a20d647034c6b6561b" -"checksum proc-macro2 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4c5c2380ae88876faae57698be9e9775e3544decad214599c3a6266cca6ac802" -"checksum quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "053a8c8bcc71fcce321828dc897a98ab9760bef03a4fc36693c231e5b3216cfe" -"checksum rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)" = "6d71dacdc3c88c1fde3885a3be3fbab9f35724e6ce99467f7d9c5026132184ca" -"checksum rand 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d47eab0e83d9693d40f825f86948aa16eff6750ead4bdffc4ab95b8b3a7f052c" -"checksum rand_chacha 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "556d3a1ca6600bfcbab7c7c91ccb085ac7fbbcd70e008a98742e7847f4f7bcef" -"checksum rand_chacha 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "03a2a90da8c7523f554344f921aa97283eadf6ac484a6d2a7d0212fa7f8d6853" -"checksum rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b" -"checksum rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc" -"checksum rand_core 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "615e683324e75af5d43d8f7a39ffe3ee4a9dc42c5c701167a71dc59c3a493aca" -"checksum rand_hc 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7b40677c7be09ae76218dc623efbf7b18e34bced3f38883af07bb75630a21bc4" -"checksum rand_hc 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" -"checksum rand_isaac 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ded997c9d5f13925be2a6fd7e66bf1872597f759fd9dd93513dd7e92e5a5ee08" -"checksum rand_jitter 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "1166d5c91dc97b88d1decc3285bb0a99ed84b05cfd0bc2341bdf2d43fc41e39b" -"checksum rand_os 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "7b75f676a1e053fc562eafbb47838d67c84801e38fc1ba459e8f180deabd5071" -"checksum rand_pcg 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "abf9b09b01790cfe0364f52bf32995ea3c39f4d2dd011eac241d2914146d0b44" -"checksum rand_xorshift 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cbf7e9e623549b0e21f6e97cf8ecf247c1a8fd2e8a992ae265314300b2455d5c" -"checksum rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" -"checksum redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)" = "2439c63f3f6139d1b57529d16bc3b8bb855230c8efcc5d3a896c8bea7c3b1e84" -"checksum regex 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "88c3d9193984285d544df4a30c23a4e62ead42edf70a4452ceb76dac1ce05c26" -"checksum regex-syntax 0.6.11 (registry+https://github.com/rust-lang/crates.io-index)" = "b143cceb2ca5e56d5671988ef8b15615733e7ee16cd348e064333b251b89343f" -"checksum remove_dir_all 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4a83fa3702a688b9359eccba92d153ac33fd2e8462f9e0e3fdf155239ea7792e" -"checksum rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" -"checksum ryu 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c92464b447c0ee8c4fb3824ecc8383b81717b9f1e74ba2e72540aef7b9f82997" -"checksum safemem 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d2b08423011dae9a5ca23f07cf57dac3857f5c885d352b76f6d95f4aea9434d0" -"checksum schannel 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)" = "f2f6abf258d99c3c1c5c2131d99d064e94b7b3dd5f416483057f308fea253339" -"checksum scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "94258f53601af11e6a49f722422f6e3425c52b06245a5cf9bc09908b174f5e27" -"checksum scopeguard 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b42e15e59b18a828bbf5c58ea01debb36b9b096346de35d941dcb89009f24a0d" -"checksum security-framework 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "eee63d0f4a9ec776eeb30e220f0bc1e092c3ad744b2a379e3993070364d3adc2" -"checksum security-framework-sys 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9636f8989cbf61385ae4824b98c1aaa54c994d7d8b41f11c601ed799f0549a56" -"checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" -"checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" -"checksum serde 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)" = "fec2851eb56d010dc9a21b89ca53ee75e6528bab60c11e89d38390904982da9f" -"checksum serde_derive 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)" = "cb4dc18c61206b08dc98216c98faa0232f4337e1e1b8574551d5bad29ea1b425" -"checksum serde_json 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)" = "051c49229f282f7c6f3813f8286cc1e3323e8051823fce42c7ea80fe13521704" -"checksum sha1 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2579985fda508104f7587689507983eadd6a6e84dd35d6d115361f530916fa0d" -"checksum signal-hook 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "4f61c4d59f3aaa9f61bba6450a9b80ba48362fd7d651689e7a10c453b1f6dc68" -"checksum signal-hook-registry 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1797d48f38f91643908bb14e35e79928f9f4b3cefb2420a564dde0991b4358dc" -"checksum slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8" -"checksum smallvec 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)" = "ab606a9c5e214920bb66c458cd7be8ef094f813f20fe77a54cc7dbfff220d4b7" -"checksum socket2 0.3.11 (registry+https://github.com/rust-lang/crates.io-index)" = "e8b74de517221a2cb01a53349cf54182acdc31a074727d3079068448c0676d85" -"checksum stable_deref_trait 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "dba1a27d3efae4351c8051072d619e3ade2820635c3958d826bfea39d59b54c8" -"checksum strsim 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" -"checksum syn 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "c65d951ab12d976b61a41cf9ed4531fc19735c6e6d84a4bb1453711e762ec731" -"checksum tempfile 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6e24d9338a0a5be79593e2fa15a648add6138caa803e2d5bc782c371732ca9" -"checksum textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" -"checksum thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c6b53e329000edc2b34dbe8545fd20e55a333362d0a321909685a19bd28c3f1b" -"checksum time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)" = "db8dcfca086c1143c9270ac42a2bbd8a7ee477b78ac8e45b19abfb0cbede4b6f" -"checksum tokio 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)" = "5a09c0b5bb588872ab2f09afa13ee6e9dac11e10a0ec9e8e3ba39a5a5d530af6" -"checksum tokio-codec 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "5c501eceaf96f0e1793cf26beb63da3d11c738c4a943fdf3746d81d64684c39f" -"checksum tokio-current-thread 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "d16217cad7f1b840c5a97dfb3c43b0c871fef423a6e8d2118c604e843662a443" -"checksum tokio-executor 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "0f27ee0e6db01c5f0b2973824547ce7e637b2ed79b891a9677b0de9bd532b6ac" -"checksum tokio-fs 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "3fe6dc22b08d6993916647d108a1a7d15b9cd29c4f4496c62b92c45b5041b7af" -"checksum tokio-io 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "5090db468dad16e1a7a54c8c67280c5e4b544f3d3e018f0b913b400261f85926" -"checksum tokio-process 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "afbd6ef1b8cc2bd2c2b580d882774d443ebb1c6ceefe35ba9ea4ab586c89dbe8" -"checksum tokio-reactor 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "6af16bfac7e112bea8b0442542161bfc41cbfa4466b580bdda7d18cb88b911ce" -"checksum tokio-signal 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "dd6dc5276ea05ce379a16de90083ec80836440d5ef8a6a39545a3207373b8296" -"checksum tokio-sync 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "2162248ff317e2bc713b261f242b69dbb838b85248ed20bb21df56d60ea4cae7" -"checksum tokio-tcp 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "1d14b10654be682ac43efee27401d792507e30fd8d26389e1da3b185de2e4119" -"checksum tokio-threadpool 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)" = "90ca01319dea1e376a001e8dc192d42ebde6dd532532a5bad988ac37db365b19" -"checksum tokio-timer 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "f2106812d500ed25a4f38235b9cae8f78a09edf43203e16e59c3b769a342a60e" -"checksum tokio-tls 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "354b8cd83825b3c20217a9dc174d6a0c67441a2fae5c41bcb1ea6679f6ae0f7c" -"checksum tokio-udp 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "66268575b80f4a4a710ef83d087fdfeeabdce9b74c797535fbac18a2cb906e92" -"checksum tokio-uds 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "037ffc3ba0e12a0ab4aca92e5234e0dedeb48fddf6ccd260f1f150a36a9f2445" -"checksum traitobject 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "efd1f82c56340fdf16f2a953d7bda4f8fdffba13d93b00844c25572110b26079" -"checksum typeable 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1410f6f91f21d1612654e7cc69193b0334f909dcf2c790c4826254fbb86f8887" -"checksum unicase 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7f4765f83163b74f957c797ad9253caf97f103fb064d3999aea9568d09fc8a33" -"checksum unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5" -"checksum unicode-normalization 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "141339a08b982d942be2ca06ff8b076563cbe223d1befd5450716790d44e2426" -"checksum unicode-width 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "7007dbd421b92cc6e28410fe7362e2e0a2503394908f417b68ec8d1c364c4e20" -"checksum unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c" -"checksum url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "dd4e7c0d531266369519a4aa4f399d748bd37043b00bde1e4ff1f60a120b355a" -"checksum vcpkg 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "33dd455d0f96e90a75803cfeb7f948768c08d70a6de9a8d2362461935698bf95" -"checksum vec_map 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "05c78687fb1a80548ae3250346c3db86a80a7cdd77bda190189f2d0a0987c81a" -"checksum version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "914b1a6776c4c929a602fafd8bc742e06365d4bcbe48c30f9cca5824f70dc9dd" -"checksum wasi 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fd5442abcac6525a045cc8c795aedb60da7a2e5e89c7bf18a0d5357849bb23c7" -"checksum websocket 0.22.4 (registry+https://github.com/rust-lang/crates.io-index)" = "0adcd2a64c5746c9702b354a1b992802b0c363df1dfa324a74cb7aebe10e0cbf" -"checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" -"checksum winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)" = "f10e386af2b13e47c89e7236a7a14a086791a2b88ebad6df9bf42040195cf770" -"checksum winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" -"checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" -"checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" -"checksum ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e" diff --git a/padre/Cargo.toml b/padre/Cargo.toml index 52a2049..a2851d2 100644 --- a/padre/Cargo.toml +++ b/padre/Cargo.toml @@ -1,18 +1,6 @@ -[package] -name = "padre" -version = "0.1.0" -authors = ["Steven Trotter "] -edition = "2018" +[workspace] -[dependencies] -bytes = "0.4.12" -clap = "2.32.0" -lazy_static = "1.3.0" -regex = "1.1.2" -serde = "1.0" -serde_derive = "1.0" -serde_json = "1.0" -tokio = "0.1.22" -tokio-signal = "0.2" -tokio-process = "0.2.4" -websocket = "0.22.4" +members = [ + "cli", + "core", +] diff --git a/padre/cli/Cargo.toml b/padre/cli/Cargo.toml new file mode 100644 index 0000000..076ebb1 --- /dev/null +++ b/padre/cli/Cargo.toml @@ -0,0 +1,37 @@ +[package] +name = "padre" +version = "0.2.0" +authors = ["Steven Trotter "] +edition = "2018" +license = "APACHE" +repository = "https://github.com/strottos/vim-padre" + +[features] +default = ["lldb", "node", "python"] +lldb = ["padre_lldb"] +node = ["padre_node"] +python = ["padre_python"] + +[dependencies] +clap = "2.32.0" +futures = "0.3.4" +padre_core = { path = "../core", version = "0.2.0" } +serde = "1.0" +serde_derive = "1.0" +serde_json = "1.0" +tokio = { version = "0.2.13", features = [ + "io-util", + "io-std", + "macros", + "net", + "rt-core", + "process", + "stream", + "sync", + "time" +] } + +# The debuggers, all optional +padre_lldb = { path = "../debuggers/lldb", optional = true, version = "0.2.0" } +padre_node = { path = "../debuggers/node", optional = true, version = "0.2.0" } +padre_python = { path = "../debuggers/python", optional = true, version = "0.2.0" } diff --git a/padre/cli/src/debugger.rs b/padre/cli/src/debugger.rs new file mode 100644 index 0000000..d24622d --- /dev/null +++ b/padre/cli/src/debugger.rs @@ -0,0 +1,192 @@ +//! Handle creating the debugger dependent on the type of debugger specified +//! +//! See core/debugger.rs for more centric/shared debugger material once one is created + +use std::fmt::Debug; +use std::process::Command; + +use padre_core::debugger::Debugger; + +#[cfg(feature = "lldb")] +use padre_lldb; +#[cfg(feature = "node")] +use padre_node; +#[cfg(feature = "python")] +use padre_python; + +/// Debuggers +#[derive(Debug)] +enum DebuggerType { + #[cfg(feature = "lldb")] + LLDB, + #[cfg(feature = "node")] + Node, + #[cfg(feature = "python")] + Python, +} + +/// Get the debugger implementation +/// +/// If the debugger type is not specified it will try it's best to guess what kind of debugger to +/// return. +pub fn create_debugger( + debugger_cmd: Option<&str>, + debugger_type: Option<&str>, + run_cmd: Vec, +) -> Box { + let debugger_type = match debugger_type { + Some(s) => match s.to_ascii_lowercase().as_str() { + #[cfg(feature = "lldb")] + "lldb" => DebuggerType::LLDB, + #[cfg(feature = "python")] + "python" => DebuggerType::Python, + #[cfg(feature = "node")] + "node" => DebuggerType::Node, + _ => panic!("Couldn't understand debugger type {}", s), + }, + None => match get_debugger_type(&run_cmd[0]) { + Some(s) => s, + None => match debugger_cmd { + Some(s) => match s { + #[cfg(feature = "lldb")] + "lldb" => DebuggerType::LLDB, + #[cfg(feature = "python")] + "python" | "python3" => DebuggerType::Python, + #[cfg(feature = "node")] + "node" => DebuggerType::Node, + _ => panic!( + "Can't find debugger type for {}, try specifying with -d or -t", + s + ), + }, + None => panic!("Can't find debugger type, try specifying with -d or -t"), + }, + }, + }; + + let debugger_cmd = match debugger_cmd { + Some(s) => s.to_string(), + None => match debugger_type { + #[cfg(feature = "lldb")] + DebuggerType::LLDB => "lldb".to_string(), + #[cfg(feature = "node")] + DebuggerType::Node => "node".to_string(), + #[cfg(feature = "python")] + DebuggerType::Python => "python3".to_string(), + }, + }; + + match debugger_type { + #[cfg(feature = "lldb")] + DebuggerType::LLDB => Box::new(padre_lldb::ImplDebugger::new(debugger_cmd, run_cmd)), + #[cfg(feature = "node")] + DebuggerType::Node => Box::new(padre_node::ImplDebugger::new(debugger_cmd, run_cmd)), + #[cfg(feature = "python")] + DebuggerType::Python => Box::new(padre_python::ImplDebugger::new(debugger_cmd, run_cmd)), + } +} + +/// Guesses the debugger type +fn get_debugger_type(run_cmd: &str) -> Option { + if is_node(&run_cmd) { + #[cfg(feature = "node")] + return Some(DebuggerType::Node); + } else if is_python(&run_cmd) { + #[cfg(feature = "python")] + return Some(DebuggerType::Python); + } else if is_lldb(&run_cmd) { + #[cfg(feature = "lldb")] + return Some(DebuggerType::LLDB); + } + + None +} + +/// Checks if the file is a binary executable +fn is_lldb(cmd: &str) -> bool { + if file_is_binary_executable(cmd) { + return true; + } + + false +} + +/// Checks if the file is a NodeJS script +fn is_node(cmd: &str) -> bool { + if file_is_text(cmd) && cmd.ends_with(".js") { + return true; + } + + // if file_is_binary_executable(cmd) && cmd.contains("node") { + // return true; + // } + + false +} + +/// Checks if the file is a Python script +fn is_python(cmd: &str) -> bool { + if file_is_text(cmd) && cmd.ends_with(".py") { + return true; + } + + // if file_is_binary_executable(cmd) && cmd.contains("python") { + // return true; + // } + + false +} + +/// Find out if a file is a binary executable (either ELF or Mach-O +/// executable). +fn file_is_binary_executable(cmd: &str) -> bool { + let output = get_file_type(cmd); + + if output.contains("ELF") + || (output.contains("Mach-O") && output.to_ascii_lowercase().contains("executable")) + { + true + } else { + false + } +} + +/// Find out if a file is a text file (either ASCII or UTF-8). +fn file_is_text(cmd: &str) -> bool { + let output = get_file_type(cmd); + + if output.contains("ASCII") || output.contains("UTF-8") { + true + } else { + false + } +} + +/// Get the file type as output by the UNIX `file` command. +fn get_file_type(cmd: &str) -> String { + let output = Command::new("file") + .arg("-L") // Follow symlinks + .arg(cmd) + .output(); + let output = output.expect(&format!("Can't run file on {} to find file type", cmd)); + + String::from_utf8_lossy(&output.stdout).to_string() +} + +#[cfg(test)] +mod tests { + #[test] + fn is_file_executable() { + assert_eq!(true, super::file_is_binary_executable("../test_files/node")); + assert_eq!( + false, + super::file_is_binary_executable("../test_files/test_node.js") + ); + } + + #[test] + fn is_file_text() { + assert_eq!(false, super::file_is_text("../test_files/node")); + assert_eq!(true, super::file_is_text("../test_files/test_node.js")); + } +} diff --git a/padre/cli/src/main.rs b/padre/cli/src/main.rs new file mode 100644 index 0000000..242d04d --- /dev/null +++ b/padre/cli/src/main.rs @@ -0,0 +1,174 @@ +//! PADRE Debugger +//! +//! This program creates a socket interface that enables debuggers to communicate +//! in a standard manner with multiple different debuggers and programming languages. +//! Options supported: +//! -p/--port Port to run socket interface on +//! -h/--host Hostname to run on +//! -t/--type The type of debugger to spawn +//! Currently supported are +//! - lldb +//! - node +//! - python +//! -d/--debugger +//! +//! The debug command should be specified as an addendum when running the command, e.g. +//! ``` +//! padre -t=lldb -d=lldb -- my_program arg1 arg2 3 4 +//! ``` +//! will run the program `my_program arg1 arg2 3 4` in an `lldb` session. + +use std::io; +use std::net::SocketAddr; +use std::process::exit; +use std::time::{Duration, Instant}; + +use clap::{App, Arg, ArgMatches}; +use futures::prelude::*; +use tokio::net::TcpListener; +use tokio::signal::unix::{signal, SignalKind}; +use tokio::sync::mpsc::{self, Sender}; +use tokio::time::delay_until; + +use padre_core::debugger::{DebuggerCmd, DebuggerCmdBasic}; +use padre_core::server; +use padre_core::util; + +mod debugger; +use debugger::create_debugger; + +fn get_app_args<'a>() -> ArgMatches<'a> { + App::new("VIM Padre") + .version("0.1.0") + .author("Steven Trotter ") + .about("A tool for building, debugging and reverse engineering in VIM") + .long_about("Interfaces with 'lldb' or a similar debugger to debug programs and communicate with the Vim PADRE plugin in order to effectively use Vim as a debugging interface.") + .arg(Arg::with_name("port") + .short("p") + .long("port") + .takes_value(true) + .help("specify port to run on")) + .arg(Arg::with_name("host") + .short("h") + .long("host") + .takes_value(true) + .help("specify host to run on")) + .arg(Arg::with_name("debugger") + .short("d") + .long("debugger") + .takes_value(true) + .help("specify debugger to use")) + .arg(Arg::with_name("type") + .short("t") + .long("type") + .takes_value(true) + .help("specify debugger type from [lldb, node, java, python]")) + .arg(Arg::with_name("debug_cmd") + .multiple(true) + .takes_value(true)) + .get_matches() +} + +fn get_connection(args: &ArgMatches) -> SocketAddr { + let port = match args.value_of("port") { + None => util::get_unused_localhost_port(), + Some(s) => match s.parse::() { + Ok(n) => n, + Err(_) => { + panic!("Can't understand port"); + } + }, + }; + + let host = match args.value_of("host") { + None => "0.0.0.0", + Some(s) => s, + }; + + return format!("{}:{}", host, port).parse::().unwrap(); +} + +fn exit_padre(mut debugger_queue_tx: Sender<(DebuggerCmd, Instant)>) { + tokio::spawn(async move { + let instant = Instant::now() + Duration::new(5, 0); + let command = (DebuggerCmd::Basic(DebuggerCmdBasic::Exit), instant); + debugger_queue_tx.send(command).await.unwrap(); + delay_until(tokio::time::Instant::from_std(instant)).await; + println!("Timed out exiting!"); + exit(-1); + }); +} + +async fn run_padre() -> io::Result<()> { + let args = get_app_args(); + + let debug_cmd: Vec = args + .values_of("debug_cmd") + .expect("Can't find program to debug, please rerun with correct parameters") + .map(|x| x.to_string()) + .collect::>(); + + let (debugger_queue_tx, debugger_queue_rx) = mpsc::channel(128); + + let debugger = create_debugger(args.value_of("debugger"), args.value_of("type"), debug_cmd); + + debugger.setup_handler(debugger_queue_rx); + + let connection_addr = get_connection(&args); + let mut socket = TcpListener::bind(&connection_addr) + .map(|listener| { + println!("Listening on {}", &connection_addr); + listener + }) + .await + .expect(&format!("Can't open TCP listener on {}", &connection_addr)); + + let mut incoming = socket.incoming(); + + // TODO: Merge the following into one lot of signals when we know how to + + let debugger_signals_queue_tx = debugger_queue_tx.clone(); + tokio::spawn(async move { + let mut signals = signal(SignalKind::interrupt()).unwrap(); + let debugger_signals_queue_tx = debugger_signals_queue_tx.clone(); + + while let Some(_) = signals.recv().await { + exit_padre(debugger_signals_queue_tx.clone()); + } + }); + + let debugger_signals_queue_tx = debugger_queue_tx.clone(); + tokio::spawn(async move { + let mut signals = signal(SignalKind::quit()).unwrap(); + let debugger_signals_queue_tx = debugger_signals_queue_tx.clone(); + + while let Some(_) = signals.recv().await { + exit_padre(debugger_signals_queue_tx.clone()); + } + }); + + let debugger_signals_queue_tx = debugger_queue_tx.clone(); + tokio::spawn(async move { + let mut signals = signal(SignalKind::terminate()).unwrap(); + let debugger_signals_queue_tx = debugger_signals_queue_tx.clone(); + + while let Some(_) = signals.recv().await { + exit_padre(debugger_signals_queue_tx.clone()); + } + }); + + while let Some(Ok(stream)) = incoming.next().await { + let debugger_queue_tx = debugger_queue_tx.clone(); + tokio::spawn(async move { + server::process_connection(stream, debugger_queue_tx.clone()); + }); + } + + Ok(()) +} + +#[tokio::main] +async fn main() -> io::Result<()> { + let padre = tokio::spawn(run_padre()); + padre.await.unwrap() +} diff --git a/padre/core/Cargo.lock b/padre/core/Cargo.lock new file mode 100644 index 0000000..d620e13 --- /dev/null +++ b/padre/core/Cargo.lock @@ -0,0 +1,311 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "aho-corasick" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "ansi_term" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "atty" +version = "0.2.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "bitflags" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "byteorder" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "bytes" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "bytes" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "clap" +version = "2.33.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "atty 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", + "bitflags 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "strsim 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-width 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "vec_map 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "iovec" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "itoa" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "lazy_static" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "libc" +version = "0.2.65" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "memchr" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "padre" +version = "0.2.0" +dependencies = [ + "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", + "clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", + "pin-project 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio 0.2.1 (git+https://github.com/tokio-rs/tokio/)", +] + +[[package]] +name = "pin-project" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "pin-project-internal 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "pin-project-internal" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "pin-project-lite" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "proc-macro2" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "quote" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "regex" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "aho-corasick 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)", + "memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "regex-syntax 0.6.11 (registry+https://github.com/rust-lang/crates.io-index)", + "thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "regex-syntax" +version = "0.6.11" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "ryu" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "serde" +version = "1.0.99" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "serde_derive" +version = "1.0.99" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "serde_json" +version = "1.0.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", + "ryu 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "strsim" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "syn" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "textwrap" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "unicode-width 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "thread_local" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tokio" +version = "0.2.1" +source = "git+https://github.com/tokio-rs/tokio/#524e66314faacd9803792ce2a9dc13befd2ceeeb" +dependencies = [ + "bytes 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", + "pin-project-lite 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "unicode-width" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "unicode-xid" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "vec_map" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "winapi" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "winapi" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[metadata] +"checksum aho-corasick 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)" = "58fb5e95d83b38284460a5fda7d6470aa0b8844d283a0b614b8535e880800d2d" +"checksum ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b" +"checksum atty 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)" = "1803c647a3ec87095e7ae7acfca019e98de5ec9a7d01343f611cf3152ed71a90" +"checksum bitflags 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3d155346769a6855b86399e9bc3814ab343cd3d62c7e985113d46a0ec3c281fd" +"checksum byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a7c3dd8985a7111efc5c80b44e23ecdd8c007de8ade3b96595387e812b957cf5" +"checksum bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)" = "206fdffcfa2df7cbe15601ef46c813fce0965eb3286db6b56c583b814b51c81c" +"checksum bytes 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1c85319f157e4e26c703678e68e26ab71a46c0199286fa670b21cc9fec13d895" +"checksum clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5067f5bb2d80ef5d68b4c87db81601f0b75bca627bc2ef76b141d7b846a3c6d9" +"checksum iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "dbe6e417e7d0975db6512b90796e8ce223145ac4e33c377e4a42882a0e88bb08" +"checksum itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "501266b7edd0174f8530248f87f99c88fbe60ca4ef3dd486835b8d8d53136f7f" +"checksum lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bc5729f27f159ddd61f4df6228e827e86643d4d3e7c32183cb30a1c08f604a14" +"checksum libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)" = "1a31a0627fdf1f6a39ec0dd577e101440b7db22672c0901fe00a9a6fbb5c24e8" +"checksum memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "88579771288728879b57485cc7d6b07d648c9f0141eb955f8ab7f9d45394468e" +"checksum pin-project 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "562cc58f3e865231cf1fa1760097159a642018f5953ffbfe4f2df2ef72bf0d90" +"checksum pin-project-internal 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "21a5bc357e14eb5cc61f4e24867b3aec66b850d83ea830beffa2244ad7a97f1e" +"checksum pin-project-lite 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f0af6cbca0e6e3ce8692ee19fb8d734b641899e07b68eb73e9bbbd32f1703991" +"checksum proc-macro2 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4c5c2380ae88876faae57698be9e9775e3544decad214599c3a6266cca6ac802" +"checksum quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "053a8c8bcc71fcce321828dc897a98ab9760bef03a4fc36693c231e5b3216cfe" +"checksum regex 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "88c3d9193984285d544df4a30c23a4e62ead42edf70a4452ceb76dac1ce05c26" +"checksum regex-syntax 0.6.11 (registry+https://github.com/rust-lang/crates.io-index)" = "b143cceb2ca5e56d5671988ef8b15615733e7ee16cd348e064333b251b89343f" +"checksum ryu 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c92464b447c0ee8c4fb3824ecc8383b81717b9f1e74ba2e72540aef7b9f82997" +"checksum serde 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)" = "fec2851eb56d010dc9a21b89ca53ee75e6528bab60c11e89d38390904982da9f" +"checksum serde_derive 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)" = "cb4dc18c61206b08dc98216c98faa0232f4337e1e1b8574551d5bad29ea1b425" +"checksum serde_json 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)" = "051c49229f282f7c6f3813f8286cc1e3323e8051823fce42c7ea80fe13521704" +"checksum strsim 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" +"checksum syn 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "66850e97125af79138385e9b88339cbcd037e3f28ceab8c5ad98e64f0f1f80bf" +"checksum textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" +"checksum thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c6b53e329000edc2b34dbe8545fd20e55a333362d0a321909685a19bd28c3f1b" +"checksum tokio 0.2.1 (git+https://github.com/tokio-rs/tokio/)" = "" +"checksum unicode-width 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "7007dbd421b92cc6e28410fe7362e2e0a2503394908f417b68ec8d1c364c4e20" +"checksum unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c" +"checksum vec_map 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "05c78687fb1a80548ae3250346c3db86a80a7cdd77bda190189f2d0a0987c81a" +"checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" +"checksum winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)" = "f10e386af2b13e47c89e7236a7a14a086791a2b88ebad6df9bf42040195cf770" +"checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" +"checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" diff --git a/padre/core/Cargo.toml b/padre/core/Cargo.toml new file mode 100644 index 0000000..186fc9b --- /dev/null +++ b/padre/core/Cargo.toml @@ -0,0 +1,22 @@ +[package] +name = "padre_core" +version = "0.2.0" +authors = ["Steven Trotter "] +edition = "2018" +license = "APACHE" +repository = "https://github.com/strottos/vim-padre" + +[lib] +path = "src/lib.rs" + +[dependencies] +bytes = "0.5.0" +futures = "0.3.1" +lazy_static = "1.3.0" +pin-project = "0.4" +regex = "1.1.2" +serde = "1.0" +serde_derive = "1.0" +serde_json = "1.0" +tokio = { version = "0.2.13", features = [] } +tokio-util = { version = "0.2.0", features = ["codec"] } diff --git a/padre/src/config.rs b/padre/core/src/config.rs similarity index 97% rename from padre/src/config.rs rename to padre/core/src/config.rs index 5f7661f..4dd8a8f 100644 --- a/padre/src/config.rs +++ b/padre/core/src/config.rs @@ -25,6 +25,7 @@ use std::collections::HashMap; /// /// Only config items that are meaningful and have defaults can be set and /// retreived. +#[derive(Clone, Debug)] pub struct Config<'a> { config: HashMap<&'a str, i64>, } @@ -37,6 +38,7 @@ impl<'a> Config<'a> { config.insert("ProcessSpawnTimeout", 10); config.insert("BreakpointTimeout", 2); config.insert("PrintVariableTimeout", 2); + config.insert("StepTimeout", 2); Config { config } } diff --git a/padre/core/src/debugger.rs b/padre/core/src/debugger.rs new file mode 100644 index 0000000..338677e --- /dev/null +++ b/padre/core/src/debugger.rs @@ -0,0 +1,80 @@ +//! Debugger Module +//! +//! Main module for handling the debuggers, defines the standard versioned debugger interfaces. + +use std::fmt::Debug; +use std::time::Instant; + +use tokio::sync::mpsc::Receiver; + +// TODO: Get some of this out of pub use and just in this module?? + +/// Debugger trait that implements the basics +pub trait Debugger: Debug { + fn setup_handler(&self, queue_rx: Receiver<(DebuggerCmd, Instant)>); +} + +/// All debugger commands +#[derive(Clone, Debug, PartialEq)] +pub enum DebuggerCmd { + Basic(DebuggerCmdBasic), +} + +/// All debugger commands +#[derive(Clone, Debug, PartialEq)] +pub enum DebuggerCmdBasic { + Run, + Exit, + Interrupt, + Breakpoint(FileLocation), + Unbreakpoint(FileLocation), + StepIn, + StepOver, + Continue, + Print(Variable), +} + +/// File location +#[derive(Clone, Debug, PartialEq, Eq, Hash)] +pub struct FileLocation { + name: String, + line_num: u64, +} + +impl FileLocation { + pub fn new(name: String, line_num: u64) -> Self { + FileLocation { name, line_num } + } + + pub fn name(&self) -> &str { + &self.name + } + + pub fn line_num(&self) -> u64 { + self.line_num + } +} + +/// Variable name +#[derive(Clone, Debug)] +pub struct Variable { + name: String, +} + +impl Variable { + pub fn new(name: String) -> Self { + Variable { name } + } + + pub fn name(&self) -> &str { + &self.name + } +} + +impl PartialEq for Variable { + fn eq(&self, other: &Self) -> bool { + self.name == other.name + } +} + +impl Eq for Variable {} diff --git a/padre/core/src/lib.rs b/padre/core/src/lib.rs new file mode 100644 index 0000000..ee5badc --- /dev/null +++ b/padre/core/src/lib.rs @@ -0,0 +1,12 @@ +#[macro_use] +extern crate serde_derive; + +#[macro_use] +extern crate lazy_static; + +pub mod config; +pub mod debugger; +pub mod notifier; +pub mod server; +pub mod util; +pub mod vimcodec; diff --git a/padre/src/notifier.rs b/padre/core/src/notifier.rs similarity index 86% rename from padre/src/notifier.rs rename to padre/core/src/notifier.rs index 27e3c60..8ecd5e2 100644 --- a/padre/src/notifier.rs +++ b/padre/core/src/notifier.rs @@ -8,7 +8,6 @@ use std::sync::Mutex; use crate::server::{Notification, PadreSend}; -use tokio::prelude::*; use tokio::sync::mpsc::Sender; lazy_static! { @@ -28,7 +27,8 @@ pub enum LogLevel { DEBUG, } -/// A `Listener` is a wrapper around the ... +/// A `Listener` is a wrapper around the socket that we can use to send +/// messages to #[derive(Debug)] struct Listener { sender: Sender, @@ -70,13 +70,13 @@ impl Notifier { /// Send the message to all clients fn send_msg(&mut self, msg: Notification) { for listener in self.listeners.iter_mut() { - let sender = listener.sender.clone(); - tokio::spawn( - sender - .send(PadreSend::Notification(msg.clone())) - .map(|_| ()) - .map_err(|e| eprintln!("Notifier can't send to socket: {}", e)), - ); + let msg_copy = msg.clone(); + let mut sender = listener.sender.clone(); + tokio::spawn(async move { + if let Err(e) = sender.send(PadreSend::Notification(msg_copy)).await { + eprintln!("Notifier can't send to socket: {}", e); + } + }); } } } @@ -113,6 +113,8 @@ pub fn log_msg(level: LogLevel, msg: &str) { NOTIFIER.lock().unwrap().send_msg(msg); } +/// TODO: Allow to send to a specific socket + /// Notify about a code position change pub fn jump_to_position(file: &str, line: u64) { let msg = Notification::new( @@ -122,15 +124,6 @@ pub fn jump_to_position(file: &str, line: u64) { NOTIFIER.lock().unwrap().send_msg(msg); } -/// Notify that a breakpoint has been set -pub fn breakpoint_set(file: &str, line: u64) { - let msg = Notification::new( - "padre#debugger#BreakpointSet".to_string(), - vec![serde_json::json!(file), serde_json::json!(line)], - ); - NOTIFIER.lock().unwrap().send_msg(msg); -} - #[cfg(test)] mod tests { use std::net::{IpAddr, Ipv4Addr, SocketAddr}; diff --git a/padre/src/server.rs b/padre/core/src/server.rs similarity index 64% rename from padre/src/server.rs rename to padre/core/src/server.rs index 2b1ef44..eb9ece0 100644 --- a/padre/src/server.rs +++ b/padre/core/src/server.rs @@ -4,26 +4,28 @@ //! padre and debuggers for actioning. use std::env::current_exe; +use std::fmt::Debug; use std::io; use std::process::{Command, Stdio}; use std::str; use std::sync::{Arc, Mutex}; -use std::time::Duration; +use std::time::Instant; use crate::config::Config; -use crate::debugger::{Debugger, DebuggerCmd}; -use crate::notifier::{add_listener, log_msg, remove_listener, LogLevel}; +// TODO: Add in remove_listener +use crate::debugger::DebuggerCmd; +use crate::notifier::{add_listener, log_msg, LogLevel}; use crate::vimcodec::VimCodec; -use tokio::codec::Decoder; +use futures::{SinkExt, StreamExt}; use tokio::net::TcpStream; -use tokio::prelude::*; -use tokio::sync::mpsc; +use tokio::sync::mpsc::{self, Sender}; +use tokio_util::codec::Decoder; // TODO: Get some of this out of pub use and just in this module? /// All padre commands -#[derive(Clone, Deserialize, Debug, PartialEq)] +#[derive(Clone, Debug, PartialEq)] pub enum PadreCmd { Ping, Pings, @@ -39,18 +41,26 @@ pub enum PadreCmd { /// Examples: /// /// ``` -/// let command = RequestCmd::Cmd("run") -/// let command = RequestCmd::CmdWithFileLocation("breakpoint", "test.c", 12) -/// let command = RequestCmd::CmdWithVariable("print", "abc") +/// use std::time::{Duration, Instant}; +/// use padre_core::debugger::{DebuggerCmd, DebuggerCmdBasic, FileLocation, Variable}; +/// use padre_core::server::RequestCmd; +/// +/// let command = RequestCmd::DebuggerCmd(DebuggerCmd::Basic(DebuggerCmdBasic::Run), Instant::now() + Duration::new(5,0)); +/// +/// let file_location = FileLocation::new("test.c".to_string(), 12); +/// let command = RequestCmd::DebuggerCmd(DebuggerCmd::Basic(DebuggerCmdBasic::Breakpoint(file_location)), Instant::now() + Duration::new(5,0)); +/// +/// let variable = Variable::new("abc".to_string()); +/// let command = RequestCmd::DebuggerCmd(DebuggerCmd::Basic(DebuggerCmdBasic::Print(variable)), Instant::now() + Duration::new(5,0)); /// ``` -#[derive(Clone, Deserialize, Debug, PartialEq)] +#[derive(Clone, Debug, PartialEq)] pub enum RequestCmd { PadreCmd(PadreCmd), - DebuggerCmd(DebuggerCmd), + DebuggerCmd(DebuggerCmd, Instant), } /// Contains full details of a request including an id to respond to and a `RequestCmd` -#[derive(Deserialize, Debug, PartialEq)] +#[derive(Debug, PartialEq)] pub struct PadreRequest { id: u64, cmd: RequestCmd, @@ -82,15 +92,15 @@ impl PadreRequest { /// /// Normally kept simple with important information relegated to an event based notification. #[derive(Clone, Debug, PartialEq, Serialize)] -pub struct Response { +pub struct PadreResponse { id: u64, resp: serde_json::Value, } -impl Response { +impl PadreResponse { /// Create a response pub fn new(id: u64, resp: serde_json::Value) -> Self { - Response { id, resp } + PadreResponse { id, resp } } /// Return the response id @@ -131,88 +141,63 @@ impl Notification { } } -/// Data to be sent back to connection in the form of either a `Notification` or a `Response` +/// Data to be sent back to connection in the form of either a `Notification` or a +/// `PadreResponse` /// -/// A `Response` takes a u64 as the first argument to represent the id and a JSON object as -/// the second argument to represent the response. For example a response with an id of `1` +/// A `PadreResponse` takes a u64 as the first argument to represent the id and a JSON object +/// as the second argument to represent the response. For example a response with an id of `1` /// and a JSON object of `{"status":"OK"}` will be decoded by the `VIMCodec` as /// `[1,{"status":"OK"}]` and sent as a response to the requesting socket. /// #[derive(Clone, Debug, PartialEq, Serialize)] pub enum PadreSend { - Response(Response), + Response(PadreResponse), Notification(Notification), } /// Process a TCP socket connection. /// /// Fully sets up a new socket connection including listening for requests and sending responses. -pub fn process_connection(socket: TcpStream, debugger: Arc>) { - let addr = socket.peer_addr().unwrap(); +pub fn process_connection(stream: TcpStream, debugger_queue_tx: Sender<(DebuggerCmd, Instant)>) { + let addr = stream.peer_addr().unwrap(); let config = Arc::new(Mutex::new(Config::new())); - let (request_tx, request_rx) = VimCodec::new().framed(socket).split(); - - let (connection_tx, connection_rx) = mpsc::channel(1); + let (mut connection_tx, mut connection_rx) = + VimCodec::new(config.clone()).framed(stream).split(); - add_listener(connection_tx.clone(), addr.clone()); + // Just here as an abstraction around the connection so that we can send both responses + // to requests and to notify of an event (debugger paused for example). + let (tx, mut rx) = mpsc::channel(1); - tokio::spawn( - request_tx - .send_all(connection_rx.map_err(|e| { - eprintln!("failed to retrieve message to send: {}", e); - io::Error::new(io::ErrorKind::Other, e) - })) - .then(|res| { - if let Err(e) = res { - eprintln!("failed to send data to socket; error = {:?}", e); - } + add_listener(tx.clone(), addr.clone()); - Ok(()) - }), - ); - - let connection_tx_2 = connection_tx.clone(); - - tokio::spawn( - request_rx - .and_then(move |req| respond(req, debugger.clone(), config.clone())) - .for_each(move |resp| { - tokio::spawn( - connection_tx_2 - .clone() - .send(PadreSend::Response(resp)) - .map(|_| {}) - .map_err(|e| println!("Error responding: {}", e)), - ); - Ok(()) - }) - .map_err(move |e| { - match e.kind() { - // Remove socket from notifier if pipe broken, otherwise report error - std::io::ErrorKind::ConnectionReset => { - remove_listener(&addr.clone()); - } - _ => unreachable!(), - } - }), - ); + tokio::spawn(async move { + while let Some(msg) = rx.next().await { + connection_tx.send(msg).await.unwrap(); + } + }); + + tokio::spawn(async move { + while let Some(req) = connection_rx.next().await { + let resp = respond(req.unwrap(), debugger_queue_tx.clone(), config.clone()) + .await + .unwrap(); + tx.clone().send(PadreSend::Response(resp)).await.unwrap(); + } + }); - tokio::spawn(future::lazy(|| { - check_for_and_report_padre_updates(); - Ok(()) - })); + tokio::spawn(check_for_and_report_padre_updates()); } -/// Process a PadreRequest. +/// Process a PadreRequest and figure out the response. /// /// Forwards the request to the appropriate place to handle it and responds appropriately. -fn respond( +async fn respond<'a>( request: PadreRequest, - debugger: Arc>, - config: Arc>, -) -> Box + Send> { + mut debugger_queue_tx: Sender<(DebuggerCmd, Instant)>, + config: Arc>>, +) -> Result { match request.cmd() { RequestCmd::PadreCmd(cmd) => { let json_response = match cmd { @@ -222,31 +207,24 @@ fn respond( PadreCmd::SetConfig(key, value) => set_config(config, key, *value), }; - Box::new(future::lazy(move || match json_response { - Ok(args) => Ok(Response::new(request.id(), args)), + match json_response { + Ok(args) => Ok(PadreResponse::new(request.id(), args)), Err(e) => { log_msg(LogLevel::ERROR, &format!("{}", e)); let resp = serde_json::json!({"status":"ERROR"}); - Ok(Response::new(request.id(), resp)) + Ok(PadreResponse::new(request.id(), resp)) } - })) + } } - RequestCmd::DebuggerCmd(cmd) => { - let f = match cmd { - DebuggerCmd::V1(v1cmd) => debugger.lock().unwrap().handle_v1_cmd(v1cmd, config), - }; - - Box::new( - f.timeout(Duration::new(30, 0)) - .then(move |resp| match resp { - Ok(s) => Ok(Response::new(request.id(), s)), - Err(e) => { - log_msg(LogLevel::ERROR, &format!("{}", e)); - let resp = serde_json::json!({"status":"ERROR"}); - Ok(Response::new(request.id(), resp)) - } - }), - ) + RequestCmd::DebuggerCmd(cmd, timeout) => { + debugger_queue_tx + .send((cmd.clone(), *timeout)) + .await + .unwrap(); + Ok(PadreResponse::new( + request.id(), + serde_json::json!({"status":"OK"}), + )) } } } @@ -282,7 +260,7 @@ fn set_config( } /// Checks whether we're on the latest version with git and if not gives a warning -fn check_for_and_report_padre_updates() { +async fn check_for_and_report_padre_updates() { let padre_exe = current_exe().unwrap(); let padre_dir = padre_exe.parent().unwrap(); diff --git a/padre/core/src/util.rs b/padre/core/src/util.rs new file mode 100644 index 0000000..543880a --- /dev/null +++ b/padre/core/src/util.rs @@ -0,0 +1,228 @@ +//! Utilities +//! +//! Various simple utilities for use in PADRE + +use std::env; +use std::io::{self, Write}; +use std::mem; +use std::net::TcpListener; +use std::path::{Path, PathBuf}; +use std::pin::Pin; +use std::process::{exit, Stdio}; +use std::task::{Context, Poll}; + +use crate::notifier::{log_msg, LogLevel}; + +use bytes::Bytes; +use futures::{Stream, StreamExt}; +use pin_project::{pin_project, project}; +use tokio::io::{stdin, AsyncBufRead}; +use tokio::prelude::*; +use tokio::process::{Child, ChildStdin, Command}; +use tokio::sync::mpsc::{self, Sender}; +use tokio_util::codec::{BytesCodec, FramedRead}; + +/// Get an unused port on the local system and return it. This port +/// can subsequently be used. +pub fn get_unused_localhost_port() -> u16 { + let listener = TcpListener::bind(format!("127.0.0.1:0")).unwrap(); + listener.local_addr().unwrap().port() +} + +/// Log an error and a debug message, commonly used in the code base +pub fn send_error_and_debug(err_msg: &str, debug_msg: &str) { + log_msg(LogLevel::ERROR, err_msg); + log_msg(LogLevel::DEBUG, debug_msg); +} + +/// Check whether the specified debugger and program to debug exist, including change them to +/// be the full path name if required. If it still can't find both it will panic, otherwise it +/// will start a Child process for running the program. +pub fn check_and_spawn_process(mut debugger_cmd: Vec, run_cmd: Vec) -> Child { + let mut not_found = None; + + // Try getting the full path if the debugger doesn't exist + if !file_exists(&debugger_cmd[0]) { + debugger_cmd[0] = get_file_full_path(&debugger_cmd[0]); + } + + // Now check the debugger and program to debug exist, if not error + if !file_exists(&run_cmd[0]) { + not_found = Some(&run_cmd[0]); + }; + + if !file_exists(&debugger_cmd[0]) { + not_found = Some(&debugger_cmd[0]); + } + + if let Some(s) = not_found { + let msg = format!("Can't spawn debugger as {} does not exist", s); + log_msg(LogLevel::CRITICAL, &msg); + println!("{}", msg); + + exit(1); + } + + let mut args = vec![]; + + for arg in &debugger_cmd[0..] { + args.push(&arg[..]); + } + + args.push("--"); + + for arg in &run_cmd { + args.push(&arg[..]); + } + + let mut pty_wrapper = env::current_exe().unwrap(); + pty_wrapper.pop(); + pty_wrapper.pop(); + pty_wrapper.pop(); + pty_wrapper.push("ptywrapper.py"); + + Command::new(pty_wrapper) + .args(&args) + .stdin(Stdio::piped()) + .stdout(Stdio::piped()) + .stderr(Stdio::piped()) + .spawn() + .expect("Failed to spawn debugger") +} + +/// Perform setup of listening and forwarding of stdin and return a sender that will forward to the +/// stdin of a process. +pub fn setup_stdin(mut child_stdin: ChildStdin, output_stdin: bool) -> Sender { + let (stdin_tx, mut stdin_rx) = mpsc::channel(1); + let mut tx = stdin_tx.clone(); + + tokio::spawn(async move { + let tokio_stdin = stdin(); + let mut reader = FramedRead::new(tokio_stdin, BytesCodec::new()); + while let Some(line) = reader.next().await { + let buf = line.unwrap().freeze(); + tx.send(buf).await.unwrap(); + } + }); + + tokio::spawn(async move { + while let Some(text) = stdin_rx.next().await { + if output_stdin { + io::stdout().write_all(&text).unwrap(); + } + match child_stdin.write(&text).await { + Ok(_) => {} + Err(e) => { + eprintln!("Writing stdin err e: {}", e); + } + }; + } + }); + + stdin_tx +} + +/// Find out the full path of a file based on the PATH environment variable. +pub fn get_file_full_path(cmd: &str) -> String { + let cmd_full_path_buf = env::var_os("PATH") + .and_then(|paths| { + env::split_paths(&paths) + .filter_map(|dir| { + let cmd_full_path = dir.join(&cmd); + if cmd_full_path.is_file() { + Some(cmd_full_path) + } else { + None + } + }) + .next() + }) + .unwrap_or(PathBuf::from(cmd)); + String::from(cmd_full_path_buf.as_path().to_str().unwrap()) +} + +/// Return true if the path specified exists. +pub fn file_exists(path: &str) -> bool { + Path::new(path).exists() +} + +// The following largely taken from tokio::io::lines code but for our bytes specific needs. + +/// Combinator created by `read_output` method which is a stream over text on an I/O object. +#[pin_project] +#[derive(Debug)] +pub struct ReadOutput { + #[pin] + reader: R, + buf: Vec, +} + +/// Creates a new stream from the I/O object +/// +/// This method takes an asynchronous I/O object, `reader`, and returns a `Stream` of text that +/// the object contains. The returned stream will reach its end once `reader` reaches EOF. +pub fn read_output(reader: R) -> ReadOutput +where + R: AsyncBufRead, +{ + ReadOutput { + reader, + buf: Vec::new(), + } +} + +impl Stream for ReadOutput { + type Item = io::Result; + + #[project] + fn poll_next(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { + #[project] + let ReadOutput { mut reader, buf } = self.project(); + + loop { + let used = { + match reader.as_mut().poll_fill_buf(cx) { + Poll::Ready(s) => match s { + Ok(t) => { + buf.extend_from_slice(t); + t.len() + } + Err(e) => { + println!("TODO: What to do here? Error reading: {:?}", e); + 0 + } + }, + Poll::Pending => 0, + } + }; + + if used == 0 { + break; + } + + reader.as_mut().consume(used); + } + + if buf.len() == 0 { + return Poll::Pending; + } + + let buf_freeze = mem::replace(buf, Vec::new()); + Poll::Ready(Some(Ok(String::from_utf8(buf_freeze).unwrap()))) + } +} + +#[cfg(test)] +mod tests { + use std::net::TcpListener; + use std::thread; + use std::time::Duration; + + #[test] + fn find_and_use_unused_port() { + let port = super::get_unused_localhost_port(); + thread::sleep(Duration::new(1, 0)); + let listener = TcpListener::bind(format!("127.0.0.1:{}", port)).unwrap(); + assert_eq!(listener.local_addr().unwrap().port(), port); + } +} diff --git a/padre/src/vimcodec.rs b/padre/core/src/vimcodec.rs similarity index 67% rename from padre/src/vimcodec.rs rename to padre/core/src/vimcodec.rs index 967da1a..37a01ec 100644 --- a/padre/src/vimcodec.rs +++ b/padre/core/src/vimcodec.rs @@ -4,31 +4,33 @@ use std::collections::HashMap; use std::io; +use std::sync::{Arc, Mutex}; +use std::time::{Duration, Instant}; -use crate::debugger::{DebuggerCmd, DebuggerCmdV1, FileLocation, Variable}; +use crate::config::Config; +use crate::debugger::{DebuggerCmd, DebuggerCmdBasic, FileLocation, Variable}; use crate::server::{PadreCmd, PadreRequest, PadreSend, RequestCmd}; use crate::util; -use bytes::{BufMut, BytesMut}; -use tokio::codec::{Decoder, Encoder}; +use bytes::{Buf, BufMut, BytesMut}; +use tokio_util::codec::{Decoder, Encoder}; /// Decodes requests and encodes responses sent by or to VIM over VIM's socket communication /// -/// Given a request of the form -/// ``` -/// [1,{"cmd":"breakpoint","file":"test.c","line":1}] -/// ``` +/// Given a request of the form: `[1,{"cmd":"breakpoint","file":"test.c","line":1}]` /// it decodes this into a PadreRequest with an `id` of `1` and a RequestCmd of `Breakpoint` /// with the correct file location. #[derive(Debug)] -pub struct VimCodec {} +pub struct VimCodec<'a> { + config: Arc>>, +} -impl VimCodec { +impl<'a> VimCodec<'a> { /// Constructor for creating a new VimCodec /// /// Just creates the object at present. - pub fn new() -> Self { - VimCodec {} + pub fn new(config: Arc>>) -> Self { + VimCodec { config } } /// Get and remove a `file location` from the arguments @@ -168,7 +170,7 @@ impl VimCodec { } } -impl Decoder for VimCodec { +impl<'a> Decoder for VimCodec<'a> { type Item = PadreRequest; type Error = io::Error; @@ -197,7 +199,7 @@ impl Decoder for VimCodec { } }; - src.split_to(src.len()); + src.advance(src.len()); util::send_error_and_debug( "Must be valid JSON", @@ -217,7 +219,7 @@ impl Decoder for VimCodec { } }; - src.split_to(src.len()); + src.advance(src.len()); if !v.is_array() { util::send_error_and_debug( @@ -305,26 +307,102 @@ impl Decoder for VimCodec { ))), "run" => Ok(Some(PadreRequest::new( id, - RequestCmd::DebuggerCmd(DebuggerCmd::V1(DebuggerCmdV1::Run)), + RequestCmd::DebuggerCmd( + DebuggerCmd::Basic(DebuggerCmdBasic::Run), + Instant::now() + + Duration::new( + self.config + .lock() + .unwrap() + .get_config("ProcessSpawnTimeout") + .unwrap() as u64, + 0, + ), + ), ))), "stepOver" => Ok(Some(PadreRequest::new( id, - RequestCmd::DebuggerCmd(DebuggerCmd::V1(DebuggerCmdV1::StepOver)), + RequestCmd::DebuggerCmd( + DebuggerCmd::Basic(DebuggerCmdBasic::StepOver), + Instant::now() + + Duration::new( + self.config + .lock() + .unwrap() + .get_config("StepTimeout") + .unwrap() as u64, + 0, + ), + ), ))), "stepIn" => Ok(Some(PadreRequest::new( id, - RequestCmd::DebuggerCmd(DebuggerCmd::V1(DebuggerCmdV1::StepIn)), + RequestCmd::DebuggerCmd( + DebuggerCmd::Basic(DebuggerCmdBasic::StepIn), + Instant::now() + + Duration::new( + self.config + .lock() + .unwrap() + .get_config("StepTimeout") + .unwrap() as u64, + 0, + ), + ), ))), "continue" => Ok(Some(PadreRequest::new( id, - RequestCmd::DebuggerCmd(DebuggerCmd::V1(DebuggerCmdV1::Continue)), + RequestCmd::DebuggerCmd( + DebuggerCmd::Basic(DebuggerCmdBasic::Continue), + Instant::now() + + Duration::new( + self.config + .lock() + .unwrap() + .get_config("StepTimeout") + .unwrap() as u64, + 0, + ), + ), ))), "breakpoint" => { let file_location = self.get_file_location(&mut args); match file_location { Some(fl) => Ok(Some(PadreRequest::new( id, - RequestCmd::DebuggerCmd(DebuggerCmd::V1(DebuggerCmdV1::Breakpoint(fl))), + RequestCmd::DebuggerCmd( + DebuggerCmd::Basic(DebuggerCmdBasic::Breakpoint(fl)), + Instant::now() + + Duration::new( + self.config + .lock() + .unwrap() + .get_config("BreakpointTimeout") + .unwrap() as u64, + 0, + ), + ), + ))), + None => return Ok(None), + } + } + "unbreakpoint" => { + let file_location = self.get_file_location(&mut args); + match file_location { + Some(fl) => Ok(Some(PadreRequest::new( + id, + RequestCmd::DebuggerCmd( + DebuggerCmd::Basic(DebuggerCmdBasic::Unbreakpoint(fl)), + Instant::now() + + Duration::new( + self.config + .lock() + .unwrap() + .get_config("BreakpointTimeout") + .unwrap() as u64, + 0, + ), + ), ))), None => return Ok(None), } @@ -334,7 +412,18 @@ impl Decoder for VimCodec { match variable { Some(v) => Ok(Some(PadreRequest::new( id, - RequestCmd::DebuggerCmd(DebuggerCmd::V1(DebuggerCmdV1::Print(v))), + RequestCmd::DebuggerCmd( + DebuggerCmd::Basic(DebuggerCmdBasic::Print(v)), + Instant::now() + + Duration::new( + self.config + .lock() + .unwrap() + .get_config("PrintVariableTimeout") + .unwrap() as u64, + 0, + ), + ), ))), None => return Ok(None), } @@ -391,7 +480,7 @@ impl Decoder for VimCodec { } } -impl Encoder for VimCodec { +impl<'a> Encoder for VimCodec<'a> { type Item = PadreSend; type Error = io::Error; @@ -412,7 +501,7 @@ impl Encoder for VimCodec { }; buf.reserve(response.len()); - buf.put(&response[..]); + buf.put(response[..].as_bytes()); Ok(()) } @@ -420,102 +509,127 @@ impl Encoder for VimCodec { #[cfg(test)] mod tests { - use crate::debugger::{DebuggerCmd, DebuggerCmdV1}; - use crate::server::{Notification, PadreCmd, PadreRequest, PadreSend, RequestCmd, Response}; + use std::sync::{Arc, Mutex}; + + use crate::config::Config; + use crate::debugger::{DebuggerCmd, DebuggerCmdBasic}; + use crate::server::{Notification, PadreCmd, PadreResponse, PadreSend, RequestCmd}; use bytes::{BufMut, BytesMut}; - use tokio::codec::{Decoder, Encoder}; + use tokio_util::codec::{Decoder, Encoder}; #[test] fn check_simple_json_decoding() { - let mut codec = super::VimCodec::new(); + let config = Arc::new(Mutex::new(Config::new())); + + let mut codec = super::VimCodec::new(config); let mut buf = BytesMut::new(); buf.reserve(19); - buf.put(r#"[123,{"cmd":"run"}]"#); + let s = r#"[123,{"cmd":"run"}]"#; + buf.put(s.as_bytes()); let padre_request = codec.decode(&mut buf).unwrap().unwrap(); - assert_eq!( - PadreRequest::new( - 123, - RequestCmd::DebuggerCmd(DebuggerCmd::V1(DebuggerCmdV1::Run)) - ), - padre_request - ); + assert_eq!(123, padre_request.id()); + + match padre_request.cmd() { + RequestCmd::DebuggerCmd(cmd, _) => { + assert_eq!(DebuggerCmd::Basic(DebuggerCmdBasic::Run), *cmd); + } + _ => panic!("Wrong command type"), + } } #[test] fn check_two_simple_json_decoding() { - let mut codec = super::VimCodec::new(); + let config = Arc::new(Mutex::new(Config::new())); + + let mut codec = super::VimCodec::new(config); let mut buf = BytesMut::new(); buf.reserve(19); - buf.put(r#"[123,{"cmd":"run"}]"#); + let s = r#"[123,{"cmd":"run"}]"#; + buf.put(s.as_bytes()); let padre_request = codec.decode(&mut buf).unwrap().unwrap(); - assert_eq!( - PadreRequest::new( - 123, - RequestCmd::DebuggerCmd(DebuggerCmd::V1(DebuggerCmdV1::Run)) - ), - padre_request - ); + assert_eq!(123, padre_request.id()); + + match padre_request.cmd() { + RequestCmd::DebuggerCmd(cmd, _) => { + assert_eq!(DebuggerCmd::Basic(DebuggerCmdBasic::Run), *cmd); + } + _ => panic!("Wrong command type"), + } let mut buf = BytesMut::new(); buf.reserve(20); - buf.put(r#"[124,{"cmd":"ping"}]"#); + let s = r#"[124,{"cmd":"ping"}]"#; + buf.put(s.as_bytes()); let padre_request = codec.decode(&mut buf).unwrap().unwrap(); - assert_eq!( - PadreRequest::new(124, RequestCmd::PadreCmd(PadreCmd::Ping)), - padre_request - ); + assert_eq!(124, padre_request.id()); + + match padre_request.cmd() { + RequestCmd::PadreCmd(cmd) => { + assert_eq!(PadreCmd::Ping, *cmd); + } + _ => panic!("Wrong command type"), + } } #[test] fn check_two_buffers_json_decodings() { - let mut codec = super::VimCodec::new(); + let config = Arc::new(Mutex::new(Config::new())); + + let mut codec = super::VimCodec::new(config); let mut buf = BytesMut::new(); buf.reserve(16); - buf.put(r#"[123,{"cmd":"run"#); + let s = r#"[123,{"cmd":"run"#; + buf.put(s.as_bytes()); let padre_request = codec.decode(&mut buf).unwrap(); assert_eq!(None, padre_request); buf.reserve(3); - buf.put(r#""}]"#); + let s = r#""}]"#; + buf.put(s.as_bytes()); let padre_request = codec.decode(&mut buf).unwrap().unwrap(); - assert_eq!( - PadreRequest::new( - 123, - RequestCmd::DebuggerCmd(DebuggerCmd::V1(DebuggerCmdV1::Run)) - ), - padre_request - ); + assert_eq!(123, padre_request.id()); + + match padre_request.cmd() { + RequestCmd::DebuggerCmd(cmd, _) => { + assert_eq!(DebuggerCmd::Basic(DebuggerCmdBasic::Run), *cmd); + } + _ => panic!("Wrong command type"), + } } #[test] fn check_json_encoding_response() { - let mut codec = super::VimCodec::new(); - let resp = PadreSend::Response(Response::new(123, serde_json::json!({"ping":"pong"}))); + let config = Arc::new(Mutex::new(Config::new())); + + let mut codec = super::VimCodec::new(config); + let resp = PadreSend::Response(PadreResponse::new(123, serde_json::json!({"ping":"pong"}))); let mut buf = BytesMut::new(); codec.encode(resp, &mut buf).unwrap(); let mut expected = BytesMut::new(); expected.reserve(22); - expected.put(r#"[123,{"ping":"pong"}]"#); - expected.put("\n"); + let s = format!("{}{}", r#"[123,{"ping":"pong"}]"#, "\n"); + expected.put(s.as_bytes()); assert_eq!(expected, buf); } #[test] fn check_json_encoding_notify() { - let mut codec = super::VimCodec::new(); + let config = Arc::new(Mutex::new(Config::new())); + + let mut codec = super::VimCodec::new(config); let resp = PadreSend::Notification(Notification::new( "cmd_test".to_string(), vec![serde_json::json!("test"), serde_json::json!(1)], @@ -525,8 +639,8 @@ mod tests { let mut expected = BytesMut::new(); expected.reserve(31); - expected.put(r#"["call","cmd_test",["test",1]]"#); - expected.put("\n"); + let s = format!("{}{}", r#"["call","cmd_test",["test",1]]"#, "\n"); + expected.put(s.as_bytes()); assert_eq!(expected, buf); } diff --git a/padre/debuggers/lldb/Cargo.toml b/padre/debuggers/lldb/Cargo.toml new file mode 100644 index 0000000..35b4759 --- /dev/null +++ b/padre/debuggers/lldb/Cargo.toml @@ -0,0 +1,19 @@ +[package] +name = "padre_lldb" +version = "0.2.0" +authors = ["Steven Trotter "] +edition = "2018" +license = "MIT" +repository = "https://github.com/strottos/vim-padre" + +[lib] +path = "src/lib.rs" + +[dependencies] +bytes = "0.5.0" +futures = "0.3.1" +lazy_static = "1.3.0" +padre_core = { path = "../../core", version = "0.2.0" } +regex = "1.1.2" +tokio = { version = "0.2.13", features = [] } +tokio-util = { version = "0.2.0", features = ["codec"] } diff --git a/padre/debuggers/lldb/src/debugger.rs b/padre/debuggers/lldb/src/debugger.rs new file mode 100644 index 0000000..b3cccfa --- /dev/null +++ b/padre/debuggers/lldb/src/debugger.rs @@ -0,0 +1,164 @@ +//! lldb client debugger +//! +//! The main LLDB Debugger entry point. Handles listening for instructions and +//! communicating through the `LLDBProcess`. + +use std::process::exit; +use std::sync::{Arc, Mutex}; +use std::thread; +use std::time::{Duration, Instant}; + +use super::process::{LLDBProcess, Message}; +use padre_core::debugger::{Debugger, DebuggerCmd, DebuggerCmdBasic, FileLocation, Variable}; +use padre_core::notifier::{log_msg, LogLevel}; + +use futures::prelude::*; +use tokio::sync::{mpsc, oneshot}; + +#[derive(Debug)] +pub struct ImplDebugger { + debugger_cmd: String, + run_cmd: Vec, +} + +impl ImplDebugger { + pub fn new(debugger_cmd: String, run_cmd: Vec) -> ImplDebugger { + ImplDebugger { + debugger_cmd, + run_cmd, + } + } +} + +impl Debugger for ImplDebugger { + /// Perform any initial setup including starting LLDB and setting up the stdio analyser stuff + /// - startup lldb and setup the stdio analyser + /// - perform initial setup so we can analyse LLDB properly + #[allow(unreachable_patterns)] + fn setup_handler(&self, mut queue_rx: mpsc::Receiver<(DebuggerCmd, Instant)>) { + let debugger_cmd = self.debugger_cmd.clone(); + let run_cmd = self.run_cmd.clone(); + + tokio::spawn(async move { + let mut debugger = LLDBDebugger::new(debugger_cmd, run_cmd); + + while let Some(cmd) = queue_rx.next().await { + match cmd.0 { + DebuggerCmd::Basic(basic_cmd) => match basic_cmd { + DebuggerCmdBasic::Run => debugger.run(cmd.1), + DebuggerCmdBasic::Interrupt => debugger.interrupt(), + DebuggerCmdBasic::Exit => { + debugger.teardown(); + break; + } + DebuggerCmdBasic::Breakpoint(fl) => debugger.breakpoint(&fl, cmd.1), + DebuggerCmdBasic::Unbreakpoint(fl) => debugger.unbreakpoint(&fl, cmd.1), + DebuggerCmdBasic::StepIn => debugger.step_in(cmd.1), + DebuggerCmdBasic::StepOver => debugger.step_over(cmd.1), + DebuggerCmdBasic::Continue => debugger.continue_(cmd.1), + DebuggerCmdBasic::Print(v) => debugger.print(&v, cmd.1), + }, + _ => { + log_msg(LogLevel::WARN, &format!("Got a command that wasn't understood {:?}", cmd)); + } + }; + } + + exit(0); + }); + } +} + +#[derive(Debug)] +pub struct LLDBDebugger { + process: Arc>, +} + +impl LLDBDebugger { + pub fn new(debugger_cmd: String, run_cmd: Vec) -> Self { + let (tx, rx) = oneshot::channel(); + + let process = Arc::new(Mutex::new(LLDBProcess::new( + debugger_cmd, + run_cmd, + Some(tx), + ))); + + let debugger = LLDBDebugger { + process: process.clone(), + }; + + // Send a lot of startup messages to LLDB when ready + tokio::spawn(async move { + rx.await.unwrap(); + // Mini sleep to make sure VIM has connected + thread::sleep(Duration::from_millis(500)); + process + .clone() + .lock() + .unwrap() + .send_msg(Message::LLDBSetup, None); + }); + + debugger + } + + fn interrupt(&mut self) {} + + fn teardown(&mut self) { + self.process.lock().unwrap().stop(); + exit(0); + } + + fn run(&mut self, _timeout: Instant) { + log_msg(LogLevel::INFO, "Launching process"); + + self.process + .lock() + .unwrap() + .send_msg(Message::ProcessLaunching, None); + } + + fn breakpoint(&mut self, file_location: &FileLocation, _timeout: Instant) { + log_msg( + LogLevel::INFO, + &format!( + "Setting breakpoint in file {} at line number {}", + file_location.name(), + file_location.line_num() + ), + ); + + self.process + .lock() + .unwrap() + .send_msg(Message::Breakpoint(file_location.clone()), None); + } + + fn unbreakpoint(&mut self, _file_location: &FileLocation, _timeout: Instant) {} + + fn step_in(&mut self, _timeout: Instant) { + self.process.lock().unwrap().send_msg(Message::StepIn, None); + } + + fn step_over(&mut self, _timeout: Instant) { + self.process + .lock() + .unwrap() + .send_msg(Message::StepOver, None); + } + + fn continue_(&mut self, _timeout: Instant) { + self.process + .lock() + .unwrap() + .send_msg(Message::Continue, None); + } + + fn print(&mut self, variable: &Variable, _timeout: Instant) { + self.process + .lock() + .unwrap() + .send_msg(Message::PrintVariable(variable.clone()), None); + } +} diff --git a/padre/src/debugger/lldb/mod.rs b/padre/debuggers/lldb/src/lib.rs similarity index 70% rename from padre/src/debugger/lldb/mod.rs rename to padre/debuggers/lldb/src/lib.rs index c940825..a278ebe 100644 --- a/padre/src/debugger/lldb/mod.rs +++ b/padre/debuggers/lldb/src/lib.rs @@ -1,5 +1,8 @@ //! The LLDB debugger module +#[macro_use] +extern crate lazy_static; + mod debugger; mod process; diff --git a/padre/debuggers/lldb/src/process.rs b/padre/debuggers/lldb/src/process.rs new file mode 100644 index 0000000..126f220 --- /dev/null +++ b/padre/debuggers/lldb/src/process.rs @@ -0,0 +1,452 @@ +//! lldb process handler +//! +//! This module performs the basic setup of and interfacing with LLDB. It will +//! analyse the output of the text and work out what is happening then. + +use std::io::{self, Write}; +use std::sync::{Arc, Mutex}; + +use padre_core::debugger::{FileLocation, Variable}; +use padre_core::notifier::{jump_to_position, log_msg, signal_exited, LogLevel}; +use padre_core::util::{check_and_spawn_process, read_output}; + +use bytes::Bytes; +use futures::prelude::*; +use regex::Regex; +use tokio::io::{stdin, BufReader}; +use tokio::prelude::*; +use tokio::process::{Child, ChildStdin, ChildStdout}; +use tokio::sync::{mpsc, oneshot}; +use tokio_util::codec::{BytesCodec, FramedRead}; + +/// Messages that can be sent to LLDB for processing +#[derive(Clone, Debug, Eq, PartialEq)] +pub enum Message { + LLDBLaunching, + LLDBSetup, + ProcessLaunching, + Breakpoint(FileLocation), + // Unbreakpoint(FileLocation), + StepIn, + StepOver, + Continue, + PrintVariable(Variable), + Custom, +} + +/// Current status of LLDB +#[derive(Clone, Debug, PartialEq)] +pub enum LLDBStatus { + NotRunning, + Listening, + Processing(Message), +} + +/// Main handler for spawning the LLDB process +#[derive(Debug)] +pub struct LLDBProcess { + lldb_process: Option, + lldb_stdin_tx: mpsc::Sender, + analyser: Arc>, +} + +impl LLDBProcess { + /// Create and setup LLDB + /// + /// Includes spawning the LLDB process and all the relevant stdio handlers. In particular: + /// - Sets up a `ReadOutput` from `util.rs` in order to read output from LLDB; + /// - Sets up a thread to read stdin and forward it onto LLDB stdin; + /// - Checks that LLDB and the program to be ran both exist, otherwise panics. + pub fn new( + debugger_cmd: String, + run_cmd: Vec, + tx_done: Option>, + ) -> Self { + let analyser = Arc::new(Mutex::new(LLDBAnalyser::new())); + + analyser + .lock() + .unwrap() + .analyse_message(Message::LLDBLaunching, tx_done); + + let mut lldb_process = check_and_spawn_process(vec![debugger_cmd], run_cmd); + + LLDBProcess::setup_stdout( + lldb_process + .stdout + .take() + .expect("LLDB process did not have a handle to stdout"), + analyser.clone(), + ); + let lldb_stdin_tx = LLDBProcess::setup_stdin( + lldb_process + .stdin + .take() + .expect("Python process did not have a handle to stdin"), + ); + + LLDBProcess { + lldb_process: Some(lldb_process), + lldb_stdin_tx, + analyser, + } + } + + pub fn stop(&mut self) { + match self.lldb_process.take() { + Some(mut p) => { + p.kill().unwrap(); + } + None => {} + }; + } + + /// Send a message to write to stdin + pub fn send_msg(&mut self, message: Message, tx_done: Option>) { + let mut lldb_stdin_tx = self.lldb_stdin_tx.clone(); + let analyser = self.analyser.clone(); + + let msg = match &message { + Message::LLDBSetup => vec![ + Bytes::from("settings set stop-line-count-after 0\n"), + Bytes::from("settings set stop-line-count-before 0\n"), + Bytes::from("settings set frame-format frame #${frame.index}{ at ${line.file.fullpath}:${line.number}}\\n\n"), + Bytes::from("breakpoint set --name main\n"), + ], + Message::ProcessLaunching => vec![Bytes::from("process launch\n")], + Message::Breakpoint(fl) => vec![Bytes::from(format!( + "breakpoint set --file {} --line {}\n", + fl.name(), + fl.line_num() + ))], + Message::StepIn => vec![Bytes::from("thread step-in\n")], + Message::StepOver => vec![Bytes::from("thread step-over\n")], + Message::Continue => vec![Bytes::from("thread continue\n")], + Message::PrintVariable(v) => vec![Bytes::from(format!("frame variable {}\n", v.name()))], + _ => unreachable!(), + }; + + tokio::spawn(async move { + // TODO: Interrupt, set and then carry on as before? + // + // Something like: + // let (tx, rx) = oneshot::channel(); + // + // match self.analyser.lock().unwrap().get_status() { + // NotRunning => {}, + // Listening => {}, + // Processing(Message) => { + // analyser.lock().unwrap().analyse_message(message, Some(tx)); + // rx.await.unwrap(); + // }, + // } + + for b in msg { + let (tx, rx) = oneshot::channel(); + + analyser + .lock() + .unwrap() + .analyse_message(message.clone(), Some(tx)); + + lldb_stdin_tx.send(b).map(move |_| {}).await; + + rx.await.unwrap(); + } + + match tx_done { + Some(tx) => { + tx.send(true).unwrap(); + } + _ => {} + } + }); + } + + /// Perform setup of listening and forwarding of stdin and return a sender that will forward to the + /// stdin of a process. + fn setup_stdin(mut child_stdin: ChildStdin) -> mpsc::Sender { + let (stdin_tx, mut stdin_rx) = mpsc::channel(32); + let mut tx = stdin_tx.clone(); + + tokio::spawn(async move { + let tokio_stdin = stdin(); + let mut reader = FramedRead::new(tokio_stdin, BytesCodec::new()); + while let Some(line) = reader.next().await { + let buf = line.unwrap().freeze(); + tx.send(buf).await.unwrap(); + } + }); + + tokio::spawn(async move { + while let Some(text) = stdin_rx.next().await { + match child_stdin.write(&text).await { + Ok(_) => {} + Err(e) => { + eprintln!("Writing stdin err e: {}", e); + } + }; + } + }); + + stdin_tx + } + + /// Perform setup of reading LLDB stdout, analysing it and writing it back to stdout. + fn setup_stdout(stdout: ChildStdout, analyser: Arc>) { + tokio::spawn(async move { + let mut reader = read_output(BufReader::new(stdout)); + while let Some(Ok(text)) = reader.next().await { + print!("{}", text); + io::stdout().flush().unwrap(); + analyser.lock().unwrap().analyse_stdout(&text[..]); + } + }); + } +} + +#[derive(Debug)] +pub struct LLDBAnalyser { + status: LLDBStatus, + process_pid: Option, + awakener: Option>, + // For keeping track of the variable that we were told to print + variable_output: String, +} + +impl LLDBAnalyser { + pub fn new() -> Self { + LLDBAnalyser { + status: LLDBStatus::NotRunning, + variable_output: "".to_string(), + awakener: None, + process_pid: None, + } + } + + /// Check the current status, either not running (None), running something + /// (Processing) or listening for a message on LLDB (Listening). + pub fn get_status(&mut self) -> LLDBStatus { + self.status.clone() + } + + // TODO: Find out why I need this? + #[allow(unused_mut)] + pub fn analyse_stdout(&mut self, s: &str) { + // Check process running first + let mut process_running = true; + + for line in s.split("\r\n") { + if self.check_process_not_running(line) { + process_running = false; + } + + if !process_running && line == "(lldb) " { + self.set_listening(); + return; + } + } + + // Then check if we're printing a variable as we bail if not all output is available + // straight away + match self.get_status() { + LLDBStatus::Processing(msg) => match msg { + Message::PrintVariable(var) => { + let mut from = 0; + let mut to = s.len(); + + let print_cmd_size = 15 + var.name().len(); + if to >= print_cmd_size + 2 + && &s[0..print_cmd_size] == &format!("frame variable {}", var.name()) + { + // 2 extra for \r\n + from += print_cmd_size + 2; + } + + self.variable_output += &s[from..to]; + + let output = &self.variable_output[..]; + let mut to = output.len(); + + let lldb_prompt_length = "\r\n(lldb) ".len(); + if to >= lldb_prompt_length + && &self.variable_output[to - lldb_prompt_length..to] == "\r\n(lldb) " + { + to -= lldb_prompt_length; + } + + self.variable_output = output[0..to].to_string(); + } + _ => {} + }, + _ => {} + } + + // Then check everything else + for line in s.split("\r\n") { + if line == "(lldb) " { + match self.get_status() { + LLDBStatus::Processing(msg) => match msg { + Message::PrintVariable(var) => { + if self.variable_output + == format!( + "error: no variable named '{}' found in this frame", + var.name() + ) + { + log_msg( + LogLevel::WARN, + &format!("variable '{}' doesn't exist here", var.name()), + ); + } else { + log_msg(LogLevel::INFO, &self.variable_output); + } + self.variable_output = "".to_string(); + } + _ => {} + }, + _ => {} + } + + self.set_listening(); + return; + } + + match self.get_status() { + LLDBStatus::Listening => self.status = LLDBStatus::Processing(Message::Custom), + _ => {} + } + + match self.get_status() { + LLDBStatus::Processing(msg) => match msg { + Message::LLDBSetup | Message::Breakpoint(_) => { + self.check_breakpoint(line); + } + Message::ProcessLaunching + | Message::StepIn + | Message::StepOver + | Message::Continue => { + self.check_location(line); + self.check_process_exited(line); + } + Message::Custom => { + self.check_breakpoint(line); + self.check_location(line); + self.check_process_exited(line); + } + _ => {} + }, + _ => {} + }; + } + } + + fn set_listening(&mut self) { + self.status = LLDBStatus::Listening; + match self.awakener.take() { + Some(tx) => { + tx.send(true).unwrap(); + } + None => {} + }; + } + + /// Sets up the analyser ready for analysing the message. + /// + /// It sets the status of the analyser to Processing for that message and if given + /// it marks the analyser to send a message to `tx_done` to indicate when the + /// message is processed. + pub fn analyse_message(&mut self, msg: Message, tx_done: Option>) { + self.status = LLDBStatus::Processing(msg); + self.awakener = tx_done; + } + + fn check_breakpoint(&mut self, line: &str) { + lazy_static! { + static ref RE_BREAKPOINT: Regex = Regex::new( + "Breakpoint (\\d+): where = .* at (.*):(\\d+):\\d+, address = 0x[0-9a-f]*$" + ) + .unwrap(); + static ref RE_BREAKPOINT_2: Regex = + Regex::new("Breakpoint (\\d+): where = .* at (.*):(\\d+), address = 0x[0-9a-f]*$") + .unwrap(); + static ref RE_BREAKPOINT_PENDING: Regex = + Regex::new("Breakpoint (\\d+): no locations \\(pending\\)\\.$").unwrap(); + } + + for cap in RE_BREAKPOINT.captures_iter(line) { + let file = cap[2].to_string(); + let line = cap[3].parse::().unwrap(); + log_msg( + LogLevel::INFO, + &format!("Breakpoint set at file {} and line number {}", file, line), + ); + return; + } + + for cap in RE_BREAKPOINT_2.captures_iter(line) { + let file = cap[2].to_string(); + let line = cap[3].parse::().unwrap(); + log_msg( + LogLevel::INFO, + &format!("Breakpoint set at file {} and line number {}", file, line), + ); + return; + } + + for _ in RE_BREAKPOINT_PENDING.captures_iter(line) { + log_msg(LogLevel::INFO, &format!("Breakpoint pending")); + } + } + + fn check_location(&mut self, line: &str) { + lazy_static! { + static ref RE_STOPPED_AT_POSITION: Regex = Regex::new(" *frame #\\d.*$").unwrap(); + static ref RE_JUMP_TO_POSITION: Regex = + Regex::new("^ *frame #\\d at (\\S+):(\\d+)$").unwrap(); + } + + for _ in RE_STOPPED_AT_POSITION.captures_iter(line) { + let mut found = false; + for cap in RE_JUMP_TO_POSITION.captures_iter(line) { + found = true; + let file = cap[1].to_string(); + let line = cap[2].parse::().unwrap(); + jump_to_position(&file, line); + } + + if !found { + log_msg(LogLevel::WARN, "Stopped at unknown position"); + } + } + } + + fn check_process_exited(&mut self, line: &str) { + lazy_static! { + static ref RE_PROCESS_EXITED: Regex = + Regex::new("Process (\\d+) exited with status = (\\d+) \\(0x[0-9a-f]*\\) *$") + .unwrap(); + } + + for cap in RE_PROCESS_EXITED.captures_iter(line) { + let pid = cap[1].parse::().unwrap(); + let exit_code = cap[2].parse::().unwrap(); + self.process_pid = None; + signal_exited(pid, exit_code); + } + } + + fn check_process_not_running(&mut self, line: &str) -> bool { + lazy_static! { + static ref RE_PROCESS_NOT_RUNNING: Regex = + Regex::new("^error: invalid process$").unwrap(); + } + + for _ in RE_PROCESS_NOT_RUNNING.captures_iter(line) { + log_msg(LogLevel::WARN, "No process running"); + return true; + } + + false + } +} diff --git a/padre/debuggers/node/Cargo.toml b/padre/debuggers/node/Cargo.toml new file mode 100644 index 0000000..687a583 --- /dev/null +++ b/padre/debuggers/node/Cargo.toml @@ -0,0 +1,24 @@ +[package] +name = "padre_node" +version = "0.2.0" +authors = ["Steven Trotter "] +edition = "2018" +license = "MIT" +repository = "https://github.com/strottos/vim-padre" + +[lib] +path = "src/lib.rs" + +[dependencies] +bytes = "0.5.0" +futures = "0.3.1" +lazy_static = "1.3.0" +padre_core = { path = "../../core", version = "0.2.0" } +regex = "1.1.2" +serde = "1.0" +serde_derive = "1.0" +serde_json = "1.0" +tokio = { version = "0.2.13", features = [] } +tokio-util = { version = "0.2.0", features = ["codec"] } +tokio-tungstenite = "*" +url = "2.1.1" diff --git a/padre/src/debugger/node/analyser.rs b/padre/debuggers/node/src/analyser.rs similarity index 68% rename from padre/src/debugger/node/analyser.rs rename to padre/debuggers/node/src/analyser.rs index 510a28d..eca6991 100644 --- a/padre/src/debugger/node/analyser.rs +++ b/padre/debuggers/node/src/analyser.rs @@ -2,14 +2,12 @@ //! //! Analyses the messages that come from the WebSocket connection to Node Debugger -use std::sync::{Arc, Mutex}; +use super::utils::get_json; +use padre_core::debugger::FileLocation; +use padre_core::notifier::{jump_to_position, log_msg, signal_exited, LogLevel}; -use super::ws::WSHandler; -use crate::debugger::FileLocation; -use crate::notifier::{breakpoint_set, jump_to_position, log_msg, signal_exited, LogLevel}; - -use tokio::prelude::*; -use websocket::OwnedMessage; +use tokio::sync::{mpsc, oneshot}; +use tokio_tungstenite::tungstenite::protocol::Message; /// Node script, indicated by receiving a 'Debugger.scriptParsed' message from Node #[derive(Debug, Eq, PartialEq)] @@ -37,22 +35,24 @@ impl Script { pub struct Analyser { scripts: Vec