#ifndef IN_PROCESS_AGENT
-target_desc::~target_desc ()
-{
- xfree ((char *) arch);
- xfree ((char *) osabi);
-}
-
bool target_desc::operator== (const target_desc &other) const
{
if (reg_defs != other.reg_defs)
const char *
tdesc_architecture_name (const struct target_desc *target_desc)
{
- return target_desc->arch;
+ return target_desc->arch.get ();
}
/* See gdbsupport/tdesc.h. */
set_tdesc_architecture (struct target_desc *target_desc,
const char *name)
{
- target_desc->arch = xstrdup (name);
+ target_desc->arch = make_unique_xstrdup (name);
}
/* See gdbsupport/tdesc.h. */
const char *
tdesc_osabi_name (const struct target_desc *target_desc)
{
- return target_desc->osabi;
+ return target_desc->osabi.get ();
}
/* See gdbsupport/tdesc.h. */
void
set_tdesc_osabi (struct target_desc *target_desc, const char *name)
{
- target_desc->osabi = xstrdup (name);
+ target_desc->osabi = make_unique_xstrdup (name);
}
/* See gdbsupport/tdesc.h. */
/* Either .xmltarget or .features is not NULL. */
gdb_assert (tdesc->xmltarget != NULL
|| (!tdesc->features.empty ()
- && tdesc->arch != NULL));
+ && tdesc_architecture_name (tdesc) != nullptr));
if (tdesc->xmltarget == NULL)
{
mutable const char *xmltarget = NULL;
/* The value of <architecture> element in the XML, replying GDB. */
- const char *arch = NULL;
+ gdb::unique_xmalloc_ptr<char> arch;
/* The value of <osabi> element in the XML, replying GDB. */
- const char *osabi = NULL;
+ gdb::unique_xmalloc_ptr<char> osabi;
public:
target_desc ()
: registers_size (0)
{}
- ~target_desc ();
-
bool operator== (const target_desc &other) const;
bool operator!= (const target_desc &other) const