Crates.io | rdbg |
lib.rs | rdbg |
version | 0.2.1 |
source | src |
created_at | 2022-12-10 03:17:52.418418 |
updated_at | 2023-01-28 19:27:56.32213 |
description | Quick and dirty Rust remote debugging |
homepage | |
repository | https://github.com/nu11ptr/rdbg/tree/main/rdbg |
max_upload_size | |
id | 733703 |
size | 20,475 |
Quick and dirty Rust remote debugging. This crate is more or less equivalent to dbg and println in the stdlib but delivers the payloads via a TCP socket to a remote viewer.
In many cases, for quick debugging the dbg and println macros will often suffice. However, there are three main use cases where this crate comes in handy:
In all cases, this crate does not replace a regular debugger. If you wish/need to use a full-fledged debugger by all means do so.
let world = "world!";
// More or less equivalent to `println`
rdbg::msg!("Hello {}", world);
// More or less equivalent to `dbg`
rdbg::vals!(world, 1 + 1);
That works fine for servers and long-running programs, but since the messages are delivered
via a different thread there is an implicit race condition. As such, if your program
is not a server or long-running you will likely need the flush
function at
the end of your program. This will wait for all queued messages to be sent. For failing tests,
this function will need to be called before the point of crash to see the output.
let world = "world!";
// More or less equivalent to `println`
rdbg::msg!("Hello {}", world);
// More or less equivalent to `dbg`
rdbg::vals!(world, 1 + 1);
// Wait for messages to be transmitted before exiting
rdbg::flush();
[dependencies]
rdbg = "0.2"
enabled
(default) - enables debugginginsecure-remote
- Listens on 0.0.0.0 for remote debugging purposes (insecure, no auth)Use --no-default-features
option to quickly turn this crate into a no-op. Please note
that due to feature unification other uses of this crate within the same project could
turn it back on.