aboutsummaryrefslogtreecommitdiff
path: root/gdb/dwarf2read.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/dwarf2read.c')
-rw-r--r--gdb/dwarf2read.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index 071f97b..a283cba 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -12306,7 +12306,7 @@ check_producer (struct dwarf2_cu *cu)
cu->producer_is_gxx_lt_4_6 = major < 4 || (major == 4 && minor < 6);
cu->producer_is_gcc_lt_4_3 = major < 4 || (major == 4 && minor < 3);
}
- else if (strncmp (cu->producer, "Intel(R) C", strlen ("Intel(R) C")) == 0)
+ else if (startswith (cu->producer, "Intel(R) C"))
cu->producer_is_icc = 1;
else
{
@@ -12987,8 +12987,8 @@ is_vtable_name (const char *name, struct dwarf2_cu *cu)
/* Look for the C++ and Java forms of the vtable. */
if ((cu->language == language_java
- && strncmp (name, vtable, sizeof (vtable) - 1) == 0)
- || (strncmp (name, vptr, sizeof (vptr) - 1) == 0
+ && startswith (name, vtable))
+ || (startswith (name, vptr)
&& is_cplus_marker (name[sizeof (vptr) - 1])))
return 1;
@@ -13296,8 +13296,7 @@ process_structure_scope (struct die_info *die, struct dwarf2_cu *cu)
}
}
else if (cu->producer
- && strncmp (cu->producer,
- "IBM(R) XL C/C++ Advanced Edition", 32) == 0)
+ && startswith (cu->producer, "IBM(R) XL C/C++ Advanced Edition"))
{
/* The IBM XLC compiler does not provide direct indication
of the containing type, but the vtable pointer is
@@ -14695,7 +14694,7 @@ read_base_type (struct die_info *die, struct dwarf2_cu *cu)
type_flags |= TYPE_FLAG_UNSIGNED;
if (cu->language == language_fortran
&& name
- && strncmp (name, "character(", sizeof ("character(") - 1) == 0)
+ && startswith (name, "character("))
code = TYPE_CODE_CHAR;
break;
case DW_ATE_signed_char:
@@ -18262,7 +18261,7 @@ new_symbol_full (struct die_info *die, struct type *type, struct dwarf2_cu *cu,
if (cu->language == language_fortran && die->parent
&& die->parent->tag == DW_TAG_module
&& cu->producer
- && strncmp (cu->producer, "GNU Fortran ", 12) == 0)
+ && startswith (cu->producer, "GNU Fortran "))
SYMBOL_ACLASS_INDEX (sym) = LOC_UNRESOLVED;
/* A variable with DW_AT_external is never static,
@@ -19339,8 +19338,8 @@ dwarf2_name (struct die_info *die, struct dwarf2_cu *cu)
or simply "<anonymous struct>" or "<anonymous union>" in GCC 4.3
and GCC 4.4. We work around this problem by ignoring these. */
if (attr && DW_STRING (attr)
- && (strncmp (DW_STRING (attr), "._", 2) == 0
- || strncmp (DW_STRING (attr), "<anonymous", 10) == 0))
+ && (startswith (DW_STRING (attr), "._")
+ || startswith (DW_STRING (attr), "<anonymous")))
return NULL;
/* GCC might emit a nameless typedef that has a linkage name. See