From 210477268d4ac5cad937e811888a5c932206794c Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Mon, 27 Mar 2017 12:28:03 +0100 Subject: Fix gdb_xml_debug/gdb_xml_error ATTRIBUTE_PRINTF use The declarations of gdb_xml_debug and gdb_xml_error are passing "0" as "first-to-check" argument to ATTRIBUTE_PRINTF, as if they were va_args functions. Consequently, the arguments to gdb_xml_debug / gdb_xml_error aren't being checked against the format strings. With that fixed, a couple obvious bugs are exposed, both fixed by this commit. gdb/ChangeLog: 2017-03-27 Pedro Alves * xml-support.h (gdb_xml_debug): Pass a "first-to-check" argument to ATTRIBUTE_PRINTF. * solib-target.c (library_list_start_list): Print "string" not "version". * xml-tdesc.c (tdesc_start_field): Pass "field_name" to gdb_xml_error call. --- gdb/xml-tdesc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gdb/xml-tdesc.c') diff --git a/gdb/xml-tdesc.c b/gdb/xml-tdesc.c index effe652..d24c5ad 100644 --- a/gdb/xml-tdesc.c +++ b/gdb/xml-tdesc.c @@ -413,8 +413,8 @@ tdesc_start_field (struct gdb_xml_parser *parser, gdb_xml_error (parser, _("Bitfield \"%s\" has start after end"), field_name); if (end >= data->current_type_size * TARGET_CHAR_BIT) - gdb_xml_error (parser, - _("Bitfield \"%s\" does not fit in struct")); + gdb_xml_error (parser, _("Bitfield \"%s\" does not fit in struct"), + field_name); if (field_type != NULL) tdesc_add_typed_bitfield (t, field_name, start, end, field_type); -- cgit v1.1