Skip to main content

Harness the power of ChatGPT directly inside the GDB debugger!

Project description

ChatGDB

Harness the power of ChatGPT inside the GDB debugger! Image

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, you will need to instead invoke the cli tool with

python path/to/cli.py -k <API KEY>.

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

chatgdb-1.0.2.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

chatgdb-1.0.2-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

Details for the file chatgdb-1.0.2.tar.gz.

File metadata

  • Download URL: chatgdb-1.0.2.tar.gz
  • Upload date:
  • Size: 4.7 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

Hashes for chatgdb-1.0.2.tar.gz
Algorithm Hash digest
SHA256 c73324b63195964a2efea6f2c2204a18ac22d54f9dc425cb6ab13b7991cd385d
MD5 724706736e33f707fb1de547fef83650
BLAKE2b-256 8c186004c8d9f7e2a52d4b5651f39d277d8f82178f0fa5721acba5e436e855bd

See more details on using hashes here.

File details

Details for the file chatgdb-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: chatgdb-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 5.8 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

Hashes for chatgdb-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8622878a77c950205fea29d140f754a2c3f377d8625bf9666e9eebaece3da176
MD5 d970fa2e057c340e9f92eb4b527a56f5
BLAKE2b-256 6fd7860a636fae2ddf4a927d0920166e7e298c0e12ff3777a52b726427041e37

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page