Inspiration
Having all taken C/C++ based architecture and operating systems classes, our team knows the difficulty and lengthy process of manually debugging compiled code using GDB. While it is invaluable for determining the errors in logic, threading, or memory accesses, it follows an archaic syntax that LLMs are perfect for understanding and running the debugging process autonomously.
What it does
GDBuddy understands your codebase and takes a compiled executable from your build system along with a short explanation of what you think the error might be caused by. It then autonomously runs GDB, analyzing each step of output to determine the best next step. Once GDBuddy has found the bug, it stops GDB and summarizes the bug found alongside a possible fixed snippet of code to help you fix the code and learn to prevent similar bugs in the future.
How we built it
We build GDBuddy using the llama-stack framework for the backend in python, exposing a FastAPI interface for the frontend. The frontend is a VSCode extension written in TypeScript that connects to the LLM backend.
Challenges we ran into
The primary challenges we ran into were from running the LLMs locally, GDB inconsistencies between it's MacOS and Linux implementations, and python type problems. We also ran into some minor problems with the TypeScript processing of multi-color text from the Python backend.
Accomplishments that we're proud of
We built a LLM powered agent that autonomously runs a famously difficult to use CLI application (GDB) and also an intuitive VSCode extension.
Why is Llama a good fit
The llama models provide a perfect balance between speed and code understanding for using GDB. Additionally, their ability to seamlessly switch between on-device and cloud hosted models allow the user to select between privacy and greater code understanding while maintaining output consistency.
What we learned
We learned quite a bit about the process of building an AI agent in Python, effectively handling context and code history while interfacing with an external tool. Furthermore, we learned how to stream text from the backend to frontend and show continuous progress to the user. Furthermore, we learned how to build VSCode plugins following the native UI patterns to feel as natural to the user as possible, allowing them to hit the ground running with GDBuddy.
What's next for GDBuddy
The next steps for GDBuddy primarily would be focused on automating code fixes from the bugs found, applying GDBuddy to complex projects with multiple build configurations and user provided input (like an image parser for example), and providing a more contextually informative UI to accelerate the time to fix for all bugs found in compiled languages.
Built With
- c/c++
- fastapi
- gdb
- groq
- llama
- llama-stack
- python
- typescript
Log in or sign up for Devpost to join the conversation.