Page MenuHomeFreeBSD

D62242.1796262678.diff
No OneTemporary

Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None

D62242.1796262678.diff

diff --git a/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c b/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c
--- a/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c
+++ b/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c
@@ -1954,9 +1954,26 @@
else
terminate("rc = %d %s\n", rc, dwarf_errmsg(dw.dw_err));
}
- if ((cu = die_sibling(&dw, NULL)) == NULL ||
- (((child = die_child(&dw, cu)) == NULL) &&
- should_have_dwarf(elf))) {
+ if ((cu = die_sibling(&dw, NULL)) == NULL)
+ terminate("file does not contain dwarf type data "
+ "(try compiling with -g)\n");
+
+ /*
+ * Assembly source has no type information to convert. Some
+ * assemblers describe functions anyway: the GNU assembler emits a
+ * DW_TAG_subprogram of DW_TAG_unspecified_type for each function that
+ * has a size, and none for those without, which would otherwise make
+ * a compile unit with function symbols but no DIEs fatal.
+ */
+ rc = dwarf_attrval_unsigned(cu, DW_AT_language, &lang, &dw.dw_err);
+ if (rc == DW_DLV_OK && lang == DW_LANG_Mips_Assembler) {
+ debug(1, "Ignoring DWARF from assembly source\n");
+ (void) dwarf_finish(dw.dw_dw, &dw.dw_err);
+ return (0);
+ }
+
+ if ((child = die_child(&dw, cu)) == NULL &&
+ should_have_dwarf(elf)) {
terminate("file does not contain dwarf type data "
"(try compiling with -g)\n");
} else if (child == NULL) {
@@ -1989,7 +2006,6 @@
case DW_LANG_C_plus_plus_03:
case DW_LANG_C_plus_plus_11:
case DW_LANG_C_plus_plus_14:
- case DW_LANG_Mips_Assembler:
break;
default:
terminate("file contains DWARF for unsupported "

File Metadata

Mime Type
text/plain
Expires
Thu, Dec 3, 1:51 AM (1 h, 5 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
42132140
Default Alt Text
D62242.1796262678.diff (1 KB)

Event Timeline