From 1bc433b5a3a861863dcb457d3a391ae6f28c9756 Mon Sep 17 00:00:00 2001 From: Vadim Chugunov Date: Wed, 28 Aug 2019 11:00:04 -0700 Subject: [PATCH] Optional python. --- .gitignore | 8 +- .vscode/launch.json | 47 +- .vscode/settings.json | 2 +- .vscode/tasks.json | 6 - CMakeLists.txt | 5 + Cargo.lock | 445 ++++++++++-------- adapter2/CMakeLists.txt | 41 +- adapter2/Cargo.toml | 8 +- adapter2/deps/loading/Cargo.toml | 8 + adapter2/deps/loading/src/lib.rs | 88 ++++ adapter2/deps/python/Cargo.toml | 21 + .../python.rs => deps/python/src/impl.rs} | 219 ++++----- adapter2/deps/python/src/lib.rs | 59 +++ adapter2/src/bin/codelldb.rs | 123 ++--- adapter2/src/debug_session.rs | 191 +++++--- adapter2/src/error.rs | 10 + adapter2/src/lib.rs | 44 +- azure-pipelines.yml | 2 +- codelldb.code-workspace | 2 +- extension/novsc/adapter.ts | 2 +- 20 files changed, 802 insertions(+), 529 deletions(-) create mode 100644 adapter2/deps/loading/Cargo.toml create mode 100644 adapter2/deps/loading/src/lib.rs create mode 100644 adapter2/deps/python/Cargo.toml rename adapter2/{src/python.rs => deps/python/src/impl.rs} (58%) create mode 100644 adapter2/deps/python/src/lib.rs diff --git a/.gitignore b/.gitignore index 3ef024e2..98b38b96 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ -.vscode -build* -target -node_modules +.vscode/ +build*/ +target/ +node_modules/ *.pyc diff --git a/.vscode/launch.json b/.vscode/launch.json index e0da556b..d243907e 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -1,6 +1,12 @@ { "version": "0.2.0", "configurations": [ + { + "type": "lldb", + "request": "attach", + "name": "Attach", + "pid": "${command:pickMyProcess}" // use ${command:pickProcess} to pick other users' processes + }, { "name": "extension", "preLaunchTask": "make dev_debugging", @@ -40,7 +46,7 @@ "request": "launch", "program": "${workspaceFolder}/build/adapter2/codelldb", "args": [ - "--preload=${workspaceFolder}/build/lldb/lib/liblldb.so.8.0.1-custom", + //"--liblldb=${workspaceFolder}/build/lldb/lib/liblldb.so", "--multi-session", "--port=4711" ], @@ -48,6 +54,9 @@ "RUST_LOG": "error,codelldb=debug", "RUST_LOG_STYLE": "always", "RUST_BACKTRACE": "1", + // "LLDB_DISABLE_PYTHON": "1", + // "LD_DEBUG": "all", + // "LD_DEBUG_OUTPUT": "/tmp/codelldb.log" }, "sourceLanguages": [ "cpp", @@ -62,7 +71,7 @@ "request": "launch", "program": "${workspaceFolder}/build/adapter2/codelldb", "args": [ - "--preload=${workspaceFolder}/build/lldb/lib/liblldb.8.0.1-custom.dylib", + //"--preload=${workspaceFolder}/build/lldb/lib/liblldb.dylib", "--multi-session", "--port=4711" ], @@ -84,7 +93,7 @@ "request": "launch", "program": "${workspaceFolder}/build/adapter2/codelldb", "args": [ - "--preload=${workspaceFolder}/build/lldb/bin/liblldb.dll", + //"--preload=${workspaceFolder}/build/lldb/bin/liblldb.dll", "--multi-session", "--port=4711" ], @@ -114,13 +123,27 @@ "stopAtEntry": false, "cwd": "${workspaceFolder}", "environment": [ - { "name": "PATH", "value":"${env:PATH};C:\\Python36-64;${workspaceFolder}\\build\\lldb\\bin" }, - { "name":"RUST_LOG", "value":"error,codelldb=debug"}, - { "name":"RUST_LOG_STYLE", "value":"always"}, - { "name":"RUST_BACKTRACE", "value":"full"}, + { + "name": "PATH", + "value": "${env:PATH};C:\\Python36-64;${workspaceFolder}\\build\\lldb\\bin" + }, + { + "name": "RUST_LOG", + "value": "error,codelldb=debug" + }, + { + "name": "RUST_LOG_STYLE", + "value": "always" + }, + { + "name": "RUST_BACKTRACE", + "value": "full" + }, ], //"externalConsole": true, - "sourceFileMap": { "C:\\_work\\4\\s": "c:\\NW\\cpython" } + "sourceFileMap": { + "C:\\_work\\4\\s": "c:\\NW\\cpython" + } }, { "name": "codelldb python", @@ -155,7 +178,6 @@ "--test-threads=1" ], "env": { - "PATH": "${env:PATH}:/usr/lib/llvm-6.0/bin", "RUST_LOG": "debug", "RUST_BACKTRACE": "1", }, @@ -173,8 +195,10 @@ "cwd": "${workspaceRoot}/build", "program": "${workspaceRoot}/build/node_modules/mocha/bin/_mocha", "args": [ - "-u", "tdd", - "--timeout", "999999", + "-u", + "tdd", + "--timeout", + "999999", "--colors", "--exit", //"-g", "Environment", @@ -213,5 +237,6 @@ "target modules load --file ${env:HOME}/tmp/echo -s 0x4000000000" ] }, + ] } diff --git a/.vscode/settings.json b/.vscode/settings.json index 330f1fa3..62de4069 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -11,5 +11,5 @@ "files.insertFinalNewline": true, "files.trimTrailingWhitespace": true, "python.linting.enabled": false, - "lldb.verboseLogging": true + "lldb.verboseLogging": true, } diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 2fa3af8d..8515ef18 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -72,12 +72,6 @@ "doc_lldb" ] }, - { - "label": "make test_codelldb", - "args": [ - "test_codelldb" - ] - }, { "label": "make cargo_test", "args": [ diff --git a/CMakeLists.txt b/CMakeLists.txt index 69029884..12291cb2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,5 @@ cmake_minimum_required(VERSION 3.10) +project(CodeLLDB) set(VERSION 1.3.1-dev) @@ -9,6 +10,7 @@ set(LLDB_ROOT $ENV{LLDB_ROOT} CACHE PATH "Root of LLDB build directory") if (NOT LLDB_ROOT) message(FATAL_ERROR "LLDB_ROOT not set." ) endif() +message("Using LLDB from ${LLDB_ROOT}") set(CMAKE_CXX_STANDARD 11) set(CMAKE_INSTALL_PREFIX $ENV{HOME}/.vscode/extensions/vscode-lldb CACHE PATH "Install location") @@ -103,9 +105,12 @@ set(PackagedFilesFull adapter2/*.py adapter2/codelldb adapter2/libcodelldb.so + adapter2/libcodelldb_python.so adapter2/libcodelldb.dylib + adapter2/libcodelldb_python.dylib adapter2/codelldb.exe adapter2/codelldb.dll + adapter2/codelldb_python.dll lldb/bin/**/* lldb/lib/**/* ) diff --git a/Cargo.lock b/Cargo.lock index e269e303..9809c602 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5,8 +5,8 @@ name = "Inflector" version = "0.11.4" 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)", - "regex 1.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -19,7 +19,7 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "0.7.4" +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)", @@ -30,7 +30,7 @@ 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)", + "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -46,24 +46,24 @@ name = "atty" version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.7 (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.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "autocfg" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "backtrace" -version = "0.3.33" +version = "0.3.35" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "backtrace-sys 0.1.31 (registry+https://github.com/rust-lang/crates.io-index)", "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-demangle 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-demangle 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -71,8 +71,8 @@ name = "backtrace-sys" version = "0.1.31" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cc 1.0.37 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", + "cc 1.0.41 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -96,7 +96,7 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.37" +version = "1.0.41" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -114,7 +114,7 @@ dependencies = [ "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.5 (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)", ] @@ -132,25 +132,37 @@ version = "1.0.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)", - "cpython 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "codelldb_python 0.1.0", "crossterm 0.9.6 (registry+https://github.com/rust-lang/crates.io-index)", "debug-protocol 0.1.0", "env_logger 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", "failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "failure_derive 0.1.5 (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.60 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", "lldb 0.1.0", - "log 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 1.1.9 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.97 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.97 (registry+https://github.com/rust-lang/crates.io-index)", + "loading 0.1.0", + "log 0.4.8 (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)", "superslice 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "tokio 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "codelldb_python" +version = "0.1.0" +dependencies = [ + "cpython 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "env_logger 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", + "failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "lldb 0.1.0", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "cpp" version = "0.5.3" @@ -164,12 +176,12 @@ name = "cpp_build" version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cc 1.0.37 (registry+https://github.com/rust-lang/crates.io-index)", + "cc 1.0.41 (registry+https://github.com/rust-lang/crates.io-index)", "cpp_common 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 1.1.9 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.39 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.44 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -178,9 +190,9 @@ name = "cpp_common" version = "0.5.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)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.39 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.44 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -191,21 +203,21 @@ dependencies = [ "aho-corasick 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)", "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "cpp_common 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.39 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.44 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "cpython" -version = "0.2.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", - "python27-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "python3-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "python27-sys 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "python3-sys 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -213,21 +225,21 @@ name = "crossbeam-deque" version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "crossbeam-epoch 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", - "crossbeam-utils 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", + "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)", ] [[package]] name = "crossbeam-epoch" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" 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.5 (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.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "scopeguard 0.3.3 (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.4.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)", ] [[package]] @@ -235,16 +247,16 @@ name = "crossbeam-queue" version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "crossbeam-utils 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "crossbeam-utils" -version = "0.6.5" +version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" 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)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -252,44 +264,44 @@ name = "crossterm" version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "crossterm_cursor 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", - "crossterm_input 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", - "crossterm_screen 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "crossterm_cursor 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", + "crossterm_input 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", + "crossterm_screen 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", "crossterm_style 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", - "crossterm_terminal 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", - "crossterm_utils 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "crossterm_terminal 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", + "crossterm_utils 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "crossterm_cursor" -version = "0.2.4" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "crossterm_utils 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "crossterm_winapi 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", + "crossterm_utils 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", + "crossterm_winapi 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "crossterm_input" -version = "0.3.6" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "crossterm_screen 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "crossterm_utils 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "crossterm_winapi 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", + "crossterm_screen 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "crossterm_utils 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", + "crossterm_winapi 0.1.5 (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.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "crossterm_screen" -version = "0.2.3" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "crossterm_utils 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "crossterm_winapi 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", + "crossterm_utils 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", + "crossterm_winapi 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -297,38 +309,38 @@ name = "crossterm_style" version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "crossterm_utils 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "crossterm_winapi 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", + "crossterm_utils 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", + "crossterm_winapi 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "crossterm_terminal" -version = "0.2.4" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "crossterm_cursor 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", - "crossterm_utils 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "crossterm_winapi 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", + "crossterm_cursor 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", + "crossterm_utils 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", + "crossterm_winapi 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "crossterm_utils" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "crossterm_winapi 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", + "crossterm_winapi 0.1.5 (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.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "crossterm_winapi" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -336,8 +348,8 @@ name = "debug-protocol" version = "0.1.0" dependencies = [ "schemafy 0.4.5-alpha.0", - "serde 1.0.97 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.97 (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)", ] @@ -353,8 +365,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "atty 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", "humantime 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 1.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "termcolor 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -363,7 +375,7 @@ name = "failure" version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "backtrace 0.3.33 (registry+https://github.com/rust-lang/crates.io-index)", + "backtrace 0.3.35 (registry+https://github.com/rust-lang/crates.io-index)", "failure_derive 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -374,7 +386,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.39 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.44 (registry+https://github.com/rust-lang/crates.io-index)", "synstructure 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -420,7 +432,7 @@ name = "iovec" version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", + "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)", ] @@ -448,12 +460,12 @@ dependencies = [ [[package]] name = "lazy_static" -version = "1.3.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "libc" -version = "0.2.60" +version = "0.2.62" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -463,7 +475,14 @@ dependencies = [ "bitflags 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "cpp 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)", "cpp_build 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "loading" +version = "0.1.0" +dependencies = [ + "failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -477,7 +496,7 @@ dependencies = [ [[package]] name = "log" -version = "0.4.7" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", @@ -490,8 +509,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "memoffset" -version = "0.2.1" +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 = "mio" @@ -502,8 +524,8 @@ dependencies = [ "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.60 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.7 (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)", @@ -516,7 +538,7 @@ version = "0.6.7" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.60 (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)", ] @@ -537,8 +559,8 @@ version = "0.2.33" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.7 (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.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -551,7 +573,7 @@ name = "num-traits" version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "autocfg 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "autocfg 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -559,7 +581,7 @@ name = "num_cpus" version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -584,11 +606,11 @@ name = "parking_lot_core" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", + "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)", + "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -599,22 +621,30 @@ dependencies = [ "unicode-xid 0.1.0 (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 = "python27-sys" -version = "0.2.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 1.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "python3-sys" -version = "0.2.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 1.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -635,22 +665,30 @@ dependencies = [ "proc-macro2 0.4.30 (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 = "rand" version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "autocfg 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", + "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.0 (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)", + "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -658,7 +696,7 @@ name = "rand_chacha" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "autocfg 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "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)", ] @@ -667,12 +705,12 @@ name = "rand_core" version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "rand_core 0.4.0 (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_core" -version = "0.4.0" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -696,9 +734,9 @@ name = "rand_jitter" version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", - "rand_core 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)", + "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.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -708,10 +746,10 @@ 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.60 (registry+https://github.com/rust-lang/crates.io-index)", - "rand_core 0.4.0 (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)", + "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -719,8 +757,8 @@ name = "rand_pcg" version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "autocfg 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "rand_core 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "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]] @@ -741,27 +779,23 @@ dependencies = [ [[package]] name = "regex" -version = "1.1.9" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "aho-corasick 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)", + "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.8 (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)", - "utf8-ranges 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "regex-syntax" -version = "0.6.8" +version = "0.6.11" source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "ucd-util 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", -] [[package]] name = "rustc-demangle" -version = "0.1.15" +version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -785,8 +819,8 @@ dependencies = [ "itertools 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", "schemafy_snapshot 0.4.1", - "serde 1.0.97 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.97 (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)", ] @@ -797,8 +831,8 @@ dependencies = [ "Inflector 0.11.4 (registry+https://github.com/rust-lang/crates.io-index)", "itertools 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.97 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.97 (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)", ] @@ -807,6 +841,11 @@ 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 = "semver" version = "0.9.0" @@ -822,17 +861,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "serde" -version = "1.0.97" +version = "1.0.99" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "serde_derive" -version = "1.0.97" +version = "1.0.99" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.39 (registry+https://github.com/rust-lang/crates.io-index)", + "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]] @@ -842,7 +881,7 @@ 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.97 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -872,7 +911,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "syn" -version = "0.15.39" +version = "0.15.44" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", @@ -880,6 +919,16 @@ dependencies = [ "unicode-xid 0.1.0 (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 = "synstructure" version = "0.10.2" @@ -887,7 +936,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.39 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.44 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -896,7 +945,7 @@ name = "termcolor" version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "wincolor 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "wincolor 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -904,7 +953,7 @@ name = "textwrap" version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-width 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -912,7 +961,7 @@ 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)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -934,7 +983,7 @@ dependencies = [ "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-udp 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-uds 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -962,7 +1011,7 @@ name = "tokio-executor" version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "crossbeam-utils 0.6.5 (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)", ] @@ -983,7 +1032,7 @@ 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.7 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -991,10 +1040,10 @@ name = "tokio-reactor" version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "crossbeam-utils 0.6.5 (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)", - "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.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)", @@ -1033,9 +1082,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" 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.5 (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.7 (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)", @@ -1047,7 +1096,7 @@ name = "tokio-timer" version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "crossbeam-utils 0.6.5 (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)", "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)", @@ -1055,12 +1104,12 @@ dependencies = [ [[package]] name = "tokio-udp" -version = "0.1.3" +version = "0.1.4" 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.7 (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)", @@ -1075,8 +1124,8 @@ 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.60 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.7 (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)", @@ -1084,14 +1133,9 @@ dependencies = [ "tokio-reactor 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "ucd-util" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "unicode-width" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -1100,8 +1144,8 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] -name = "utf8-ranges" -version = "1.0.3" +name = "unicode-xid" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -1116,7 +1160,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "winapi" -version = "0.3.7" +version = "0.3.8" 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)", @@ -1138,7 +1182,7 @@ name = "winapi-util" version = "0.1.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)", + "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1148,10 +1192,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "wincolor" -version = "1.0.1" +version = "1.0.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)", + "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", "winapi-util 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1167,17 +1211,17 @@ dependencies = [ [metadata] "checksum Inflector 0.11.4 (registry+https://github.com/rust-lang/crates.io-index)" = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3" "checksum aho-corasick 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)" = "81ce3d38065e618af2d7b77e10c5ad9a069859b4be3c2250f674af3840d9c8a5" -"checksum aho-corasick 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)" = "36b7aa1ccb7d7ea3f437cf025a2ab1c47cc6c1bc9fc84918ff449def12f5e282" +"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 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.5 (registry+https://github.com/rust-lang/crates.io-index)" = "22130e92352b948e7e82a49cdb0aa94f2211761117f29e052dd397c1ac33542b" -"checksum backtrace 0.3.33 (registry+https://github.com/rust-lang/crates.io-index)" = "88fb679bc9af8fa639198790a77f52d345fe13656c08b43afa9424c206b731c6" +"checksum autocfg 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "b671c8fb71b457dd4ae18c4ba1e59aa81793daacc361d82fcd410cef0d491875" +"checksum backtrace 0.3.35 (registry+https://github.com/rust-lang/crates.io-index)" = "1371048253fa3bac6704bfd6bbfc922ee9bdcee8881330d40f308b81cc5adc55" "checksum backtrace-sys 0.1.31 (registry+https://github.com/rust-lang/crates.io-index)" = "82a830b4ef2d1124a711c71d263c5abdc710ef8e907bd508c88be475cebc422b" "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 cc 1.0.37 (registry+https://github.com/rust-lang/crates.io-index)" = "39f75544d7bbaf57560d2168f28fd649ff9c76153874db88bdbdfd839b1a7e7d" +"checksum cc 1.0.41 (registry+https://github.com/rust-lang/crates.io-index)" = "8dae9c4b8fedcae85592ba623c4fd08cfdab3e3b72d6df780c6ead964a69bfff" "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" @@ -1185,19 +1229,19 @@ dependencies = [ "checksum cpp_build 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3b1282629429cdf0740399fd108fdc57d3e560c10c7f192a67d8ae3d1c0305cd" "checksum cpp_common 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "cd56d2b23d3b0843ae574e1b89fd15736a2775236e92415f353de24eee50480b" "checksum cpp_macros 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "31268f32bb5b37fe7e0bde77e300b5375286fa0957ee90f57d1648b8901366f4" -"checksum cpython 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b489034e723e7f5109fecd19b719e664f89ef925be785885252469e9822fa940" +"checksum cpython 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "85532c648315aeb0829ad216a6a29aa3212cf9319bc7f6daf1404aa0bdd1485f" "checksum crossbeam-deque 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b18cd2e169ad86297e6bc0ad9aa679aee9daa4f19e8163860faf7c164e4f5a71" -"checksum crossbeam-epoch 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "04c9e3102cc2d69cd681412141b390abd55a362afc1540965dad0ad4d34280b4" +"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.5 (registry+https://github.com/rust-lang/crates.io-index)" = "f8306fcef4a7b563b76b7dd949ca48f52bc1141aa067d2ea09565f3e2652aa5c" +"checksum crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)" = "04973fa96e96579258a5091af6003abde64af786b860f18622b82e026cca60e6" "checksum crossterm 0.9.6 (registry+https://github.com/rust-lang/crates.io-index)" = "21ac79357981b3c35917a377e6138729b66316db7649f9f96fbb517bb02361e5" -"checksum crossterm_cursor 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "4b8ddb43937bfafbe07d349ee9497754ceac818ee872116afccb076f2de28d3d" -"checksum crossterm_input 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "a23a71b51ddc8f74e13e341179b1a26b20f0030d14ff8fbdd9da45fd0e342bc5" -"checksum crossterm_screen 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "90889b9f1d7867a583dede34deab1e32a10379e9eb70d920ca7895e144aa6d65" +"checksum crossterm_cursor 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "fb4bfd085f17d83e6cd2943f0150d3b4331e465de8dba1750d1966192faf63dc" +"checksum crossterm_input 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "c6dd255ca05a596bae31ec392fdb67a829509bb767213f00f37c6b62814db663" +"checksum crossterm_screen 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "0bf294484fc34c22d514c41afc0b97ce74e10ea54d6eb5fe4806d1e1ac0f7b76" "checksum crossterm_style 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "983596405fe738aac9645656b666073fe6e0a8bf088679b7e256916ee41b61f7" -"checksum crossterm_terminal 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "18792c97c5cdcc5fd3582df58188a793bf290af4a53d5fc8442c7d17e003b356" -"checksum crossterm_utils 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8321d40908d0ee77cb29335f591eae2b4f7225152f81b9dfa35a161ca3b077dc" -"checksum crossterm_winapi 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8c061e4a1c47a53952ba0f2396c00a61cd7ab74482eba99b9c9cc77fdca71932" +"checksum crossterm_terminal 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "db8546b519e0c26aa1f43a4a4ea45ccb41eaca74b9a753ea1788f9ad90212636" +"checksum crossterm_utils 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "f874a71b2040c730669ddff805c9bc2a1a2f6de9d7f6aab2ae8d29ccbf8a0617" +"checksum crossterm_winapi 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "b055e7cc627c452e6a9b977022f48a2db6f0ff73df446ca970f95eef9c381d45" "checksum either 1.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "5527cfe0d098f36e3f8839852688e63c8fff1c90b2b405aef730615f9a7bcf7b" "checksum env_logger 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "aafcde04e90a5226a6443b7aabdb016ba2f8307c847d524724bd9b346dd1a2d3" "checksum failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "795bd83d3abeb9220f257e597aa0080a508b27533824adf336529648f6abf7e2" @@ -1212,12 +1256,12 @@ dependencies = [ "checksum itertools 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5b8467d9c1cebe26feb08c640139247fac215782d35371ade9a2136ed6085358" "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 lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bc5729f27f159ddd61f4df6228e827e86643d4d3e7c32183cb30a1c08f604a14" -"checksum libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)" = "d44e80633f007889c7eff624b709ab43c92d708caad982295768a7b13ca3b5eb" +"checksum lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +"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.4.7 (registry+https://github.com/rust-lang/crates.io-index)" = "c275b6ad54070ac2d665eef9197db647b32239c9d244bfb6f041a766d00da5b3" +"checksum log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7" "checksum memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "88579771288728879b57485cc7d6b07d648c9f0141eb955f8ab7f9d45394468e" -"checksum memoffset 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0f9dc261e2b62d7a622bf416ea3c5245cdd5d9a7fcc428c0d06804dfce1775b3" +"checksum memoffset 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ce6075db033bbbb7ee5a0bbd3a3186bbae616f57fb001c485c7ff77955f8177f" "checksum mio 0.6.19 (registry+https://github.com/rust-lang/crates.io-index)" = "83f51996a3ed004ef184e16818edc51fadffe8e7ca68be67f9dee67d84d0ff23" "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" @@ -1229,15 +1273,17 @@ dependencies = [ "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 proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)" = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759" -"checksum python27-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "56114c37d4dca82526d74009df7782a28c871ac9d36b19d4cb9e67672258527e" -"checksum python3-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "61e4aac43f833fd637e429506cb2ac9d7df672c4b68f2eaaa163649b7fdc0444" +"checksum proc-macro2 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4c5c2380ae88876faae57698be9e9775e3544decad214599c3a6266cca6ac802" +"checksum python27-sys 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "372555e88a6bc8109eb641380240dc8d25a128fc48363ec9075664daadffdd5b" +"checksum python3-sys 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f3a8ebed3f1201fda179f3960609dbbc10cd8c75e9f2afcb03788278f367d8ea" "checksum quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9274b940887ce9addde99c4eee6b5c44cc494b182b97e73dc8ffdcb3397fd3f0" "checksum quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6e920b65c65f10b2ae65c831a81a073a89edd28c7cce89475bff467ab4167a" "checksum quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)" = "6ce23b6b870e8f94f81fb0a363d65d86675884b34a09043c81e5562f11c1f8e1" +"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_chacha 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "556d3a1ca6600bfcbab7c7c91ccb085ac7fbbcd70e008a98742e7847f4f7bcef" "checksum rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b" -"checksum rand_core 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d0e7a549d590831370895ab7ba4ea0c1b6b011d106b5ff2da6eee112615e6dc0" +"checksum rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc" "checksum rand_hc 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7b40677c7be09ae76218dc623efbf7b18e34bced3f38883af07bb75630a21bc4" "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" @@ -1245,23 +1291,25 @@ dependencies = [ "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 regex 1.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "d9d8297cc20bbb6184f8b45ff61c8ee6a9ac56c156cec8e38c3e5084773c44ad" -"checksum regex-syntax 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)" = "9b01330cce219c1c6b2e209e5ed64ccd587ae5c67bed91c0b49eecf02ae40e21" -"checksum rustc-demangle 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)" = "a7f4dccf6f4891ebcc0c39f9b6eb1a83b9bf5d747cb439ec6fba4f3b977038af" +"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 rustc-demangle 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "4c691c0e608126e00913e33f0ccf3727d5fc84573623b8d65b2df340b5201783" "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 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 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.97 (registry+https://github.com/rust-lang/crates.io-index)" = "d46b3dfedb19360a74316866cef04687cd4d6a70df8e6a506c63512790769b72" -"checksum serde_derive 1.0.97 (registry+https://github.com/rust-lang/crates.io-index)" = "c22a0820adfe2f257b098714323563dd06426502abbbce4f51b72ef544c5027f" +"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 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 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 superslice 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ab16ced94dbd8a46c82fd81e3ed9a8727dac2977ea869d217bcc4ea1f122e81f" -"checksum syn 0.15.39 (registry+https://github.com/rust-lang/crates.io-index)" = "b4d960b829a55e56db167e861ddb43602c003c7be0bee1d345021703fac2fb7c" +"checksum syn 0.15.44 (registry+https://github.com/rust-lang/crates.io-index)" = "9ca4b3b69a77cbe1ffc9e198781b7acb0c7365a883670e8f1c1bc66fba79a5c5" +"checksum syn 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "66850e97125af79138385e9b88339cbcd037e3f28ceab8c5ad98e64f0f1f80bf" "checksum synstructure 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)" = "02353edf96d6e4dc81aea2d8490a7e9db177bf8acb0e951c24940bf866cb313f" "checksum termcolor 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "96d6098003bde162e4277c70665bd87c326f5a0c3f3fbfb285787fa482d54e6e" "checksum textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" @@ -1277,18 +1325,17 @@ dependencies = [ "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-udp 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "66268575b80f4a4a710ef83d087fdfeeabdce9b74c797535fbac18a2cb906e92" +"checksum tokio-udp 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "56775b287cda0fd8ca0c5d2f5b1d0646afbd360101e2eef91cd89365fcfc2f5f" "checksum tokio-uds 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "037ffc3ba0e12a0ab4aca92e5234e0dedeb48fddf6ccd260f1f150a36a9f2445" -"checksum ucd-util 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "535c204ee4d8434478593480b8f86ab45ec9aae0e83c568ca81abf0fd0e88f86" -"checksum unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "882386231c45df4700b275c7ff55b6f3698780a650026380e72dabe76fa46526" +"checksum unicode-width 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "7007dbd421b92cc6e28410fe7362e2e0a2503394908f417b68ec8d1c364c4e20" "checksum unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" -"checksum utf8-ranges 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "9d50aa7650df78abf942826607c62468ce18d9019673d4a2ebe1865dbb96ffde" +"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 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "8093091eeb260906a183e6ae1abdba2ef5ef2257a21801128899c3fc699229c6" "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-util 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7168bab6e1daee33b4557efd0e95d5ca70a03706d39fa5f3fe7a236f584b03c9" "checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" -"checksum wincolor 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "561ed901ae465d6185fa7864d63fbd5720d0ef718366c9a4dc83cf6170d7e9ba" +"checksum wincolor 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "96f5016b18804d24db43cebf3c77269e7569b8954a8464501c216cc5e070eaa9" "checksum ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e" diff --git a/adapter2/CMakeLists.txt b/adapter2/CMakeLists.txt index 43bfa235..cfadbd77 100644 --- a/adapter2/CMakeLists.txt +++ b/adapter2/CMakeLists.txt @@ -6,8 +6,6 @@ if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux") endif() elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") set(CPythonFeature python2) - # We want to play games with loading liblldb dynamically, - # so we need to prevent OSX loader from trying to load it on its own. set(RustFlags -Clink-args='-undefined dynamic_lookup') set(Target x86_64-apple-darwin) elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") @@ -16,9 +14,9 @@ elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") set(Target x86_64-pc-windows-msvc) endif() -set(CargoFlags ${CargoFlags} --manifest-path=${CMAKE_SOURCE_DIR}/Cargo.toml) -set(CargoFlags ${CargoFlags} -Zpackage-features --no-default-features --features=${CPythonFeature}) -set(CargoFlags ${CargoFlags} --target=${Target} --target-dir=${CMAKE_BINARY_DIR}/target) +set(CargoFlags ${CargoFlags} --manifest-path=${CMAKE_SOURCE_DIR}/Cargo.toml + --target=${Target} --target-dir=${CMAKE_BINARY_DIR}/target + -Zpackage-features) if (CMAKE_BUILD_TYPE MATCHES Release|RelWithDebInfo) set(CargoFlags ${CargoFlags} --release) set(CargoOutDir ${CMAKE_BINARY_DIR}/target/${Target}/release) @@ -26,8 +24,6 @@ else() set(CargoOutDir ${CMAKE_BINARY_DIR}/target/${Target}/debug) endif() - - add_copy_files_to(PythonFiles ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_SOURCE_DIR}/adapter2/codelldb.py ${CMAKE_SOURCE_DIR}/adapter2/value.py @@ -35,17 +31,36 @@ add_copy_files_to(PythonFiles ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_SOURCE_DIR}/formatters/rust.py ) +set(copy_file ${CMAKE_COMMAND} -E copy_if_different) + add_custom_target(codelldb ALL - DEPENDS lldb ${PythonFiles} - COMMAND cargo rustc --package=codelldb --lib ${CargoFlags} -- ${RustFlags} + DEPENDS codelldb_bin codelldb_lib codelldb_python +) + +add_custom_target(codelldb_bin COMMAND cargo rustc --package=codelldb --bin codelldb ${CargoFlags} - COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CargoOutDir}/codelldb${ExeSuffix} ${CMAKE_CURRENT_BINARY_DIR} - COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CargoOutDir}/${DylibPrefix}codelldb${DylibSuffix} ${CMAKE_CURRENT_BINARY_DIR} - COMMENT "Running cargo build" + COMMAND ${copy_file} ${CargoOutDir}/codelldb${ExeSuffix} ${CMAKE_CURRENT_BINARY_DIR} + COMMENT "Building codelldb_bin" + USES_TERMINAL +) + +add_custom_target(codelldb_lib + DEPENDS lldb + COMMAND cargo rustc --package=codelldb --lib ${CargoFlags} --no-default-features -- ${RustFlags} + COMMAND ${copy_file} ${CargoOutDir}/${DylibPrefix}codelldb${DylibSuffix} ${CMAKE_CURRENT_BINARY_DIR} + COMMENT "Building codelldb_lib" + USES_TERMINAL +) + +add_custom_target(codelldb_python + DEPENDS lldb ${PythonFiles} + COMMAND cargo rustc --package=codelldb_python --example codelldb_python ${CargoFlags} --no-default-features --features=${CPythonFeature} -- ${RustFlags} + COMMAND ${copy_file} ${CargoOutDir}/examples/${DylibPrefix}codelldb_python${DylibSuffix} ${CMAKE_CURRENT_BINARY_DIR} + COMMENT "Building codelldb_python" USES_TERMINAL ) add_custom_target(cargo_test - COMMAND ${CMAKE_COMMAND} -E env RUST_BACKTRACE=1 cargo test ${Features} -p=lldb -p=debug-protocol -p=codelldb + COMMAND ${CMAKE_COMMAND} -E env RUST_BACKTRACE=1 RUSTFLAGS="-lpython2.7" cargo test ${Features} -p=lldb -p=debug-protocol -p=codelldb USES_TERMINAL ) diff --git a/adapter2/Cargo.toml b/adapter2/Cargo.toml index b3d765d2..c47c39c4 100644 --- a/adapter2/Cargo.toml +++ b/adapter2/Cargo.toml @@ -7,7 +7,6 @@ edition = "2018" [dependencies] bytes = "0.4.11" clap = "2.33.0" -cpython = { version = "0.2.1", default-features = false } crossterm = "0.9.6" env_logger = "0.6.2" failure = "0.1.5" @@ -16,7 +15,9 @@ futures = "0.1.28" lazy_static = "1.3.0" libc = "0.2.59" lldb = { path = "deps/lldb" } +loading = { path = "deps/loading" } log = "0.4.7" +codelldb_python = { path = "deps/python" } raw_debug_protocol = { package = "debug-protocol", path = "deps/debug-protocol" } regex = "1.1.9" serde = "1.0.94" @@ -25,10 +26,5 @@ serde_json = "1.0.40" superslice = "1.0.0" tokio = "0.1.22" -[features] -default = ["python2"] -python2 = ["cpython/python27-sys"] -python3 = ["cpython/python3-sys"] - [lib] crate-type = ["cdylib"] diff --git a/adapter2/deps/loading/Cargo.toml b/adapter2/deps/loading/Cargo.toml new file mode 100644 index 00000000..0866b5ab --- /dev/null +++ b/adapter2/deps/loading/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "loading" +version = "0.1.0" +authors = ["Vadim Chugunov "] +edition = "2018" + +[dependencies] +failure = "0.1.5" diff --git a/adapter2/deps/loading/src/lib.rs b/adapter2/deps/loading/src/lib.rs new file mode 100644 index 00000000..abf99203 --- /dev/null +++ b/adapter2/deps/loading/src/lib.rs @@ -0,0 +1,88 @@ +pub fn get_dylib_filename(basename: &str) -> String { + if cfg!(windows) { + format!("{}.dll", basename) + } else if cfg!(target_os = "macos") { + format!("lib{}.dylib", basename) + } else { + format!("lib{}.so", basename) + } +} + +pub use platform::*; +pub type Handle = *const std::os::raw::c_void; + +#[cfg(unix)] +mod platform { + use failure::*; + use std::ffi::{CStr, CString}; + use std::os::raw::{c_char, c_int, c_void}; + use std::path::Path; + + #[link(name = "dl")] + extern "C" { + fn dlopen(filename: *const c_char, flag: c_int) -> *const c_void; + fn dlsym(handle: *const c_void, symbol: *const c_char) -> *const c_void; + fn dlerror() -> *const c_char; + } + const RTLD_LAZY: c_int = 0x00001; + const RTLD_GLOBAL: c_int = 0x00100; + + pub unsafe fn load_library(path: &Path, global_symbols: bool) -> Result<*const c_void, Error> { + let cpath = CString::new(path.as_os_str().to_str().unwrap().as_bytes()).unwrap(); + let flags = match global_symbols { + true => RTLD_LAZY | RTLD_GLOBAL, + false => RTLD_LAZY, + }; + let handle = dlopen(cpath.as_ptr() as *const c_char, flags); + if handle.is_null() { + Err(format_err!("{:?}", CStr::from_ptr(dlerror()))) + } else { + Ok(handle) + } + } + + pub unsafe fn find_symbol(handle: *const c_void, name: &str) -> Result<*const c_void, Error> { + let cname = CString::new(name).unwrap(); + let ptr = dlsym(handle, cname.as_ptr() as *const c_char); + if ptr.is_null() { + Err(format_err!("{:?}", CStr::from_ptr(dlerror()))) + } else { + Ok(ptr) + } + } +} + +#[cfg(windows)] +mod platform { + use failure::*; + use std::ffi::CString; + use std::os::raw::{c_char, c_void}; + use std::path::Path; + + #[link(name = "kernel32")] + extern "system" { + fn LoadLibraryA(filename: *const c_char) -> *const c_void; + fn GetProcAddress(handle: *const c_void, symbol: *const c_char) -> *const c_void; + fn GetLastError() -> u32; + } + + pub unsafe fn load_library(path: &Path, _global_symbols: bool) -> Result<*const c_void, Error> { + let cpath = CString::new(path.as_os_str().to_str().unwrap().as_bytes()).unwrap(); + let handle = LoadLibraryA(cpath.as_ptr() as *const c_char); + if handle.is_null() { + Err(format_err!("Could not load {:?} (err={:08X})", path, GetLastError())) + } else { + Ok(handle) + } + } + + pub unsafe fn find_symbol(handle: *const c_void, name: &str) -> Result<*const c_void, Error> { + let cname = CString::new(name).unwrap(); + let ptr = GetProcAddress(handle, cname.as_ptr() as *const c_char); + if ptr.is_null() { + Err(format_err!("Could not find {} (err={:08X})", name, GetLastError())) + } else { + Ok(ptr) + } + } +} diff --git a/adapter2/deps/python/Cargo.toml b/adapter2/deps/python/Cargo.toml new file mode 100644 index 00000000..df7f3b84 --- /dev/null +++ b/adapter2/deps/python/Cargo.toml @@ -0,0 +1,21 @@ +[package] +name = "codelldb_python" +version = "0.1.0" +authors = ["Vadim Chugunov "] +edition = "2018" + +[dependencies] +env_logger = "0.6.2" +failure = "0.1.5" +lldb = { path = "../lldb" } +log = "0.4.7" +cpython = { version = "0.3.0", default-features = false, optional = true } + +[features] +python2 = ["cpython/python27-sys"] +python3 = ["cpython/python3-sys"] + +[[example]] +name = "codelldb_python" +path = "src/impl.rs" +crate-type = ["cdylib"] diff --git a/adapter2/src/python.rs b/adapter2/deps/python/src/impl.rs similarity index 58% rename from adapter2/src/python.rs rename to adapter2/deps/python/src/impl.rs index cb9a173b..66a5bcd7 100644 --- a/adapter2/src/python.rs +++ b/adapter2/deps/python/src/impl.rs @@ -1,29 +1,14 @@ -use log::{self, debug, error, info}; +use codelldb_python::*; +use cpython::{self, *}; +use failure::format_err; +use lldb::*; +use log::{self, debug, error}; use std::cell; -use std::collections::hash_map::Entry; -use std::collections::HashMap; use std::env; -use std::fmt::Write; -use std::os::raw::{c_char, c_int, c_void}; -use std::slice; use std::str; -use cpython::*; -use lldb::*; - -use crate::debug_protocol::{DisplayHtmlEventBody, EventBody}; -use crate::error::Error; - -#[derive(Debug)] -pub enum PythonValue { - SBValue(SBValue), - Int(i64), - Bool(bool), - String(String), - Object(String), -} - -pub struct PythonInterface { +#[allow(unused)] +struct PythonInterfaceImpl { interpreter: SBCommandInterpreter, pymod_lldb: PyModule, pymod_codelldb: PyModule, @@ -35,84 +20,93 @@ pub struct PythonInterface { pyfn_modules_loaded: PyObject, } -impl PythonInterface { - pub fn new( - interpreter: SBCommandInterpreter, - send_event: Box, - ) -> Result, Error> { - let current_exe = env::current_exe()?; - let mut command_result = SBCommandReturnObject::new(); - - // Import debugger.py into script interpreter's namespace. - // This also adds our bin directory to sys.path, so we can import the rest of the modules below. - let init_script = current_exe.with_file_name("debugger.py"); - let command = format!("command script import '{}'", init_script.to_str()?); - interpreter.handle_command(&command, &mut command_result, false); - info!("{:?}", command_result); - - // Init python logging - let py_log_level = match log::max_level() { - log::LevelFilter::Error => 40, - log::LevelFilter::Warn => 30, - log::LevelFilter::Info => 20, - log::LevelFilter::Debug => 10, - log::LevelFilter::Trace | log::LevelFilter::Off => 0, - }; - let gil = Python::acquire_gil(); - let py = gil.python(); - let pymod_codelldb = py.import("codelldb")?; - pymod_codelldb.call(py, "set_log_level", (py_log_level,), None)?; - drop(gil); - - let rust_formatters = current_exe.with_file_name("rust.py"); - let command = format!("command script import '{}'", rust_formatters.to_str()?); - interpreter.handle_command(&command, &mut command_result, false); - info!("{:?}", command_result); - - // Cache some objects - let gil = Python::acquire_gil(); - let py = gil.python(); - - let pymod_lldb = py.import("lldb")?; - let pyty_sbvalue = PyType::downcast_from(py, pymod_lldb.get(py, "SBValue")?).unwrap(); - let pyty_sbmodule = PyType::downcast_from(py, pymod_lldb.get(py, "SBModule")?).unwrap(); - let pyty_sbexec_context = PyType::downcast_from(py, pymod_lldb.get(py, "SBExecutionContext")?).unwrap(); - - let pyfn_evaluate_in_frame = pymod_codelldb.get(py, "evaluate_in_frame")?; - let pyfn_modules_loaded = pymod_codelldb.get(py, "modules_loaded")?; - - let pymod_traceback = py.import("traceback")?; +#[no_mangle] +pub fn entry() -> Result<(), Error> { + env_logger::Builder::from_default_env().init(); + Ok(()) +} - let callback = RustClosure::new(py, move |py: Python, args, kwargs| { - py_argparse!(py, None, args, kwargs, ( - html: String, - title: Option = None, - position: Option = None, - reveal: bool = false - ) { - send_event(EventBody::displayHtml(DisplayHtmlEventBody { - html, title, position, reveal - })); - Ok(py.None()) - }) - }); - pymod_codelldb.as_object().setattr(py, "display_html", callback?); +#[no_mangle] +pub fn new_session( + interpreter: SBCommandInterpreter, + event_sink: Box, +) -> Result, Error> { + let current_exe = env::current_exe()?; + let mut command_result = SBCommandReturnObject::new(); + + // Import debugger.py into script interpreter's namespace. + // This also adds our bin directory to sys.path, so we can import the rest of the modules below. + let init_script = current_exe.with_file_name("debugger.py"); + let command = format!("command script import '{}'", init_script.to_str()?); + interpreter.handle_command(&command, &mut command_result, false); + if !command_result.succeeded() { + return Err(Error(format_err!("{:?}", command_result))); + } - let mut py_interface = Box::new(PythonInterface { - interpreter, - pymod_lldb, - pymod_codelldb, - pymod_traceback, - pyty_sbexec_context, - pyty_sbmodule, - pyty_sbvalue, - pyfn_evaluate_in_frame, - pyfn_modules_loaded, - }); - Ok(py_interface) + // Init python logging + let py_log_level = match log::max_level() { + log::LevelFilter::Error => 40, + log::LevelFilter::Warn => 30, + log::LevelFilter::Info => 20, + log::LevelFilter::Debug => 10, + log::LevelFilter::Trace | log::LevelFilter::Off => 0, + }; + let gil = Python::acquire_gil(); + let py = gil.python(); + let pymod_codelldb = py.import("codelldb")?; + pymod_codelldb.call(py, "set_log_level", (py_log_level,), None)?; + drop(gil); + + let rust_formatters = current_exe.with_file_name("rust.py"); + let command = format!("command script import '{}'", rust_formatters.to_str()?); + interpreter.handle_command(&command, &mut command_result, false); + if !command_result.succeeded() { + error!("{:?}", command_result); // But carry on - Rust formatters are not critical to have. } - pub fn evaluate(&self, expr: &str, is_simple_expr: bool, context: &SBExecutionContext) -> Result { + // Cache some objects + let gil = Python::acquire_gil(); + let py = gil.python(); + + let pymod_lldb = py.import("lldb")?; + let pyty_sbvalue = PyType::downcast_from(py, pymod_lldb.get(py, "SBValue")?).unwrap(); + let pyty_sbmodule = PyType::downcast_from(py, pymod_lldb.get(py, "SBModule")?).unwrap(); + let pyty_sbexec_context = PyType::downcast_from(py, pymod_lldb.get(py, "SBExecutionContext")?).unwrap(); + + let pyfn_evaluate_in_frame = pymod_codelldb.get(py, "evaluate_in_frame")?; + let pyfn_modules_loaded = pymod_codelldb.get(py, "modules_loaded")?; + + let pymod_traceback = py.import("traceback")?; + + let callback = RustClosure::new(py, move |py: Python, args, kwargs| { + py_argparse!(py, None, args, kwargs, ( + html: String, + title: Option = None, + position: Option = None, + reveal: bool = false + ) { + event_sink.display_html(html, title, position, reveal); + Ok(py.None()) + }) + }); + pymod_codelldb.as_object().setattr(py, "display_html", callback?)?; + + let py_interface = Box::new(PythonInterfaceImpl { + interpreter, + pymod_lldb, + pymod_codelldb, + pymod_traceback, + pyty_sbexec_context, + pyty_sbmodule, + pyty_sbvalue, + pyfn_evaluate_in_frame, + pyfn_modules_loaded, + }); + Ok(py_interface) +} + +impl PythonInterface for PythonInterfaceImpl { + fn evaluate(&self, expr: &str, is_simple_expr: bool, context: &SBExecutionContext) -> Result { let gil = Python::acquire_gil(); let py = gil.python(); let pysb_exec_context = @@ -123,12 +117,7 @@ impl PythonInterface { result } - pub fn evaluate_as_bool( - &self, - expr: &str, - is_simple_expr: bool, - context: &SBExecutionContext, - ) -> Result { + fn evaluate_as_bool(&self, expr: &str, is_simple_expr: bool, context: &SBExecutionContext) -> Result { let gil = Python::acquire_gil(); let py = gil.python(); let pysb_exec_context = @@ -142,7 +131,7 @@ impl PythonInterface { result } - pub fn modules_loaded(&self, modules: &mut dyn Iterator) { + fn modules_loaded(&self, modules: &mut dyn Iterator) { let gil = Python::acquire_gil(); let py = gil.python(); @@ -155,7 +144,9 @@ impl PythonInterface { error!("modules_loaded: {}", self.format_exception(py, err)); } } +} +impl PythonInterfaceImpl { fn to_sbvalue(&self, py: Python, target: &SBTarget, result: PyResult) -> Result { match result { Ok(value) => { @@ -215,7 +206,7 @@ where SBT: Clone, { let this = pyobj.getattr(py, "this").unwrap().extract::(py).unwrap(); - let mut sb = this as *const SBT; + let sb = this as *const SBT; (*sb).clone() } @@ -242,14 +233,14 @@ fn sbvalue_from_str(value: &str, target: &SBTarget) -> SBValue { // Python wrapper for Rust closures py_class!(class RustClosure |py| { - data closure: cell::RefCell) -> PyResult + Send>>; + data closure: cell::RefCell) -> PyResult + Send>>; - def __call__(&self, *args, **kwargs) -> PyResult { - use std::ops::DerefMut; - let mut mut_ref = self.closure(py).borrow_mut(); - mut_ref.deref_mut()(py, &args, kwargs) - } -}); + def __call__(&self, *args, **kwargs) -> PyResult { + use std::ops::DerefMut; + let mut mut_ref = self.closure(py).borrow_mut(); + mut_ref.deref_mut()(py, &args, kwargs) + } + }); impl RustClosure { fn new(py: Python, closure: F) -> PyResult @@ -260,9 +251,3 @@ impl RustClosure { RustClosure::create_instance(py, closure) } } - -impl From for Error { - fn from(err: PyErr) -> Self { - Error::Internal(format!("{:?}", err)) - } -} diff --git a/adapter2/deps/python/src/lib.rs b/adapter2/deps/python/src/lib.rs new file mode 100644 index 00000000..08f2456e --- /dev/null +++ b/adapter2/deps/python/src/lib.rs @@ -0,0 +1,59 @@ +#![feature(try_trait)] + +use failure::Fail; +use lldb::*; + +#[derive(Debug)] +pub enum PythonValue { + SBValue(SBValue), + Int(i64), + Bool(bool), + String(String), + Object(String), +} + +#[repr(transparent)] +#[derive(Fail, Debug)] +#[fail(display = "Python error: {:?}", _0)] +pub struct Error(pub failure::Error); + +pub trait EventSink { + fn display_html(&self, html: String, title: Option, position: Option, reveal: bool); +} + +pub trait PythonInterface { + fn evaluate(&self, expr: &str, is_simple_expr: bool, context: &SBExecutionContext) -> Result; + fn evaluate_as_bool(&self, expr: &str, is_simple_expr: bool, context: &SBExecutionContext) -> Result; + fn modules_loaded(&self, modules: &mut dyn Iterator); +} + +pub type Entry = fn() -> Result<(), Error>; + +pub type NewSession = fn( + interpreter: SBCommandInterpreter, + event_sink: Box, +) -> Result, Error>; + +#[cfg(any(feature = "python2", feature = "python3"))] +mod _impl { + use super::*; + use failure::format_err; + + impl From for Error { + fn from(e: std::io::Error) -> Self { + Error(e.into()) + } + } + + impl From for Error { + fn from(_: std::option::NoneError) -> Self { + Error(format_err!("Expected Option::Some, found None")) + } + } + + impl From for Error { + fn from(err: cpython::PyErr) -> Self { + Error(format_err!("{:?}", err)) + } + } +} diff --git a/adapter2/src/bin/codelldb.rs b/adapter2/src/bin/codelldb.rs index 6c90d9bc..f5bf558d 100644 --- a/adapter2/src/bin/codelldb.rs +++ b/adapter2/src/bin/codelldb.rs @@ -7,6 +7,7 @@ fn main() -> Result<(), failure::Error> { .arg(Arg::with_name("port").long("port").takes_value(true)) .arg(Arg::with_name("multi-session").long("multi-session")) .arg(Arg::with_name("preload").long("preload").multiple(true).takes_value(true)) + .arg(Arg::with_name("liblldb").long("liblldb").takes_value(true)) .arg(Arg::with_name("params").long("params").takes_value(true)) .subcommand(SubCommand::with_name("terminal-agent").arg(Arg::with_name("port").long("port").takes_value(true))) .get_matches(); @@ -54,105 +55,55 @@ fn terminal_agent(matches: &ArgMatches) -> Result<(), failure::Error> { } fn debug_server(matches: &ArgMatches) -> Result<(), failure::Error> { - use self::loading::*; - use std::env; - use std::mem; - use std::path::Path; + use loading::*; + use std::mem::transmute; + use std::path::{Path, PathBuf}; let multi_session = matches.is_present("multi-session"); let port = matches.value_of("port").map(|s| s.parse().unwrap()).unwrap_or(0); let adapter_params = matches.value_of("params"); unsafe { + // Preload anything passed via --preload for dylib in matches.values_of("preload").unwrap_or_default() { - load_library(Path::new(dylib), true); + load_library(Path::new(dylib), true)?; } - // Load codelldb shared lib - let mut codelldb_path = env::current_exe()?; - codelldb_path.pop(); - if cfg!(windows) { - codelldb_path.push("codelldb.dll"); - } else if cfg!(target_os = "macos") { - codelldb_path.push("libcodelldb.dylib"); - } else { - codelldb_path.push("libcodelldb.so"); - } - let codelldb = load_library(&codelldb_path, false); - - // Find codelldb's entry point and call it. - let entry: unsafe extern "C" fn(u16, bool, Option<&str>) = mem::transmute(find_symbol(codelldb, "entry")); - entry(port, multi_session, adapter_params); - } - Ok(()) -} - -#[cfg(unix)] -mod loading { - use std::ffi::{CStr, CString}; - use std::os::raw::{c_char, c_int, c_void}; - use std::path::Path; - - #[link(name = "dl")] - extern "C" { - fn dlopen(filename: *const c_char, flag: c_int) -> *const c_void; - fn dlsym(handle: *const c_void, symbol: *const c_char) -> *const c_void; - fn dlerror() -> *const c_char; - } - const RTLD_LAZY: c_int = 0x00001; - const RTLD_GLOBAL: c_int = 0x00100; - - pub unsafe fn load_library(path: &Path, global_symbols: bool) -> *const c_void { - let cpath = CString::new(path.as_os_str().to_str().unwrap().as_bytes()).unwrap(); - let flags = match global_symbols { - true => RTLD_LAZY | RTLD_GLOBAL, - false => RTLD_LAZY, - }; - let handle = dlopen(cpath.as_ptr() as *const c_char, flags); - if handle.is_null() { - panic!("{:?}", CStr::from_ptr(dlerror())); + // Try loading Python dylib. + // This must be done before loading liblldb, because the latter is weak-linked to libpython. + let libpython = if cfg!(unix) { "python2.7" } else { "python36" }; + let libpython = get_dylib_filename(libpython); + match load_library(&Path::new(&libpython), true) { + Ok(_) => (), + Err(err) => eprintln!("{:?}", err), } - handle - } - pub unsafe fn find_symbol(handle: *const c_void, name: &str) -> *const c_void { - let cname = CString::new(name).unwrap(); - let ptr = dlsym(handle, cname.as_ptr() as *const c_char); - if ptr.is_null() { - panic!("{:?}", CStr::from_ptr(dlerror())); - } - ptr - } -} + let mut codelldb_dir = std::env::current_exe()?; + codelldb_dir.pop(); + + // Load liblldb + let liblldb_path = match matches.value_of("liblldb") { + Some(path) => PathBuf::from(path), + None => { + let mut liblldb_path = codelldb_dir.clone(); + liblldb_path.pop(); + liblldb_path.push("lldb"); + liblldb_path.push(if cfg!(unix) { "lib" } else { "bin" }); + liblldb_path.push(get_dylib_filename("lldb")); + liblldb_path + } + }; + load_library(&liblldb_path, true)?; -#[cfg(windows)] -mod loading { - use std::ffi::CString; - use std::os::raw::{c_char, c_void}; - use std::path::Path; - - #[link(name = "kernel32")] - extern "system" { - fn LoadLibraryA(filename: *const c_char) -> *const c_void; - fn GetProcAddress(handle: *const c_void, symbol: *const c_char) -> *const c_void; - fn GetLastError() -> u32; - } + // Load codelldb shared lib + let mut codelldb_path = codelldb_dir.clone(); + codelldb_path.push(get_dylib_filename("codelldb")); + let codelldb = load_library(&codelldb_path, false)?; - pub unsafe fn load_library(path: &Path, _global_symbols: bool) -> *const c_void { - let cpath = CString::new(path.as_os_str().to_str().unwrap().as_bytes()).unwrap(); - let handle = LoadLibraryA(cpath.as_ptr() as *const c_char); - if handle.is_null() { - panic!("Could not load {:?} (err={:08X})", path, GetLastError()); - } - handle + // Find codelldb's entry point and call it. + let entry: unsafe extern "C" fn(u16, bool, Option<&str>) = transmute(find_symbol(codelldb, "entry")?); + entry(port, multi_session, adapter_params); } - pub unsafe fn find_symbol(handle: *const c_void, name: &str) -> *const c_void { - let cname = CString::new(name).unwrap(); - let ptr = GetProcAddress(handle, cname.as_ptr() as *const c_char); - if ptr.is_null() { - panic!("Could not find {} (err={:08X})", name, GetLastError()); - } - ptr - } + Ok(()) } diff --git a/adapter2/src/debug_session.rs b/adapter2/src/debug_session.rs index b4400893..5284a211 100644 --- a/adapter2/src/debug_session.rs +++ b/adapter2/src/debug_session.rs @@ -27,8 +27,10 @@ use crate::expressions::{self, FormatSpec, HitCondition, PreparedExpression}; use crate::fsutil::{is_same_path, normalize_path}; use crate::handles::{self, Handle, HandleTree}; use crate::must_initialize::{Initialized, MustInitialize, NotInitialized}; -use crate::python::{self, PythonInterface, PythonValue}; use crate::terminal::Terminal; + +use python::{PythonInterface, PythonValue}; + use lldb::*; #[derive(Serialize, Deserialize, Default, Debug, Clone)] @@ -87,12 +89,12 @@ pub struct DebugSession { shutdown: CancellationSource, event_listener: SBListener, self_ref: MustInitialize>>, - debugger: MustInitialize, + debugger: SBDebugger, target: MustInitialize, process: MustInitialize, process_was_launched: bool, on_configuration_done: Option<(u32, Box)>, - python: MustInitialize>, + python: Option>, breakpoints: RefCell, var_refs: HandleTree, disassembly: MustInitialize, @@ -121,6 +123,7 @@ unsafe impl Send for DebugSession {} impl DebugSession { pub fn new( settings: AdapterSettings, + python_new_session: Option, ) -> impl Stream + Sink { let (incoming_send, incoming_recv) = std::sync::mpsc::sync_channel::(100); let (outgoing_send, outgoing_recv) = futures::sync::mpsc::channel::(100); @@ -149,19 +152,53 @@ impl DebugSession { }); } + let send_message = RefCell::new(outgoing_send); + + let debugger = SBDebugger::create(false); + debugger.set_async_mode(true); + + let python = match python_new_session { + Some(python_new_session) => { + struct PythonEventSink(RefCell>); + impl python::EventSink for PythonEventSink { + fn display_html(&self, html: String, title: Option, position: Option, reveal: bool) { + let event = ProtocolMessage::Event(Event { + seq: 0, + body: EventBody::displayHtml(DisplayHtmlEventBody { + html, + title, + position, + reveal, + }), + }); + self.0.borrow_mut().try_send(event); + } + } + let event_sink = Box::new(PythonEventSink(send_message.clone())); + match python_new_session(debugger.command_interpreter(), event_sink) { + Ok(python) => Some(python), + Err(err) => { + error!("Initialize Python interpreter: {}", err); + None + } + } + } + None => None, + }; + let mut debug_session = DebugSession { - send_message: RefCell::new(outgoing_send), + send_message: send_message, incoming_send: incoming_send.clone(), message_seq: Cell::new(1), shutdown: shutdown, self_ref: NotInitialized, - debugger: NotInitialized, + debugger: debugger, target: NotInitialized, process: NotInitialized, process_was_launched: false, event_listener: event_listener, on_configuration_done: None, - python: NotInitialized, + python: python, breakpoints: RefCell::new(BreakpointsState { source: HashMap::new(), assembly: HashMap::new(), @@ -387,24 +424,8 @@ impl DebugSession { } fn handle_initialize(&mut self, _args: InitializeRequestArguments) -> Result { - self.debugger = Initialized(SBDebugger::create(false)); - self.debugger.set_async_mode(true); - self.event_listener.start_listening_for_event_class(&self.debugger, SBThread::broadcaster_class_name(), !0); - let send_message = self.send_message.clone(); - let python = PythonInterface::new( - self.debugger.command_interpreter(), - Box::new(move |event_body| { - let event = ProtocolMessage::Event(Event { - seq: 0, - body: event_body, - }); - send_message.borrow_mut().try_send(event); - }), - )?; - self.python = Initialized(python); - let caps = Capabilities { supports_configuration_done_request: Some(true), supports_evaluate_for_hovers: Some(true), @@ -835,13 +856,19 @@ impl DebugSession { let frame = thread.frame_at_index(0); let context = self.context_from_frame(Some(&frame)); // TODO: pass bpno - let should_stop = match self.python.evaluate_as_bool(&pycode, is_simple_expr, &context) { - Ok(val) => val, - Err(err) => { - self.console_error(err.to_string()); - return true; // Stop on evluation errors, even if there's a log message. + let should_stop = match &self.python { + Some(python) => match python.evaluate_as_bool(&pycode, is_simple_expr, &context) { + Ok(val) => val, + Err(err) => { + self.console_error(err.to_string()); + return true; // Stop on evluation errors, even if there's a log message. + } + }, + None => { + return true; } }; + if !should_stop { return false; } @@ -939,28 +966,7 @@ impl DebugSession { } fn handle_launch(&mut self, args: LaunchRequestArguments) -> Result, Error> { - if let Some(expressions) = args.common.expressions { - self.default_expr_type = expressions; - } - if let Some(source_map) = &args.common.source_map { - self.init_source_map(source_map.iter().map(|(k, v)| (k, v.as_ref()))); - } - if let Some(true) = &args.common.reverse_debugging { - self.send_event(EventBody::capabilities(CapabilitiesEventBody { - capabilities: Capabilities { - supports_step_back: Some(true), - ..Default::default() - }, - })); - } - self.relative_path_base = Initialized(match &args.common.relative_path_base { - Some(base) => base.into(), - None => env::current_dir()?, - }); - - if let Some(commands) = &args.common.init_commands { - self.exec_commands("initCommands", &commands)?; - } + self.common_init_session(&args.common)?; if let Some(true) = &args.custom { self.handle_custom_launch(args) @@ -992,9 +998,6 @@ impl DebugSession { let launch_env = launch_env.iter().map(|(k, v)| format!("{}={}", k, v)).collect::>(); launch_info.set_environment_entries(launch_env.iter().map(|s| s.as_ref()), false); - if let Some(ref settings) = args.common.adapter_settings { - self.update_adapter_settings(settings); - } if let Some(ref args) = args.args { launch_info.set_arguments(args.iter().map(|a| a.as_ref()), false); } @@ -1102,26 +1105,12 @@ impl DebugSession { } fn handle_attach(&mut self, args: AttachRequestArguments) -> Result, Error> { - if let Some(expressions) = args.common.expressions { - self.default_expr_type = expressions; - } - if let Some(source_map) = &args.common.source_map { - self.init_source_map(source_map.iter().map(|(k, v)| (k, v.as_ref()))); - } - if let Some(true) = &args.common.reverse_debugging { - self.send_event(EventBody::capabilities(CapabilitiesEventBody { - capabilities: Capabilities { - supports_step_back: Some(true), - ..Default::default() - }, - })); - } + self.common_init_session(&args.common)?; + if args.program.is_none() && args.pid.is_none() { return Err(Error::UserError(r#"Either "program" or "pid" is required for attach."#.into())); } - if let Some(commands) = &args.common.init_commands { - self.exec_commands("initCommands", &commands)?; - } + self.target = Initialized(self.debugger.create_target("", None, None, false)?); self.disassembly = Initialized(disassembly::AddressSpace::new(&self.target)); self.send_event(EventBody::initialized); @@ -1286,6 +1275,50 @@ impl DebugSession { self.send_request(RequestArguments::runInTerminal(req_args)); } + // Handle initialization tasks common to both launching and attaching + fn common_init_session(&mut self, args_common: &CommonLaunchFields) -> Result<(), Error> { + if let Some(expressions) = args_common.expressions { + self.default_expr_type = expressions; + } + if let None = self.python { + match self.default_expr_type { + Expressions::Simple | Expressions::Python => self.console_error( + "Could not initialize Python interpreter - only native expressions will be available.", + ), + Expressions::Native => (), + } + self.default_expr_type = Expressions::Native; + } + + if let Some(source_map) = &args_common.source_map { + self.init_source_map(source_map.iter().map(|(k, v)| (k, v.as_ref()))); + } + + if let Some(true) = &args_common.reverse_debugging { + self.send_event(EventBody::capabilities(CapabilitiesEventBody { + capabilities: Capabilities { + supports_step_back: Some(true), + ..Default::default() + }, + })); + } + + self.relative_path_base = Initialized(match &args_common.relative_path_base { + Some(base) => base.into(), + None => env::current_dir()?, + }); + + if let Some(ref settings) = args_common.adapter_settings { + self.update_adapter_settings(settings); + } + + if let Some(commands) = &args_common.init_commands { + self.exec_commands("initCommands", &commands)?; + } + + Ok(()) + } + fn exec_commands(&self, script_name: &str, commands: &[String]) -> Result<(), Error> { self.console_message(format!("Executing script: {}", script_name)); let interpreter = self.debugger.command_interpreter(); @@ -1860,8 +1893,8 @@ impl DebugSession { expression: &PreparedExpression, frame: Option<&SBFrame>, ) -> Result { - match expression { - PreparedExpression::Native(pp_expr) => { + match (expression, self.python.as_ref()) { + (PreparedExpression::Native(pp_expr), _) => { let result = match frame { Some(frame) => frame.evaluate_expression(&pp_expr), None => self.target.evaluate_expression(&pp_expr), @@ -1873,20 +1906,21 @@ impl DebugSession { Err(error.into()) } } - PreparedExpression::Python(pp_expr) => { + (PreparedExpression::Python(pp_expr), Some(python)) => { let context = self.context_from_frame(frame); - match self.python.evaluate(&pp_expr, false, &context) { + match python.evaluate(&pp_expr, false, &context) { Ok(val) => Ok(val), Err(s) => Err(Error::UserError(s)), } } - PreparedExpression::Simple(pp_expr) => { + (PreparedExpression::Simple(pp_expr), Some(python)) => { let context = self.context_from_frame(frame); - match self.python.evaluate(&pp_expr, true, &context) { + match python.evaluate(&pp_expr, true, &context) { Ok(val) => Ok(val), Err(s) => Err(Error::UserError(s)), } } + _ => Err(Error::UserError("Python expressions are disabled.".into())), } } @@ -2380,7 +2414,9 @@ impl DebugSession { preserve_focus_hint: None, })); - self.python.modules_loaded(&mut self.loaded_modules.iter()); + if let Some(python) = &self.python { + python.modules_loaded(&mut self.loaded_modules.iter()); + } self.loaded_modules.clear(); } @@ -2421,7 +2457,8 @@ impl DebugSession { let header_addr = module.object_header_address(); if header_addr.is_valid() { format!("{:X}", header_addr.load_address(&self.target)) - } else { // header_addr not available on Windows, fall back to path + } else { + // header_addr not available on Windows, fall back to path module.filespec().path().display().to_string() } } diff --git a/adapter2/src/error.rs b/adapter2/src/error.rs index b4e3f4f5..f7fe5ca0 100644 --- a/adapter2/src/error.rs +++ b/adapter2/src/error.rs @@ -43,3 +43,13 @@ impl From for Error { Error::Internal(err.to_string()) } } +impl From for Error { + fn from(err: failure::Error) -> Self { + Error::Internal(err.to_string()) + } +} +impl From for Error { + fn from(err: python::Error) -> Self { + Error::Internal(err.to_string()) + } +} diff --git a/adapter2/src/lib.rs b/adapter2/src/lib.rs index 81d5458c..25d26871 100644 --- a/adapter2/src/lib.rs +++ b/adapter2/src/lib.rs @@ -2,16 +2,18 @@ #![feature(fn_traits)] #![allow(unused)] -use std::net; +extern crate codelldb_python as python; use futures::prelude::*; use tokio::prelude::*; use log::{debug, error, info}; +use std::net; use tokio::codec::Decoder; use tokio::io; use tokio::net::TcpListener; +use crate::error::Error; use lldb::*; mod cancellation; @@ -23,7 +25,6 @@ mod expressions; mod fsutil; mod handles; mod must_initialize; -mod python; mod stdio_channel; mod terminal; mod vec_map; @@ -33,8 +34,17 @@ mod wire_protocol; pub extern "C" fn entry(port: u16, multi_session: bool, adapter_params: Option<&str>) { hook_crashes(); env_logger::Builder::from_default_env().init(); + SBDebugger::initialize(); + let python_new_session = match load_python() { + Ok(entry) => Some(entry), + Err(err) => { + error!("load_python: {:?}", err); + None + } + }; + let adapter_settings: debug_protocol::AdapterSettings = match adapter_params { Some(s) => serde_json::from_str(s).unwrap(), None => Default::default(), @@ -60,7 +70,7 @@ pub extern "C" fn entry(port: u16, multi_session: bool, adapter_params: Option<& let server = server .for_each(move |conn| { conn.set_nodelay(true).unwrap(); - run_debug_session(conn, adapter_settings.clone()) + run_debug_session(conn, adapter_settings.clone(), python_new_session) }) .then(|r| { info!("### server resolved: {:?}", r); @@ -73,14 +83,36 @@ pub extern "C" fn entry(port: u16, multi_session: bool, adapter_params: Option<& SBDebugger::terminate(); } +fn load_python() -> Result { + use std::env; + use std::mem; + + let mut dylib_path = env::current_exe()?; + dylib_path.pop(); + dylib_path.push(loading::get_dylib_filename("codelldb_python")); + unsafe { + let codelldb_python = loading::load_library(&dylib_path, true)?; + + let python_entry: python::Entry = mem::transmute(loading::find_symbol(codelldb_python, "entry")?); + python_entry()?; + + let python_new_session: python::NewSession = + mem::transmute(loading::find_symbol(codelldb_python, "new_session")?); + + Ok(python_new_session) + } +} + fn run_debug_session( - stream: impl AsyncRead + AsyncWrite + Send + 'static, adapter_settings: debug_protocol::AdapterSettings, + stream: impl AsyncRead + AsyncWrite + Send + 'static, + adapter_settings: debug_protocol::AdapterSettings, + python_new_session: Option, ) -> impl Future { - future::lazy(|| { + future::lazy(move || { debug!("New debug session"); let (to_client, from_client) = wire_protocol::Codec::new().framed(stream).split(); - let (to_session, from_session) = debug_session::DebugSession::new(adapter_settings).split(); + let (to_session, from_session) = debug_session::DebugSession::new(adapter_settings, python_new_session).split(); let client_to_session = from_client .map_err(|_| ()) //. diff --git a/azure-pipelines.yml b/azure-pipelines.yml index c97b74ae..06d6f3ab 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1,5 +1,5 @@ variables: - lldbBuildId: 780 + lldbBuildId: 829 lldbBuildProject: 'llvm' lldbBuildPipeline: 'llvm-project' runTests: true diff --git a/codelldb.code-workspace b/codelldb.code-workspace index d9d7a376..3acb93e6 100644 --- a/codelldb.code-workspace +++ b/codelldb.code-workspace @@ -2,7 +2,7 @@ "folders": [ { "path": "." - } + }, ], "settings": { "window.title": "${rootName}", diff --git a/extension/novsc/adapter.ts b/extension/novsc/adapter.ts index 3611bfff..c963e513 100644 --- a/extension/novsc/adapter.ts +++ b/extension/novsc/adapter.ts @@ -37,7 +37,7 @@ export async function startNative( let env = mergeEnv(extraEnv); let executable = path.join(extensionRoot, 'adapter2/codelldb'); - let args = ['--preload', liblldb]; + let args = ['--liblldb', liblldb]; if (process.platform == 'win32') { // Add liblldb's directory to PATH so it can find msdia dll later. env['PATH'] = env['PATH'] + ';' + path.dirname(liblldb);