[gdb/testsuite] Handle debuginfod output in gdb.debuginfod/solib-with-dwz.exp

I ran into a timeout in test-case gdb.debuginfod/solib-with-dwz.exp.

GDB times out like this:
...
Download failed: Timer expired. \
  Continuing without source file solib-with-dwz-bar.c.
...

My theory is that the download fails because debuginfod becomes unresponsive,
because it's stuck trying to write output into some buffer that is already
full.

Fix this by regularly draining debuginfod output in the test-case, using a new
proc drain_debuginfod.

Debuginfod is run with "-vvvv", which makes it rather verbose, and dropping
that also fixes the timeouts, but it might be useful for debugging, so I went
with the output draining method, and left the "-vvvv" as is.

Reviewed-By: Keith Seitz <keiths@redhat.com>

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=33901
2 files changed