Use string_file::release in some places
authorTom Tromey <tromey@adacore.com>
Thu, 21 Sep 2023 19:31:14 +0000 (13:31 -0600)
committerTom Tromey <tromey@adacore.com>
Tue, 26 Sep 2023 12:56:27 +0000 (06:56 -0600)
commit0128542673364609a0b2e1d8a3f1896fc89584d2
tree7fc0d5156d268d72c27fcc548fad9fded59def6c
parent5437a944648eef989f8ecde29787d7924b80fdc0
Use string_file::release in some places

I found a few spots like:

    string_file f;
    std::string x = f.string ();

However, string_file::string returns a 'const std::string &'...  so it
seems to me that this must be copying the string (? I find it hard to
reason about this in C++).

This patch changes these spots to use release() instead, which moves
the string.

Reviewed-by: Keith Seitz <keiths@redhat.com>
Reviewed-by: Lancelot Six <lancelot.six@amd.com>
gdb/breakpoint.c
gdb/top.c