7 ms·
Show HN: ChatGDB – GPT-Powered GDB Assistant
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.
See it here: https://github.com/pgosar/ChatGDB https://github.com/pgosar/ChatGDB
- deleted 4y ago[deleted]
- amelius 4y agoAlso give me ChatAPT, the tool that helps you when your Debian package manager is in a broken state. And similar tools ChatPIP and ChatConda. Hell, just give me ChatAdmin.
- aliasxneo 4y agoFeels like the dotcom phase all over again. Next is ChatWithDominoPizza.
- zamnos 4y agoHilariously, one internal version of Bard really really wanted to send you a pizza. My guess is it was trained on the ositivity of /r/Random_Acts_Of_Pizza/, but who knows?
- pgosar0514 4y agoActually, that might be a future project! I am a bit worried about how much data I'd be sending on each request and how that may eat into tokens though, especially for more troublesome issues.
- jazzyjackson 4y agoYes I'm trying to catch up with the llama crowd - I wouldn't mind giving recursive shell access to a locally hosted, offline language model. On the other hand, hooking up a networked LLM to your networked shell is essentially a RCE by design
- deleted 4y ago[deleted]
- nr2x 4y agoGive it a week!
- rgovostes 4y agoSeems like it would be very useful to feed it context about the state of the program and ask it to decompile disassembly, explain what kind of fault happened based on clues left in the register state, etc.
- pgosar0514 4y agoRight, I was heavily considering adding that in, but at least for now I elected not to since it would be rather unwieldy to send enough information to output useful information. Not to mention GPT-3 isn't the best at giving you correct information on why your code is broken in most cases.
- great_psy 4y agoDid anyone use this for an actual project. I am wondering how those chatX applications actually help. When I had to use a dissasembler the issue was not commands, because those become muscle memory after a few hours of use. (LLM solutions are anti muscle memory because for the same prompt you can get diff results) The issue I had was wrapping my brain around what is actually going on, keeping track of pointers, addresses and so on. Maybe this chat solution can help with some of that, but I often am not sure what I actually am looking for so I can’t ask for it. Until I gets to “fix the bug/ find the overflow” I just don’t see the extra value.
- eloff 4y agoI use gbd so rarely that I often forget the commands between sessions. Then I use print debugging when it’s not the best tool just because I don’t want to lookup the commands. I could see the use for this kind of thing. Same problem when coding shell scripts. It’s like they tried to invent the hardest to remember language. I often use python instead of bash just because I can remember it and read it.
- girvo 4y agoI use GDB all the time… but never directly, always through an IDE’s debugging abilities. So I can’t see any use to tools like this one? Dunno maybe I’m missing something and lots use it directly, but IDE integration is what makes it super useful for JTAG debugging of firmware at work for me.
- jakeinspace 4y agoI do embedded development, so I’m usually attaching a gdb session to the server spawned by this esoteric chip’s programmer/debugger. I could possibly make use of this I suppose.
- girvo 4y agoI think I’m reasonably spoiled by ESP-IDF and the STM32 toolchains integrations into VSCode; aside from launching OpenOCD myself I never have to manage GDB directly
- agentwiggles 4y agoHaha, that is really cool. However this is one of those things where I have no idea how to tell if ChatGPT is bullshitting me because I don't know how to GDB on my own.
- furyofantares 4y agoIt's also the type of thing where it's extremely unlikely to bullshit. And ALSO the type of thing where I think you can work out if it's bullshitting you on your own; if it works, it's not bullshitting.
- majormajor 4y agoWith technical things "bullshitting" is less of a problem than "wrong version" type of stuff, IME. GDB... probably a slowly enough moving target, though. ;) And even on the things I've seen it get wrong, even in higher-churn areas like front-end-Javascript, it's usually "usefully wrong" in that now I've tried one more thing and often end up aware of several more things to look up to try to figure out the right one.
- teaearlgraycold 4y agoThat's why LLMs are best suited to programming. You know pretty quickly if it's lied to you.
- krupan 4y agoI’m sorry, but these arguments are terrible. I see them boiling down to this: “Use GPT to do this thing!” “But GPT is notorious for confidently getting things wrong” “That’s ok! Because you’ll know it’s wrong!” Maybe I’m a little sore right now because I literally just finished trying to have GPT write code for me and it gave me code with all kinds of syntax errors and mistakes. Yes, I know not to trust it because the compiler flagged the problems, but what now? I go write the code myself I guess. Yay GPT? What problem is GPT solving here then?
- 4y ago
- jmmv 4y ago“ChatGDB, find me the memory leak!” is what I would want to say! Not really dictate commands I don’t know I may even need.
- mathisfun123 4y agohttps://github.com/openai/triton/pull/1358#issue-1628393794 https://github.com/openai/triton/pull/1358#issue-1628393794 >One fun thing - after tracking down the code to the block of C++ code, ChatGPT-4 is what actually found the memory leak for me :) although I can't imagine what the prompt was.
- amrb 4y agoI don't have gpt4 tho we could test with a prompt like: "Thinking step by step, what does this code do, is there a problem?"
- Buttons840 4y agoGTP man pages would be awesome. This is pretty close to that for GDB. Although I suspect this is a limited view of the possibilities akin to thinking "the internet sounds neat, I can use it to find new pen pals". It also makes me wonder if the command line will return as the premiere PC interface. Why would I want to use your web page with all its lovely design and branding when I can just ask the command line to show me the information the way I want?
- eloff 4y agoIs there something like this for the command line in general? I'd love to have a ? command that takes an optional prompt and feeds my current shell history to chat gpt and gets a recommendation for the last command that failed. Something like https://github.com/nvbn/thefuck https://github.com/nvbn/thefuck but with some intelligence instead of hard-coded rules. That's somewhat problematic if you have secrets in there, but you could just not use it if you know you have sensitive things in your shell history. You still need to be aware of that without ChatGPT since most systems save your shell history to the file system where it could remain accessible for much longer than you'd think. IIRC they don't use things from the API for training, but I wouldn't depend on that being safe.
- danielvaughn 4y agoSecurity isn’t a problem if you’re running the model locally. I came across this project and would love to build an embedded version: https://github.com/BuilderIO/ai-shell https://github.com/BuilderIO/ai-shell
- mpeg 4y agoWarp Terminal has an AI command search built in, using natural language. It's pretty nice, if you can get past the fact it requires an account to use it and it's not OSS
- atarian 4y agoSounds like Copilot for CLI: https://githubnext.com/projects/copilot-cli/ https://githubnext.com/projects/copilot-cli/
- ArenaSource 4y agoIf you feel brave and have credits to burn https://github.com/jla/gpt-shell https://github.com/jla/gpt-shell (shameless auto-promotion) Nah, seriously don't use it, is just a small experiment, curious thing is that half of the code is the GPT prompts..
- gumballindie 4y agoThis is hilarious - it’s actions are either outright wrong or already supported by the native shell itself.
- intalentive 4y agoGood looking terminal output. I like the font and color theme.
- avargas 4y agoI believe it's Solarized Dark. The font I don't know
- pyjamafish 4y agoI recognized the 'g' and 'r' from Fira Mono, but from the slashed zero and ligatures (the raised x in 0x), I think the font is Fira Code[1]. I don't think the color scheme is Solarized Dark. Looks closer to Nord[2]. [1]: https://fonts.google.com/specimen/Fira+Code?preview.text=(gdb)%20chat%20show%20instructions%20at%200x1168&preview.text_type=custom https://fonts.google.com/specimen/Fira+Code?preview.text=(gd... [2]: https://github.com/nordtheme/terminal-app https://github.com/nordtheme/terminal-app
- winstonprivacy 4y agoOk, this looks pretty slick! I'll try it out next week as I have a few seg faults I need to figure out.
- nr2x 4y agoThe core “program” is just two lines! https://github.com/pgosar/ChatGDB/blob/ee9d64b441939df163dc58d5c5913e9f81f82dc6/chatgdb/core.py#L79 https://github.com/pgosar/ChatGDB/blob/ee9d64b441939df163dc5...
- zamnos 4y agoWhats the opposite of perl? because that one line's eminently readable
- kqr 4y agoIt's called "conversational programming" and it was all the rage in the '60s or '70s. Maybe it's time for a resurgence?
- kolinko 4y agoSQL grew out of that trend btw :)
- nr2x 4y agoOh my god, if SQL is the “conversational” option what other design did they consider? Binary?
- TechBro8615 4y agoIt's been 50+ years and still nobody has invented anything better that people actually use.
- nr2x 4y agoI mean, I’m using ChatGPT to render natural language down to executable SQL for a project right now. It’s not a universal solution, as it’s specific to my data architecture, but if I were to devote a month to it I’m fairly sure I’d make a big dent in a generalized solution. And I’m VERY sure somebody else already 90% done we’ll see it on GitHub soon!
- hawski 4y agoI am sure ChatGPT can deal with GDB. Lately I wanted it to help me with Windows Command line Debugger and it bullshitted half of it.
- amrb 4y agoI've used summary plugins for bninja and ghidra, can I ask was the results bad when trying to get it to explain a snippet of gdb?
- ofrzeta 4y agoit's great. now you can type "chat stop my code at line 8" instead of "b 8" :-)
- KoenDG 4y agoNext up: AI programs that the analyze kernel code and report on constructs that probably don't work the way we think they do.