Dbgee - the Zero-Configuration Debuggee for Debuggers

Overview

Dbgee - the Zero-Configuration Debuggee for Debuggers

Dbgee is a handy utility that allows you to launch CLI debuggers and VSCode debuggers from the debuggee side. Just start your program by a simple command in a terminal, and the debugger will automatically attach to it with zero configuration. Dbgee also has the ability to preconfigure your program to automatically start a debug session no matter how the program is started.

Dbgee is very useful especially when your program requires command line arguments or redirection, or when your program is launched by some script. In addition, Dbgee frees you from the hassle of writing launch.json for VSCode.

Demos

The concept of Dbgee should be new and unfamiliar to you, so here are some demos to get you started.

Debug your program with zero configuration in Visual Studio Code

demo image

Configure your program to launch a debugger when it runs

demo image

Launch CUI debuggers in tmux

demo image

Supported languages and platforms

Languages

The current supported languages are C, C++, Rust, Go, Python and any languages which Gdb, LLDB, or CodeLLDB support.

Platforms

Currently only Linux (including WSL2 on Windows) is supported. However, adding macOS support is pretty easy and will be added soon if there are any macOS users. Please say hi to me in a GitHub issue.

Installation

There are two components, dbgee command and the optional VSCode extension.

dbgee command

curl -L -O https://github.com/nullpo-head/dbgee/releases/download/cli-v0.1.0/dbgee-linux-x64.tar.gz
tar xvf dbgee-linux-x64.tar.gz
mv dbgee /usr/local/bin/ # Or anywhere in the PATH

VSCode extension

Please install "Dbgee" extension from the marketplace.

Usage

Run and attach to your program

Use run subcommand to launch your program and attach a proper debugger to it.

Launch a CLI debugger in a tmux window

By the following command, the proper debugger for your program launches in a new tmux window.

dbgee run -- ./program arg0 arg1 arg2...

You can manually specify your preferred debugger by the -d option.

dbgee run -d lldb -- ./program arg0 arg1 arg2...

dbgee launches a debugger in a new tmux window unless you run dbgee in an integrated terminal in VSCode. However, you can choose other options by specifying -t option. Please see the help for more information.

dbgee run -t tmuxw -- ./program  arg0 arg1 arg2... # launch a debugger in a new tmux window instead of a window

Debug your program in VSCode

dbgee launches the given debuggee and wait for VSCode to connect to your program if dbgee is running in a VSCode's integrated terminal. Run the following command, and attach to your program in VSCode as the demo videos.

dbgee run -- ./program arg0 arg1 arg2...

Or, you can use -t vscode option to explicitly make dbgee wait for VSCode.

dbgee run -t vscode -- ./program arg0 arg1 arg2...

Automatically attach a debugger when your program is launched

set subcommand will automatically attach a debugger to your program, no matter by what means it is started. This is a very useful feature when your program is launched by some start up scripts in your development flow. However, please note that set command doesn't work if you rebuild your program after you run set, or when your start up scripts incur rebuild, because set command works by replacing your program with a wrapper script.

dbgee set ./program
./program arg0 arg1 arg2  # your program is launched, being attached by the debugger

Use unset command to stop the debugger from attaching automatically

dbgee unset ./program

If you specify some to launch your program, dbgee automatically runs unset after your command finishes.

dbgee set ./program -- ./some_startup_script
You might also like...
Emacs configuration for Rust

Table of Contents Introduction Installation Melpa Manual installation Feature guide Indentation Code formatting Running / testing / compiling code Cli

Vim configuration for Rust.

rust.vim Description This is a Vim plugin that provides Rust file detection, syntax highlighting, formatting, Syntastic integration, and more. It requ

Zap - A simple cross-platform configuration management and orchestration tool

Zap - A simple cross-platform orchestration and configuration management tool. The main goal for Zap is to a simple mechanism for managing groups of com

A node and runtime configuration for polkadot node.
A node and runtime configuration for polkadot node.

MANTA NODE This repo is a fresh FRAME-based Substrate node, forked from substrate-developer-hub/substrate-node-templte 🚀 It links to pallet-manta-dap

rurl is like curl but with a json configuration file per request

rurl rurl is a curl-like cli tool made in rust, the difference is that it takes its params from a json file so you can have all different requests sav

Just-config is a configuration library for rust

Config Library for Rust Just-config is a configuration library for rust. It strives for the old Unix mantra "Do one thing and to it well".

Universal configuration library parser

LIBUCL Table of Contents generated with DocToc Introduction Basic structure Improvements to the json notation General syntax sugar Automatic arrays cr

Uclicious is a flexible reduced boilerplate configuration framework.

Uclicious What is Uclicious Usage Raw API Derive-driven Validators Type Mapping Supported attributes (#[ucl(..)]) Structure level Field level Addition

A Rust library for processing application configuration easily

Configure me A Rust library for processing application configuration easily About This crate aims to help with reading configuration of application fr

Rust library for parsing configuration files

configster Rust library for parsing configuration files Config file format The 'option' can be any string with no whitespace. arbitrary_option = false

⚙️ Layered configuration system for Rust applications (with strong support for 12-factor applications).

config-rs Layered configuration system for Rust applications (with strong support for 12-factor applications). Set defaults Set explicit values (to pr

cfg-rs: A Configuration Library for Rust Applications

cfg-rs: A Configuration Library for Rust Applications Major Features One method to get all config objects, see get. Automatic derive config object, se

Rust library for handling CHIP-8 configuration options

octopt octopt is a library for handling CHIP-8 configuration settings. It contains Rust data structures that aim to represent all possible CHIP-8 opti

A web application to configuration Caddy based on MoonZoon.

Cream A web application to configuration Caddy based on MoonZoon. MoonZoon is a Rust Fullstack Framework. Live demo Run on a local machine Check you'v

A dead simple configuration language.

Rakh! A dead simple configuration language. No seriously, it's simple. With only 26 lines of code, it's one of the tiniest configuration languages the

Advanced configuration options for sockets.

socket2-rs Documentation License This project is licensed under either of Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licens

Irx-config - The library provides convenient way to represent/parse configuration from different sources

The irx-config library provides convenient way to represent/parse configuration from different sources. The main goals is to be very easy to use and t

Application microframework with command-line option parsing, configuration, error handling, logging, and shell interactions
Application microframework with command-line option parsing, configuration, error handling, logging, and shell interactions

Abscissa is a microframework for building Rust applications (either CLI tools or network/web services), aiming to provide a large number of features w

🌽 A simple and pain-free configuration language.

🌽 Corn A simple and pain-free configuration language. Corn has been designed using inspiration from JSON and Nix to produce a language that's easy an

Comments
  • macOS support

    macOS support

    I didn't implement macOS support because I'm a Linux user, but I will if there's requests for it, as I wrote in README.md.

    Please leave a 👍 reaction if anyone wants macOS support.

    opened by nullpo-head 1
  • feat: introduce hook command for gdb/dlv

    feat: introduce hook command for gdb/dlv

    The new hook command allows you to start a debug session without explicitly specifying the target path. Instead, hook starts a debug session when some program meets the given condition.

    opened by nullpo-head 0
  • ptrace: Operation not permitted

    ptrace: Operation not permitted

    On the current Manjaro (Arch) Linux 5.13.1-3-MANJARO #1 SMP PREEMPT x64, VS Code Insiders (like Beta), current Dbgee VS Code extension 0.2.1, dbgee-linux-x64 binary 0.3.0 from https://github.com/nullpo-head/dbgee/releases. I have a simple pure-Rust (and static binary) project with current rustc 1.55.0-nightly (32c9b7b09 2021-07-21).

    In VS Code > terminal I run cargo build, which is successful. Then I run it with my debug binary:

    ~/GIT/dbgee-linux-x64-0.3.0/dbgee run -- ./target/debug/rust-dbg
    ...
    None No process In:                                                                                                                 GNU gdb (GDB) 10.2
    --Type <RET> for more, q to quit, c to continue without paging--
    

    Then after pressing Enter twice, it failed:

    For help, type "help".
    Type "apropos word" to search for commands related to "word".
    Attaching to process 70996
    ptrace: Operation not permitted.
    

    Please advise.

    opened by peter-kehl 0
  • README.md: Explan CLI earlier; tmux dependency

    README.md: Explan CLI earlier; tmux dependency

    Hi Takaya,

    Thank you for dbgee. It seems to be useful especially for Rust (since VS Code debugging doesn't print Rust enum variant details).

    1. However, when someone searches for "VS Code" GDB and they come upon your VS Code extension, and subsequently to this repo, it's not obvious from the beginning that this requires/primarily provides the CLI tool. May I suggest that you move "dbgee command and the optional VSCode extension" to/near the top of this README.md, please?

    2. README.md mentions usage of tmux, but people may not know what tmux is. May I suggest that you list it as a requirement near the top, please? It may also help to mention that Linux packagers (Arch/Manjaro) may be able to install tmux.

    opened by peter-kehl 0
Releases(cli-v0.5.0)
Owner
Takaya Saeki
(☕, 🍣, 🍔) => 💻
Takaya Saeki
A rust layered configuration loader with zero-boilerplate configuration management.

salak A layered configuration loader with zero-boilerplate configuration management. About Features Placeholder Key Convension Cargo Features Default

Daniel YU 28 Sep 20, 2022
Downloads and provides debug symbols and source code for nix derivations to gdb and other debuginfod-capable debuggers as needed.

nixseparatedebuginfod Downloads and provides debug symbols and source code for nix derivations to gdb and other debuginfod-capable debuggers as needed

Guillaume Girol 16 Mar 6, 2023
A systemd-boot configuration and boot entry configuration parser library

A systemd-boot configuration and boot entry configuration parser library

Kaiyang Wu 2 May 22, 2022
Kusion Configuration Language (KCL) is an open source configuration language mainly used in Kusion Stack

Kusion Configuration Language (KCL) is an open source configuration language mainly used in Kusion Stack. KCL is a statically typed language for configuration and policy scenarios, based on concepts such as declarative and Object-Oriented Programming (OOP) paradigms.

KusionStack 264 Dec 30, 2022
wireguard tool to manage / generate configuration. Maintain one yaml configuration file to quickly build wireguard network.

wgx wireguard tool to manage / generate configuration. Maintain one yaml configuration file to quickly build wireguard network. Usage wgx --h USAGE:

yinheli 6 Nov 3, 2022
A very opinionated, zero-configuration shell prompt

A very opinionated, zero-configuration shell prompt

amy null 8 Nov 4, 2021
zzhack-cli is a Command Tool to help you quickly generate a WASM WebApp with simple configuration and zero code

English | 中文文档 zzhack-cli is a Command Tool that can help you quickly generate a WASM WebApp with simple configuration and zero code. It's worth menti

null 17 Feb 9, 2023
RISC Zero is a zero-knowledge verifiable general computing platform based on zk-STARKs and the RISC-V microarchitecture.

RISC Zero WARNING: This software is still experimental, we do not recommend it for production use (see Security section). RISC Zero is a zero-knowledg

RISC Zero 653 Jan 3, 2023
gRPC client/server for zero-knowledge proof authentication Chaum Pederson Zero-Knowledge Proof in Rust

gRPC client/server for zero-knowledge proof authentication Chaum Pederson Zero-Knowledge Proof in Rust. Chaum Pederson is a zero-knowledge proof proto

Advaita Saha 4 Jun 12, 2023
The Zero Knowledge Whitelist Tool is a powerful utility for managing an address whitelist using Zero-Knowledge (ZK) proofs.

zk_whitelist: A Zero Knowledge Whitelist Tool The Zero Knowledge Whitelist Tool is a powerful utility for managing an address whitelist using Zero-Kno

Nikos Koumbakis 4 Nov 21, 2023