[GD-Linux] GDB 5.0...
Brought to you by:
vexxed72
From: Ryan C. G. <ic...@cl...> - 2002-01-10 01:59:17
|
...sucks. I've been plagued for a long time with three debugging problems: 1) When threads terminate, for example, when calling SDL_CloseAudio() (which is also called by SDL_Quit()), GDB reports that the "program terminated normally," and stops debugging, when in fact the remaining thread should have continued. Not sure what happened to that remaining thread, except that perhaps gdb killed it itself in a fit of confusion. This is mildly annoying during shutdown on Serious Sam, since there's more to clean up after the audio subsystem goes down, but it's downright infuriating when changing a cvar in-game that wants to restart the audio subsystem. 2) GDB lets you use TAB to auto-complete symbol names. Many people complained that the code for walking the symbol list in gdb 4.18 is too slow, and it is, if you work on something that has as many symbols as, say, Mozilla. The GDB maintainers rewrote it to be lightning fast in version 5.0, but be careful; some autocompletion efforts make gdb go into an infinite loop. It locks hard, and you have to hit CTRL-Z to suspend the process and then kill it with a -9. That's nasty. It happens to me way more than it should, and usually at a really critical point where you can't afford to kill the process and start over, too. 3) awatch doesn't work. I think I mentioned this before. This is a very helpful function if you are working in a big project and find yourself going "when does THAT variable get used". It's also very helpful if you know that a variable is getting hit by memory corruption, and you want to know exactly when it happens so you can fix it. Doesn't work at all. I have fixed all these problems today. On the advice of one of the XMMS developers, I downgraded. Take the stock gdb-4.18.tar.gz from GNU's website, and apply this patch (so that it supports Linux thread signals, etc): http://sources.redhat.com/ml/gdb-patches/1999-q3/msg00177.html And, poof! All three problems go away. Actually, the infinite loop during some symbol auto-completions is still there, but in 4.18 you can hit CTRL-C and it will give up, putting you back at the gdb command prompt where you can continue debugging or try the symbol lookup again. Best decision I've made all year (er...all nine days of it), and I would advise anyone working on Linux to do the same. I was using gdb 5.0, and was told that 5.1 has the same problems. I can't think of a single benefit in 5.0 that I've lost by downgrading. I'll have to check the changelog. --ryan. |