Commit Message
The patch f2aec7f6d14 changed the return type of relocate_gdb_directory to
std::string, but the change is not reflected in find_charset_names function.
(Probably missed because the broken code is behind an #ifdef).
gdb/ChangeLog
* charset.c: Reflect API change.
---
gdb/charset.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
Comments
>>>>> Ali Tamur via gdb-patches <gdb-patches@sourceware.org> writes:
> The patch f2aec7f6d14 changed the return type of relocate_gdb_directory to
> std::string, but the change is not reflected in find_charset_names function.
> (Probably missed because the broken code is behind an #ifdef).
> gdb/ChangeLog
> * charset.c: Reflect API change.
Normally you'd mention the function here, like:
* charset.c (find_charset_names): ...
This patch is ok with this change.
Tom
On Mon, Oct 21, 2019 at 6:50 PM Ali Tamur via gdb-patches
<gdb-patches@sourceware.org> wrote:
>
> The patch f2aec7f6d14 changed the return type of relocate_gdb_directory to
> std::string, but the change is not reflected in find_charset_names function.
> (Probably missed because the broken code is behind an #ifdef).
Thanks for fixing my mistake here!
Christian
> gdb/ChangeLog
>
> * charset.c: Reflect API change.
> ---
> gdb/charset.c | 7 +++----
> 1 file changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/gdb/charset.c b/gdb/charset.c
> index 7568e47cf9..a93fe99c41 100644
> --- a/gdb/charset.c
> +++ b/gdb/charset.c
> @@ -816,10 +816,9 @@ find_charset_names (void)
>
> #ifdef ICONV_BIN
> {
> - char *iconv_dir = relocate_gdb_directory (ICONV_BIN,
> - ICONV_BIN_RELOCATABLE);
> - iconv_program = concat (iconv_dir, SLASH_STRING, "iconv", NULL);
> - xfree (iconv_dir);
> + std::string iconv_dir = relocate_gdb_directory (ICONV_BIN,
> + ICONV_BIN_RELOCATABLE);
> + iconv_program = concat (iconv_dir.c_str(), SLASH_STRING, "iconv", NULL);
> }
> #else
> iconv_program = xstrdup ("iconv");
> --
> 2.23.0.866.gb869b98d4c-goog
>
@@ -816,10 +816,9 @@ find_charset_names (void)
#ifdef ICONV_BIN
{
- char *iconv_dir = relocate_gdb_directory (ICONV_BIN,
- ICONV_BIN_RELOCATABLE);
- iconv_program = concat (iconv_dir, SLASH_STRING, "iconv", NULL);
- xfree (iconv_dir);
+ std::string iconv_dir = relocate_gdb_directory (ICONV_BIN,
+ ICONV_BIN_RELOCATABLE);
+ iconv_program = concat (iconv_dir.c_str(), SLASH_STRING, "iconv", NULL);
}
#else
iconv_program = xstrdup ("iconv");