| Crates.io | pmd |
| lib.rs | pmd |
| version | 0.0.1 |
| created_at | 2023-01-27 09:51:55.010874+00 |
| updated_at | 2023-01-27 09:51:55.010874+00 |
| description | Poor's man debugger, the most easy way to debug |
| homepage | |
| repository | https://github.com/nkoporec/pmd/ |
| max_upload_size | |
| id | 769528 |
| size | 67,429 |
The most simple way to debug your code.
This is a simple TUI debugger, it starts a local server that accepts payloads from the adapters. Everything goes through HTTP requests, so it's very fast compared to other solutions. You can think of it as a console.log(), but instead of the browser you use the terminal and it works with any language.
You can install it via cargo.
cargo install pmdThe default config is located at ~/.config/pmd/config.toml (for UNIX like systems) or ~/.pmd/config.toml (for Windows).
You can override the default config by passing a -c (--config) flag that points to the config.toml file.
Keybindings are VIM-like. The leader key is set by default to , , but you can override this via config.
Debugger consists of three input states
Normal mode enables you to scroll all the breakpoints and callstack data.
It has the following keybindings:
j (or Down arrow) -> Move down the listk (or Up arrow) -> Move up the list<leader> + h -> Move to the left<leader> + l -> Move to the righti -> Set inspection mode, to inspect the dumped variablesv -> Set visual mode and open the selected breakpoint/callstack in a popup for more details.q -> QuitVisual mode is meant to show additional data that are not present in normal mode for breakpoints/callstack.
It has the following keybindings:
q -> QuitESC -> Go to normal modeInspection mode enables you to inspect the tree-like data that were sent by the adapters.
It has the following keybindings:
j (or Down arrow) -> Move down the tree
k (or Up arrow) -> Move up the tree
h -> Close the selected item
l -> Expand selected item.
q -> Quit
ESC -> Go to normal mode
Adapters are language specific packages that sends the actual debug data to PMD via HTTP.
Currently supported
An example API for an adapter
curl --request POST \
--url http://localhost:6969/dump \
--header 'Content-Type: application/json' \
--data '{
"timestamp": "3223232",
"line": "6",
"connector_type": "php",
"filepath": "/home/project/drupal/web/index.php",
"callstack": [
{
"filepath": "/home/project/drupal/web/index.php",
"line": "10"
}
],
"payload": ""
}'
Types:
timestamp -> String
line -> String
connector_type -> String
filepath -> String
callstack -> Array (where key is a line number (int), and value is a file path (string)
payload -> JSON encoded string
For any security vulnarabilities please send an email to hey@nkoporec.com
The MIT License (MIT). Please see License File for more information.