[pushed] Make target_options_to_string return an std::string
Commit Message
On 2018-08-08 11:11 AM, Tom Tromey wrote:
>>>>>> "Simon" == Simon Marchi <simon.marchi@polymtl.ca> writes:
>
> Simon> Return an std::string instead of a char *, saving some manual freeing.
> Simon> I only manually tested with "set debug target 1" and "set debug lin-lwp
> Simon> 1", since this only deals with debug output.
>
> Simon> -/* Concatenate ELEM to LIST, a comma separate list, and return the
> Simon> - result. The LIST incoming argument is released. */
> Simon> +/* Concatenate ELEM to LIST, a comma separate list. */
>
> I think this should read "comma-separated".
>
> Other than that nit, this looks good to me.
Good catch, here's what I pushed:
From fdbac7d8d1c9403a857db6e0c1dc92ce7bb65925 Mon Sep 17 00:00:00 2001
From: Simon Marchi <simon.marchi@ericsson.com>
Date: Wed, 8 Aug 2018 18:13:18 -0400
Subject: [PATCH] Fix some comments in target.c
Fix a typo and add a missing one.
gdb/ChangeLog:
* target.c (str_comma_list_concat_elem): Fix typo in comment.
(target_options_to_string): Add comment.
---
gdb/ChangeLog | 5 +++++
gdb/target.c | 4 +++-
2 files changed, 8 insertions(+), 1 deletion(-)
@@ -1,3 +1,8 @@
+2018-08-08 Simon Marchi <simon.marchi@ericsson.com>
+
+ * target.c (str_comma_list_concat_elem): Fix typo in comment.
+ (target_options_to_string): Add comment.
+
2018-08-08 Tom Tromey <tom@tromey.com>
* unittests/scoped_mmap-selftests.c: Check result of "write".
@@ -3447,7 +3447,7 @@ target_continue (ptid_t ptid, enum gdb_signal signal)
target_resume (ptid, 0, signal);
}
-/* Concatenate ELEM to LIST, a comma separate list. */
+/* Concatenate ELEM to LIST, a comma-separated list. */
static void
str_comma_list_concat_elem (std::string *list, const char *elem)
@@ -3473,6 +3473,8 @@ do_option (int *target_options, std::string *ret,
}
}
+/* See target.h. */
+
std::string
target_options_to_string (int target_options)
{