Harness the power of ChatGPT directly inside the GDB debugger!
Project description
ChatGDB
Harness the power of ChatGPT inside the GDB debugger!
ChatGDB is a tool designed to superpower your debugging experience with GDB, a debugger for compiled languages. Use it to accelerate your debugging workflow by leveraging the power of ChatGPT to assist you while using GDB!
It allows you to explain in natural language what you want to do, and then automatically execute the relevant command. Optionally, you can ask ChatGPT to explain the command it just ran or even pass in any question for it to answer. Focus on what's important - figuring out that nasty bug instead of chasing down GDB commands at the tip of your tongue.
Installation instructions
First, make sure you install pip
To install, run the command pip3 install chatgdb
. It will create an executable called
chatgdb
that you will have to use to set your api key. To do that, run the command
chatgdb -k <API KEY>
Without the API key, you won't be able to make requests to OpenAI. The API key is stored in text in the same directory as the installed script, which is currently in your python site packages folder along with the main script. You can easily find this location by running the following in your terminal:
python -m site --user-site
Optionally, you can also download the compressed files in the releases page to get the scripts directly.
If you do this, navigate to the chatgdb
folder, and you can install with
pip3 install .
.
How to use
I first recommend editing your $HOME/.gdbinit
to source the main script automatically on startup. Run the following command:
echo "source $(python -m site --user-site)/chatgdb/core.py" > $HOME/.gdbinit
While inside GDB the command chat appended by your query, for example chat list all breakpoints that I created
. There is also a command called explain
that you can use with no arguments to explain the previously run command, and optionally, with a query to just ask GPT a question. For example, running explain
directly after running break 7
would prompt the tool to explain how breakpoints work. Running explain how input formatting works in gdb
would prompt it to explain input formatting (see the image at the top).
Run chat help to print out a short tutorial on how to use the tool.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file chatgdb-1.0.3.tar.gz
.
File metadata
- Download URL: chatgdb-1.0.3.tar.gz
- Upload date:
- Size: 5.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.4.2 CPython/3.10.10 Linux/6.2.9-arch1-1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 83db4ae651bbf20d3eb80baaacffd45498a8e972a51f8ce95aebf3d3d8a308b4 |
|
MD5 | 1e8ea259dbe94dc2d04e7489a382bd80 |
|
BLAKE2b-256 | 3fad1c12d87ad3d95d83fdfe6759d2714dad44afb43d24c2154ce4fc4a70dff2 |
File details
Details for the file chatgdb-1.0.3-py3-none-any.whl
.
File metadata
- Download URL: chatgdb-1.0.3-py3-none-any.whl
- Upload date:
- Size: 6.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.4.2 CPython/3.10.10 Linux/6.2.9-arch1-1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2879927cd2785d178cb7947dc1aa3dd6756558ba22e7c1046137dd0f7ac5ad82 |
|
MD5 | 6eb6b6420b2e47171382a7a80b1dd474 |
|
BLAKE2b-256 | 022831e62d192a621533054d6a720c06838a9f1930d01552fe2389e458afbad9 |