News for hackers. Stuff that matters.
Re:The State of Linux Debuggers by simias on Sunday December 13, 2020 @11:17AM (#25407574)
GDB is incredibly powerful but it really lacks some good tutorial, and some of its defaults are... questionable.

It's so heavily scriptable and configurable that you could argue that it's almost more of a debugger framework than just a debugger. I would argue that it's almost under-used really, simply because most devs don't realize what it can do besides setting a breakpoint and dumping a backtrace.

Re:The State of Linux Debuggers by enriquto on Sunday December 13, 2020 @03:10PM (#25409750)
A cool thing that you can do with gdb is to change the values of variables in programs that are already running, or calling their functions. For example you can update a variable on your parent shell, e.g., "export" the variable $X to your parent (!) :

    gdb --batch-silent -ex "attach $PPID" -ex "call (int)bind_variable(\"X\",\"$X\",0)"
I confess that I use this trick in my shell scripts more than strictly necessary, just for fun.
Re:The State of Linux Debuggers by mehrdadn on Sunday December 13, 2020 @06:59PM (#25411779)
That sounds both useful and horrifying. Do you use this for CI scripts? That's where I've needed this kind of functionality.
Re:The State of Linux Debuggers by enriquto on Monday December 14, 2020 @05:28AM (#25415432)
Never (yet) in production. I just use it for personal silly scripts, like changing the background color of my running xterms, and things like that.
Re:The State of Linux Debuggers by Blikkentrekker on Sunday December 13, 2020 @01:57PM (#25409056)
Guilty as charged — I have never used GDB for anything but that, and I have never used awk for any other function than to select columns.