Skip to content

Commit

Permalink
Update docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
vadimcn committed Sep 10, 2021
1 parent da87ea2 commit 2b9c017
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 29 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Release Notes

# 1.6.6

## New
- Updated LLDB to 13.0.0
- Added [`debug_info`](MANUAL.md#debugger-commands) LLDB command, that makes it easier to determine which modules have debug info available.

## Fixed
- Bug #474: image dump sections causes the plugin to hang
- Bug #480: Panic: 'assertion failed: addr.is_valid()'

# 1.6.5

## Fixed
Expand Down
40 changes: 29 additions & 11 deletions MANUAL.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
- [Formatting](#formatting)
- [Pointers](#pointers)
- [Expressions](#expressions)
- [Python Scripting](#python-scripting)
- [Debugger API](#debugger-api)
- [Adapter types](#adapter-types)
- [Alternate LLDB backends](#alternate-lldb-backends)
- [Rust Language Support](#rust-language-support)
- [Workspace Configuration](#workspace-configuration)
Expand Down Expand Up @@ -517,7 +517,12 @@ Prefix: `/py `<br>
Python expressions use normal Python syntax. In addition to that, any identifier prefixed by `$`
(or enclosed in `${`...`}`), will be replaced with the value of the corresponding debuggee
variable. Such values may be mixed with regular Python variables. For example, `/py [math.sqrt(x) for x in $arr]`
will evaluate to a list containing square roots of the values contained in array variable `arr`.
will evaluate to a list of square roots of the values contained in array variable `arr`.
The environment, in which Python expressions are executed, is shared with the internal Python interpreter of the debugger
and is affected by `script ...` command. This may be used to import Python modules you are going to use later.
For example, in order to evaluate `math.sqrt(x)` above, you'll need to have imported the `math` package via
`script import math`. To import Python modules on debug session startup, use `"initCommands": ["script import ..."]`.
### Native expressions
Prefix: `/nat `<br>
Expand All @@ -529,19 +534,31 @@ of new data types, instantiation of C++ classes, invocation of functions and cla
Note, however, that native evaluators ignore data formatters and operate on "raw" data structures,
thus they are often not as convenient as "simple" or "python" expressions.
# Python Scripting
## Debugger API
CodeLLDB provides Python API via the `debugger` module (which is auto-imported into
debugger's main script context).
CodeLLDB provides extended Python API via `codelldb` module (which is auto-imported into debugger's main script context).
- **evaluate(expression: `str`, unwrap=False) -> `Value` | `lldb.SBValue`** : Allows dynamic evaluation of [simple expressions](#simple-expressions). The returned `Value` object is a proxy wrapper around [`lldb.SBValue`](https://lldb.llvm.org/python_reference/lldb.SBValue-class.html), which adds implementations of standard Python operators.
- **expression**: The expression to evaluate.
- **unwrap**: Whether to unwrap the result and return it as `lldb.SBValue`.
- **unwrap(obj: `Value`) -> `lldb.SBValue`** : Extracts an [`lldb.SBValue`](https://lldb.llvm.org/python_reference/lldb.SBValue-class.html) from `Value`.
- **wrap(obj: `lldb.SBValue`) -> `Value`** : Wraps [`lldb.SBValue`](https://lldb.llvm.org/python_reference/lldb.SBValue-class.html) in a `Value` object.
- **display_html(html: `str`, title: `str` = None, position: `int` = None, reveal: `bool` = False)** : Displays content in a VSCode WebView panel:
- **html**: HTML markup to display.
- **title**: Title of the panel. Defaults to the name of the current launch configuration.
- **position**: Position (column) of the panel. The allowed range is 1 through 3.
- **reveal**: Whether to reveal a panel if one already exists.
|Function |Description|
|-----------------------------------|------------
|**evaluate(expression: `str`) -> `Value`**| Allows dynamic evaluation of [simple expressions](#simple-expressions). The returned `Value` object is a proxy wrapper around [`lldb.SBValue`](https://lldb.llvm.org/python_reference/lldb.SBValue-class.html),<br> which implements most Python operators over the underlying value.
|**unwrap(obj: `Value`) -> `lldb.SBValue`**| Extracts an [`lldb.SBValue`](https://lldb.llvm.org/python_reference/lldb.SBValue-class.html) from `Value`.
|**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.
## Installing Packages
CodeLLDB bundles its own copy of Python, which may be different from the version of your default Python.
As such, it likely won't be able to use third-party packages you've installed through `pip`. In order to install packages
for use in CodeLLDB, you will need to use the **LLDB: Command Prompt** command in VSCode, followed by `pip install --user <package>`.
# Alternate LLDB Backends
# Alternate LLDB backends
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. In order to use an alternate backend,
you will need to provide location of the corresponding LLDB dynamic library (which must be v6.0 or later) via
Expand All @@ -563,6 +580,7 @@ you may see the following error after switching to an alternate backend: "Unable
To fix this, determine where `lldb-server` is installed (via `which lldb-server-<version>`), then add
this configuration entry: `"lldb.adapterEnv": {"LLDB_DEBUGSERVER_PATH": "<lldb-server path>"}`.
# Rust Language Support
CodeLLDB natively supports visualization of most common Rust data types:
Expand Down
36 changes: 23 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,35 @@
# Features
- Debugging on Linux (x86 or Arm), MacOS (x86 or Arm) and Windows<sup>\*</sup> (x86 only),
- Conditional breakpoints, function breakpoints, data breakpoints, logpoints,
- Conditional breakpoints, function breakpoints, logpoints,
- Hardware data access breakpoints (watchpoints),
- Launch debuggee in integrated or external terminal,
- Disassembly view with instruction-level stepping,
- Loaded modules view,
- Python scripting,
- HTML rendering for advanced visualizations,
- Rust language support with built-in visualizars for vectors, strings and other standard types,
- Global and workspace defaults for launch configurations,
- Workspace-level defaults for launch configurations,
- Remote debugging,
- Reverse debugging (experimental, requires compatible backend).
- Reverse debugging (experimental, requires a compatible backend).

For full details please see the [User's Manual](MANUAL.md).<br>
For full details please see [User's Manual](MANUAL.md).<br>

<sup>\*</sup> For a good debugging experience on Windows, please use `x86_64-pc-windows-gnu` compilation target.
MS PDB debug info support is limited, especially for Rust binaries. [More info.](https://github.com/vadimcn/vscode-lldb/wiki/Windows)
# Languages
The primary focus of this project are the C++ and Rust languages, for which CodeLLDB includes built-in visualizers for
vectors, strings, maps, and other standard library types.<br>
That said, it is usable with most other compiled languages whose compiler generates compatible debugging information,
such as Ada, Fortran, Kotlin Native, Nim, Objective-C, Pascal, [Swift](https://github.com/vadimcn/vscode-lldb/wiki/Swift)
and Zig.

# Supported Platforms
- Linux with glibc 2.18+ (e.g. Debian 8, Ubuntu 14.04, Centos 8) for x86_64, aarch64 or armhf architecture,
- MacOS X 10.10+ for x86_64 and 11.0+ for arm64 architecture,
- Windows 10 for x86_64 architecture.

## Host
- [Linux](https://github.com/vadimcn/vscode-lldb/wiki/Linux) with glibc 2.18+ for x86_64, aarch64 or armhf,
- [MacOS](https://github.com/vadimcn/vscode-lldb/wiki/MacOS) X 10.10+ for x86_64 and 11.0+ for arm64,
- [Windows](https://github.com/vadimcn/vscode-lldb/wiki/Windows) 10 for x86_64.

## Target
CodeLLDB supports AArch64, ARM, AVR, MSP430, RISCV, X86 architectures and may be used to debug on embedded platforms
via [remote debugging](MANUAL.md#remote-debugging). This includes Android, iOS, OpenOCD and pretty much anything else
implementing the GDB remote debugging protocol.

# Quick Start
Here's a minimal debug configuration to get you started:
Expand All @@ -36,9 +46,9 @@ Here's a minimal debug configuration to get you started:
# Links
- [Debugging in VS Code](https://code.visualstudio.com/docs/editor/debugging) - if you are new to VSCode debugging.
- [CodeLLDB User's Manual](MANUAL.md) - how to use this extension.
- [LLDB Homepage](https://lldb.llvm.org/) - all of LLDB's CLI commands and scripting features can be used too.
- [LLDB Homepage](https://lldb.llvm.org/) - all of LLDB's CLI commands and scripting features may be used in CodeLLDB.
- [Wiki pages](https://github.com/vadimcn/vscode-lldb/wiki) - [troubleshooting](https://github.com/vadimcn/vscode-lldb/wiki/Troubleshooting) and other tips and tricks.
- [Discussions](https://github.com/vadimcn/vscode-lldb/discussions) - for questions and discussion.
- [Discussions](https://github.com/vadimcn/vscode-lldb/discussions) - for questions and discussions.

# Screenshots

Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"displayName": "CodeLLDB",
"version": "@VERSION@",
"publisher": "vadimcn",
"description": "Native debugger based on LLDB.",
"description": "A native debugger powered by LLDB. Debug C++, Rust and other compiled languages.",
"license": "MIT",
"author": {
"name": "vadimcn"
Expand All @@ -13,11 +13,11 @@
"Debuggers"
],
"keywords": [
"LLDB",
"Rust",
"C++",
"Native",
"Assembly"
"Rust",
"Reverse",
"Embedded",
"Debugger"
],
"private": true,
"repository": {
Expand Down

0 comments on commit 2b9c017

Please sign in to comment.