Skip to content

Commit

Permalink
Retire classic adapter.
Browse files Browse the repository at this point in the history
  • Loading branch information
vadimcn committed Feb 24, 2020
1 parent 7afa849 commit 7a14a32
Show file tree
Hide file tree
Showing 24 changed files with 99 additions and 3,123 deletions.
18 changes: 8 additions & 10 deletions BUILDING.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Prerequisites:
- Node.js and npm, v8 or later.
- Python 2.7 on Linux and OSX, Python 3.6 on Windows.
- Python 3.5 or later.
- C++ compiler (GCC, clang or MSVC).
- Rust nightly. Be sure to add an override for CodeLLDB directory so it uses the nightly.
- Rust nightly 2019-10-15 or later. Be sure to add an override for CodeLLDB directory so it uses the nightly.
- (Windows only) mingw-w64 toolchain (used for tests).

# Install LLDB or build it from source.
Expand All @@ -22,12 +22,12 @@ CodeLLDB build scripts expect to find the following files under ${LLDB_ROOT}:
bin/
lldb[.exe]
lldb-server[.exe]
liblldb.dll (Winodws)
liblldb.dll (Windows)
lib/
liblldb.so.<version> (Linux)
liblldb.so.<version> (Linux)
liblldb<version>.dylib (OSX)
python2.7/ (Linux and OSX)
site-packages/ (Windows)
python3/ (Linux and OSX)
site-packages/ (Windows)
<python files>
```

Expand All @@ -45,13 +45,11 @@ cmake .. -DLLDB_ROOT=<path to LLDB directory>
- `extension` - build VSCode extension.
- `tests` - build extension tests.
- `debuggee` - build the debuggee project (used for debbugging and tests).
- `adapter` - build classic adapter.
- `codelldb` - build native adapter.
- `codelldb` - build the debug adapter.
- `cargo_test` - run `cargo test` on all codelldb crates.
- `dev_debugging` - build extension, adapters, debuggee and other stuff needed for debugging extension directly out of the build directory.
After building this target you can run `code --extensionDevelopmentPath=${workspaceFolder}/build` to try out the extension.
- `check_` { `classic` | `native` } - build and test the specified adapter type.
- `check` - build adapter and run tests for all adapter types.
- `check` - build adapter and run all tests.
- `vsix_portable` - build VSIX package containing only the "classic" adapter.
- `vsix_full` - build VSIX package including all required native binaries (for the current platform).
- `xclean` - extra-thorough cleaning. Useful in cases of build problems caused by stale dependencies.
62 changes: 16 additions & 46 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -118,28 +118,10 @@ add_copy_file(PackageFiles ${CMAKE_CURRENT_SOURCE_DIR}/images/checked.svg ${CMAK
add_copy_file(PackageFiles ${CMAKE_CURRENT_SOURCE_DIR}/images/unchecked.svg ${CMAKE_CURRENT_BINARY_DIR}/images/unchecked.svg)
add_copy_file(PackageFiles ${CMAKE_CURRENT_SOURCE_DIR}/syntaxes/disassembly.json ${CMAKE_CURRENT_BINARY_DIR}/syntaxes/disassembly.json)

# Classic adapter

file(GLOB_RECURSE Files
LIST_DIRECTORIES false
${CMAKE_SOURCE_DIR}/adapter/*.py
)
add_copy_files_to(AdapterFiles ${CMAKE_BINARY_DIR}/adapter ${Files})

file(GLOB_RECURSE Files
LIST_DIRECTORIES false
${CMAKE_SOURCE_DIR}/formatters/*.py
)
add_copy_files_to(AdapterFiles ${CMAKE_BINARY_DIR}/formatters ${Files})

add_custom_target(adapter ALL
DEPENDS lldb ${AdapterFiles}
)

# For extension debugging

add_custom_target(dev_debugging
DEPENDS adapter codelldb debuggee extension ${PackageFiles}
DEPENDS codelldb debuggee extension ${PackageFiles}
)

# VSIX packages
Expand All @@ -148,7 +130,6 @@ set(PackagedFilesPortable
README.md
CHANGELOG.md
extension.js
adapter/**/*.py
formatters/*
images/*
syntaxes/*
Expand Down Expand Up @@ -187,15 +168,15 @@ set(VsceOptions
)

add_custom_target(vsix_portable
DEPENDS adapter extension ${PackageFiles}
DEPENDS extension ${PackageFiles}
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/vscodeignore-portable ${CMAKE_CURRENT_BINARY_DIR}/.vscodeignore
COMMAND ${NPM} run vsce -- package ${VsceOptions} -o ${CMAKE_CURRENT_BINARY_DIR}/vscode-lldb-portable.vsix
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
USES_TERMINAL
)

add_custom_target(vsix_full
DEPENDS adapter extension lldb codelldb ${PackageFiles}
DEPENDS extension lldb codelldb ${PackageFiles}
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/vscodeignore-full ${CMAKE_CURRENT_BINARY_DIR}/.vscodeignore
COMMAND ${NPM} run vsce -- package ${VsceOptions} -o ${CMAKE_CURRENT_BINARY_DIR}/vscode-lldb-full.vsix
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
Expand Down Expand Up @@ -267,40 +248,30 @@ set(MochaTest ${NPM} run mocha --
)

# Build everything for testing
add_dependencies(tests adapter codelldb debuggee)
add_dependencies(tests codelldb debuggee)

# Tests and test targets
add_custom_target(check)

if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
set(TestAdapters native)
set(TestTriples x86_64-pc-windows-gnu x86_64-pc-windows-msvc)
elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
set(TestAdapters classic native)
set(TestTriples x86_64-apple-darwin)
else()
set(TestAdapters classic native)
set(TestTriples x86_64-unknown-linux-gnu)
endif()

foreach(AdapterType ${TestAdapters})
foreach(TestTriple ${TestTriples})
set(TestName ${AdapterType}:${TestTriple})
add_test(NAME ${TestName}
COMMAND ${WithEnv} ADAPTER_TYPE=${AdapterType} TARGET_TRIPLE=${TestTriple} NODE_PATH=${CMAKE_BINARY_DIR} BUILD_DIR=${CMAKE_BINARY_DIR} SOURCE_DIR=${CMAKE_SOURCE_DIR} ${MochaTest}
WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
set_property(TEST ${TestName} PROPERTY RUN_SERIAL TRUE)
endforeach(TestTriple)

add_custom_target(check_${AdapterType} DEPENDS tests
COMMAND ${CMAKE_CTEST_COMMAND} -R ${AdapterType} --output-on-failure --verbose
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
USES_TERMINAL
)
add_dependencies(check check_${AdapterType})
endforeach(AdapterType)

add_dependencies(check_native cargo_test)
foreach(TestTriple ${TestTriples})
set(TestName adapter:${TestTriple})
add_test(NAME ${TestName}
COMMAND ${WithEnv} TARGET_TRIPLE=${TestTriple} NODE_PATH=${CMAKE_BINARY_DIR} BUILD_DIR=${CMAKE_BINARY_DIR} SOURCE_DIR=${CMAKE_SOURCE_DIR} ${MochaTest}
WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
set_property(TEST ${TestName} PROPERTY RUN_SERIAL TRUE)
endforeach(TestTriple)

add_custom_target(check
DEPENDS tests cargo_test
COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure
)

# Install

Expand All @@ -315,7 +286,6 @@ install(
add_custom_target(xclean
COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} --target clean
COMMAND ${CMAKE_COMMAND} -E remove_directory CMakeFiles
COMMAND ${CMAKE_COMMAND} -E remove_directory adapter
COMMAND ${CMAKE_COMMAND} -E remove_directory adapter2
COMMAND ${CMAKE_COMMAND} -E remove_directory debuggee
COMMAND ${CMAKE_COMMAND} -E remove_directory extension
Expand Down
10 changes: 2 additions & 8 deletions MANUAL.md
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ For example, on x86_64 the restrictions are as follows:
- There may be at most 4 data watchpoints.


## Hit conditions (native adapter only)
## Hit conditions
Syntax:
```
operator :: = '<' | '<=' | '=' | '>=' | '>' | '%'
Expand Down Expand Up @@ -472,11 +472,7 @@ debugger's main script context).
|**wrap(obj: `lldb.SBValue`) -> `Value`**| Wraps [`lldb.SBValue`](https://lldb.llvm.org/python_reference/lldb.SBValue-class.html) in a `Value` object.
|**display_html(<br>&nbsp;&nbsp;&nbsp;&nbsp;html: `str`, title: `str` = None,<br>&nbsp;&nbsp;&nbsp;&nbsp;position: `int` = None, reveal: `bool` = False)**|Displays content in a VSCode Webview panel:<li>html: HTML markup to display.<li> title: Title of the panel. Defaults to name of the current launch configuration.<li>position: Position (column) of the panel. The allowed range is 1 through 3.<li>reveal: Whether to reveal a panel, if one already exists.

# Adapter types
Please see [this announcement](CHANGELOG.md#heads-up-codelldb-is-moving-to-native-code).

# Alternate LLDB backends
*(native adapter only)*<br>
CodeLLDB can use external LLDB backends instead of the bundled one. For example, when debugging
Swift programs, one might want to use a custom LLDB instance that has Swift extensions built in.<br>
In order to use alternate backend, you will need to provide location of the corresponding liblldb&#46;so/.dylib/.dll
Expand Down Expand Up @@ -541,9 +537,7 @@ configurations when there is no existing `launch.json`.
## Advanced
| | |
|-----------------------|---------------------------------------------------------|
|**lldb.adapterType** |Type of debug adapter to use:<li>native - Native implementation, requires one-time download of platform-specific binaries (default),<li>classic - the original Python-based debug adapter running in externally provided LLDB.
|**lldb.executable** |Which LLDB executable to use. (default="lldb")
|**lldb.library** |Which LLDB library to use (native adapter only). This can be either a file path (recommended) or a directory, in which case platform-specific heuristics will be used to locate the actual library file.
|**lldb.library** |Which LLDB library to use. This can be either a file path (recommended) or a directory, in which case platform-specific heuristics will be used to locate the actual library file.
|**lldb.adapterEnv**|Environment variables to pass to the debug adapter.
|**lldb.verboseLogging**|Enables verbose logging. The log can be viewed in the "LLDB" output panel.

Expand Down
16 changes: 0 additions & 16 deletions adapter/__init__.py

This file was deleted.

36 changes: 0 additions & 36 deletions adapter/debugevents.py

This file was deleted.

32 changes: 0 additions & 32 deletions adapter/debugger_api.py

This file was deleted.

Loading

0 comments on commit 7a14a32

Please sign in to comment.