]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit - gdb/ChangeLog
change and rename gmp_string_asprintf to return an std::string
authorJoel Brobecker <brobecker@adacore.com>
Tue, 24 Nov 2020 02:45:35 +0000 (21:45 -0500)
committerJoel Brobecker <brobecker@adacore.com>
Tue, 24 Nov 2020 02:45:35 +0000 (21:45 -0500)
commit987b670356322ba4d493f441855bf5dc8d946e9f
tree50b180ece0ac5d200979b6edefa31fff29cb8adb
parent4fbb7ccebe1fdcbae762e8fed6af7a810c81f85c
change and rename gmp_string_asprintf to return an std::string

This was suggested by Simon during a code review of this package upstream.
The upside is that this makes the function's API more natural and C++.
The downside is an extra malloc, which might be the reason why we went
for using a unique_xmalloc_ptr in the first place. Since this function
is not expected to be called frequently, the API improvement might be
worth the performance impact.

gdb/ChangeLog:

        * gmp-utils.h (gmp_string_printf): Rename from gmp_string_asprintf.
        Change return type to std::string. Update all callers.
        * gmp-utils.c (gmp_string_printf): Likewise.
gdb/ChangeLog
gdb/gdbtypes.c
gdb/gmp-utils.c
gdb/gmp-utils.h
gdb/typeprint.c
gdb/valprint.c