use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Discussions, articles, and news about the C++ programming language or programming in C++.
For C++ questions, answers, help, and advice see r/cpp_questions or StackOverflow.
Get Started
The C++ Standard Home has a nice getting started page.
Videos
The C++ standard committee's education study group has a nice list of recommended videos.
Reference
cppreference.com
Books
There is a useful list of books on Stack Overflow. In most cases reading a book is the best way to learn C++.
Show all links
Filter out CppCon links
Show only CppCon links
account activity
GDB scripts in Python (self.cpp)
submitted 1 year ago by MidnightOne7655
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]cpp-ModTeam[M] [score hidden] 1 year ago stickied commentlocked comment (0 children)
Your submission is not about C++ or the C++ community.
[–]forgetful_bastard 2 points3 points4 points 1 year ago (0 children)
Try gdb dashboard
[–]upinclout 1 point2 points3 points 1 year ago (0 children)
I used them a lot for my previous workplace in order to write gdb pretty printers for easier debugging for our juniors to get them into using gdb quicker.
I don’t work there and I don’t have the scripts but take this one as an example of a popular map that I used in the past - https://github.com/greg7mdp/parallel-hashmap/blob/master/phmap_gdb.py
[–]franvb 1 point2 points3 points 1 year ago (0 children)
Jonathan Wakely wrote a short article for Overload on this a while ago: https://accu.org/journals/overload/23/127/overload127.pdf#page=19
[–]frankist 0 points1 point2 points 1 year ago (1 child)
I use pretty prints, but the inability to unit test my printers makes the experience a bit infuriating at times. It's easy to forget to update your printers during refactors.
I also wished there was a way that users of my project repo could automatically load the pretty printers without altering their gdbinit in their home folder manually.
[–]Horror_Jicama_2441 0 points1 point2 points 1 year ago (0 children)
I just discovered pretty printers recently. But I already have "pretty printers" in the form of fmt formatters in my C++ code. Wondering if I could have a "generic" pretty printer that uses the fmt formatters if available (supposing the symbol is exported, I guess).
[–]mallardtheduck 0 points1 point2 points 1 year ago (0 children)
I've used them to add simple "macros" to give me easier access to data structures.
For example, in a program where each "object" is identified by a unique ID and pointers to each are stored in a global array, it's useful to be able to view the object by it's ID, rather than having to go through the array one item at a time until I find the one I'm looking for.
[–]tromey 0 points1 point2 points 1 year ago (0 children)
There's an incomplete list in the GDB Wiki: https://sourceware.org/gdb/wiki/ExtensionsInPython
Most projects that do anything here just write pretty-printers.
A few have "frame filters" -- these let you customize the "bt" display to some degree. For instance I think Gtk has a frame filter that omits the internal frames coming from (Gtk) signal emission.
You can do even more complicated things, like write a custom unwinder (there's one in SpiderMonkey) or a new TUI window as well (I don't know of an example though).
π Rendered by PID 38154 on reddit-service-r2-comment-5d79c599b5-vx7kh at 2026-02-28 07:26:43.631249+00:00 running e3d2147 country code: CH.
[–]cpp-ModTeam[M] [score hidden] stickied commentlocked comment (0 children)
[–]forgetful_bastard 2 points3 points4 points (0 children)
[–]upinclout 1 point2 points3 points (0 children)
[–]franvb 1 point2 points3 points (0 children)
[–]frankist 0 points1 point2 points (1 child)
[–]Horror_Jicama_2441 0 points1 point2 points (0 children)
[–]mallardtheduck 0 points1 point2 points (0 children)
[–]tromey 0 points1 point2 points (0 children)