return target_read_alloc_1 (ops, object, annex, buf_p, 0);
}
-/* Read OBJECT/ANNEX using OPS. The result is NUL-terminated and
- returned as a string, allocated using xmalloc. If an error occurs
- or the transfer is unsupported, NULL is returned. Empty objects
- are returned as allocated but empty strings. A warning is issued
- if the result contains any embedded NUL bytes. */
+/* See target.h. */
-char *
+gdb::unique_xmalloc_ptr<char>
target_read_stralloc (struct target_ops *ops, enum target_object object,
const char *annex)
{
return NULL;
if (transferred == 0)
- return xstrdup ("");
+ return gdb::unique_xmalloc_ptr<char> (xstrdup (""));
bufstr[transferred] = 0;
break;
}
- return bufstr;
+ return gdb::unique_xmalloc_ptr<char> (bufstr);
}
/* Memory transfer methods. */
return (*current_target.to_supports_multi_process) (¤t_target);
}
-char *
+/* See target.h. */
+
+gdb::unique_xmalloc_ptr<char>
target_get_osdata (const char *type)
{
struct target_ops *t;