gdb: change inferior::tdesc_info to non-pointer

I initially made this field a unique pointer, to have automatic memory
management.  But I then thought that the field didn't really need to be
allocated separately from struct inferior.  So make it a regular
non-pointer field of inferior.

Remove target_desc_info_free, as it's no longer needed.

Change-Id: Ica2b97071226f31c40e86222a2f6922454df1229
This commit is contained in:
Simon Marchi
2023-02-03 09:21:23 -05:00
committed by Simon Marchi
parent 650160322c
commit 79846903c6
4 changed files with 4 additions and 23 deletions

View File

@ -436,16 +436,12 @@ struct tdesc_arch_data
gdbarch_register_reggroup_p_ftype *pseudo_register_reggroup_p = NULL;
};
/* Get the inferior INF's target description info, allocating one on
the stop if necessary. */
/* Get the inferior INF's target description info. */
static struct target_desc_info *
get_tdesc_info (struct inferior *inf)
{
if (inf->tdesc_info == NULL)
inf->tdesc_info = new target_desc_info;
return inf->tdesc_info;
return &inf->tdesc_info;
}
/* A handle for architecture-specific data associated with the
@ -482,14 +478,6 @@ copy_inferior_target_desc_info (struct inferior *destinf, struct inferior *srcin
*dest = *src;
}
/* See target-descriptions.h. */
void
target_desc_info_free (struct target_desc_info *tdesc_info)
{
delete tdesc_info;
}
/* The string manipulated by the "set tdesc filename ..." command. */
static std::string tdesc_filename_cmd_string;