aboutsummaryrefslogtreecommitdiff
path: root/gdb/breakpoint.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2023-09-21 13:31:14 -0600
committerTom Tromey <tromey@adacore.com>2023-09-26 06:56:27 -0600
commit0128542673364609a0b2e1d8a3f1896fc89584d2 (patch)
tree7fc0d5156d268d72c27fcc548fad9fded59def6c /gdb/breakpoint.c
parent5437a944648eef989f8ecde29787d7924b80fdc0 (diff)
downloadfsf-binutils-gdb-0128542673364609a0b2e1d8a3f1896fc89584d2.zip
fsf-binutils-gdb-0128542673364609a0b2e1d8a3f1896fc89584d2.tar.gz
fsf-binutils-gdb-0128542673364609a0b2e1d8a3f1896fc89584d2.tar.bz2
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>
Diffstat (limited to 'gdb/breakpoint.c')
-rw-r--r--gdb/breakpoint.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index d807ae3..f9b20a7 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -7581,7 +7581,7 @@ bp_location::to_string () const
string_file stb;
ui_out_redirect_pop redir (current_uiout, &stb);
print_breakpoint_location (this->owner, this);
- return stb.string ();
+ return stb.release ();
}
/* Decrement reference count. If the reference count reaches 0,