Sorry, I forgot to attach the patch. Andrew Stubbs wrote: > Andrew Stubbs wrote: >> I have discovered a problem in the GDB command line reading code. >> >> command_line_input() uses a static buffer to hold the current command. >> This means that it is not properly re-entrant - commands that contain >> other commands, such as user defined commands, are not handled safely. > > See http://sources.redhat.com/ml/gdb-patches/2006-03/msg00356.html > > The attached patch should fix the problem. > > I tried to fix the problem in command_line_input, but there were too > many ways for the string to leak, so I have opted for the simpler fix, > even though it feels like treating the symptoms, not the problem. > > Anyway, with this patch it no longer attempts to read data that has been > overwritten, so everything works fine. Valgrind reports no problems with > the test case I posted before. > > Andrew Stubbs >