gdb/testsuite: add a debuginfod-support.exp helper library
authorAndrew Burgess <aburgess@redhat.com>
Wed, 7 Sep 2022 11:34:00 +0000 (12:34 +0100)
committerAndrew Burgess <aburgess@redhat.com>
Tue, 20 Sep 2022 13:58:34 +0000 (14:58 +0100)
commit430676bc51fb5278e89fd9ef84ac9e7ab71f46c5
tree3a2dd631eaed41b2da5bccfc6cde978d09ad2867
parent13d4a5f7b6c37607106cca0833e03075983bcc3b
gdb/testsuite: add a debuginfod-support.exp helper library

We currently have a single test for GDB's debuginfod support, this is
gdb.debuginfod/fetch_src_and_symbols.exp, this script does all the
setup, starts debuginfod, and then does the testing.

This commit tries to split the existing script in two, there is a new
library lib/debuginfod-support.exp, which contains a helper functions
related to running debuginfod tests.  All the code in the new library
is basically copied from the existing test case (which is why I
retained the copyright date range on the new library), with some minor
adjustments to try and make the code a little more generic.

One change I made, for example, is the library offers functions to
shut down debuginfod, previously we just relied on expect shutting
down debuginfod when dejagnu completed.

The existing test script is updated to make use of the new library
code, and this test is still passing for me.  The only change in the
test results is a single test where I changed the name to remove the
port number from the test name - the port number can change from run
to run, so could make it hard to compare test results.

I have also done a little light house keeping on the original test
script, updating and adding new comments, and making use of
proc_with_prefix in a couple of places.
gdb/testsuite/gdb.debuginfod/fetch_src_and_symbols.exp
gdb/testsuite/lib/debuginfod-support.exp [new file with mode: 0644]