2018-10-04 Tom Tromey <tom@tromey.com>
+ * mdebugread.c (parse_partial_symbols): Use std::string.
+
+2018-10-04 Tom Tromey <tom@tromey.com>
+
* ctf.c (SET_ARRAY_FIELD): Rename "u32".
* p-valprint.c (pascal_val_print): Split inner "i" variable.
* xtensa-tdep.c (xtensa_push_dummy_call): Declare "i" in loop
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 copy (namestring, p);
+ function_outside_compilation_unit_complaint
+ (copy.c_str ());
}
add_psymbol_to_list (namestring, p - namestring, 1,
VAR_DOMAIN, LOC_BLOCK,
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 copy (namestring, p);
+ function_outside_compilation_unit_complaint
+ (copy.c_str ());
}
add_psymbol_to_list (namestring, p - namestring, 1,
VAR_DOMAIN, LOC_BLOCK,