ChatDBG  by plasma-umass

AI-assisted debugging tool for C/C++/Python/Rust code

created 2 years ago
1,007 stars

Top 37.7% on sourcepulse

GitHubView on GitHub
Project Summary

ChatDBG is an AI-powered debugging assistant that integrates large language models with standard debuggers (pdb, lldb, gdb) for C/C++, Python, and Rust. It allows users to ask natural language questions about program behavior, receive error diagnoses, and get suggested code fixes, aiming to automate root cause analysis.

How It Works

ChatDBG leverages LLMs to interpret debugger states and user queries. When a program crashes or encounters an issue, users can interact with the debugger using commands like why to ask for explanations. ChatDBG then uses the LLM to analyze the current execution context, stack trace, and variable values to provide insights and potential solutions, effectively turning the debugger into a conversational tool.

Quick Start & Requirements

  • Install via pip: python3 -m pip install chatdbg
  • Requires an OpenAI API key with sufficient credits (GPT-4 is used). Set as OPENAI_API_KEY environment variable.
  • For native code debugging (C/C++/Rust), additional setup is required to integrate with lldb or gdb via ~/.lldbinit or ~/.gdbinit.
  • For Rust, add chatdbg = "0.6.2" to Cargo.toml and use the #[chatdbg::main] attribute.
  • Official documentation and examples are available.

Highlighted Details

  • Integrates with Python's pdb, and native debuggers lldb and gdb.
  • Supports C/C++ and Rust debugging workflows.
  • Provides natural language explanations for errors and suggests code fixes.
  • Offers post-mortem debugging capabilities.
  • Supports IPython and Jupyter Notebook integration.

Maintenance & Community

The project is authored by Emery Berger, Stephen Freund, Kyla Levin, and Nicolas van Kempen. A paper detailing technical aspects is forthcoming at FSE 2025.

Licensing & Compatibility

The README does not explicitly state the license. Compatibility for commercial use or closed-source linking is not specified.

Limitations & Caveats

ChatDBG currently requires an OpenAI API key and relies on GPT-4, incurring costs. Integration with lldb may require updating to newer LLVM versions. The project is actively backporting features across different debugger integrations.

Health Check
Last commit

3 weeks ago

Responsiveness

1 day

Pull Requests (30d)
1
Issues (30d)
0
Star History
98 stars in the last 90 days

Explore Similar Projects

Starred by Chip Huyen Chip Huyen(Author of AI Engineering, Designing Machine Learning Systems) and Carol Willing Carol Willing(Core Contributor to CPython, Jupyter).

genai by rgbkrk

0%
352
IPython extension for generative AI assistance in Jupyter notebooks
created 3 years ago
updated 1 year ago
Feedback? Help us improve.