case 'f':
if (! pst)
{
- int name_len = p - namestring;
- char *name = (char *) xmalloc (name_len + 1);
-
- memcpy (name, namestring, name_len);
- name[name_len] = '\0';
- function_outside_compilation_unit_complaint (name);
- xfree (name);
+ std::string name (namestring, (p - namestring));
+ function_outside_compilation_unit_complaint (name.c_str ());
}
/* Kludges for ELF/STABS with Sun ACC. */
last_function_name = namestring;
case 'F':
if (! pst)
{
- int name_len = p - namestring;
- char *name = (char *) xmalloc (name_len + 1);
-
- memcpy (name, namestring, name_len);
- name[name_len] = '\0';
- function_outside_compilation_unit_complaint (name);
- xfree (name);
+ std::string name (namestring, (p - namestring));
+ function_outside_compilation_unit_complaint (name.c_str ());
}
/* Kludges for ELF/STABS with Sun ACC. */
last_function_name = namestring;
case 'f':
if (! pst)
{
- int name_len = p - namestring;
- char *name = (char *) xmalloc (name_len + 1);
-
- memcpy (name, namestring, name_len);
- name[name_len] = '\0';
- function_outside_compilation_unit_complaint (name);
- xfree (name);
+ std::string name (namestring, (p - namestring));
+ function_outside_compilation_unit_complaint (name.c_str ());
}
pst->add_psymbol (gdb::string_view (namestring,
p - namestring),
case 'F':
if (! pst)
{
- int name_len = p - namestring;
- char *name = (char *) xmalloc (name_len + 1);
-
- memcpy (name, namestring, name_len);
- name[name_len] = '\0';
- function_outside_compilation_unit_complaint (name);
- xfree (name);
+ std::string name (namestring, (p - namestring));
+ function_outside_compilation_unit_complaint (name.c_str ());
}
/* We need only the minimal symbols for these