ChatDBG  by plasma-umass

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

Created 2 years ago
1,023 stars

Top 36.6% on SourcePulse

GitHubView on GitHub
1 Expert Loves This Project
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

2 weeks ago

Responsiveness

1 day

Pull Requests (30d)
1
Issues (30d)
2
Star History
14 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.