=gdb_index,=trace_info,=trace_abbrev,=trace_aranges,\n\
=addr,=cu_index,=links,=follow-links]\n\
Display DWARF info in the file\n\
+"));
+#ifdef ENABLE_LIBCTF
+ fprintf (stream, _("\
--ctf=SECTION Display CTF info from SECTION\n\
+"));
+#endif
+ fprintf (stream, _("\
-t, --syms Display the contents of the symbol table(s)\n\
-T, --dynamic-syms Display the contents of the dynamic symbol table\n\
-r, --reloc Display the relocation entries in the file\n\
--dwarf-depth=N Do not display DIEs at depth N or greater\n\
--dwarf-start=N Display DIEs starting with N, at the same depth\n\
or deeper\n\
- --dwarf-check Make additional dwarf internal consistency checks.\
- \n\
- --ctf-parent=SECTION Use SECTION as the CTF parent\n\
+ --dwarf-check Make additional dwarf internal consistency checks.\n"));
+#ifdef ENABLE_LIBCTF
+ fprintf (stream, _("\
+ --ctf-parent=SECTION Use SECTION as the CTF parent\n"));
+#endif
+ fprintf (stream, _("\
--visualize-jumps Visualize jumps by drawing ASCII art lines\n\
--visualize-jumps=color Use colors in the ASCII art\n\
--visualize-jumps=extended-color Use extended 8-bit color codes\n\
OPTION_NO_RECURSE_LIMIT,
OPTION_INLINES,
OPTION_SOURCE_COMMENT,
+#ifdef ENABLE_LIBCTF
OPTION_CTF,
OPTION_CTF_PARENT,
+#endif
OPTION_VISUALIZE_JUMPS
};
{"special-syms", no_argument, &dump_special_syms, 1},
{"include", required_argument, NULL, 'I'},
{"dwarf", optional_argument, NULL, OPTION_DWARF},
+#ifdef ENABLE_LIBCTF
{"ctf", required_argument, NULL, OPTION_CTF},
{"ctf-parent", required_argument, NULL, OPTION_CTF_PARENT},
+#endif
{"stabs", no_argument, NULL, 'G'},
{"start-address", required_argument, NULL, OPTION_START_ADDRESS},
{"stop-address", required_argument, NULL, OPTION_STOP_ADDRESS},
if (q->addend)
{
- bfd_signed_vma addend = q->addend;
- if (addend < 0)
+ bfd_vma addend = q->addend;
+ if ((bfd_signed_vma) addend < 0)
{
printf ("-0x");
addend = -addend;
}
\f
+#ifdef ENABLE_LIBCTF
/* Formatting callback function passed to ctf_dump. Returns either the pointer
it is passed, or a pointer to newly-allocated storage, in which case
dump_ctf() will free it when it no longer needs it. */
return ctfsect;
}
+/* Dump CTF errors/warnings. */
+static void
+dump_ctf_errs (ctf_file_t *fp)
+{
+ ctf_next_t *it = NULL;
+ char *errtext;
+ int is_warning;
+ int err;
+
+ /* Dump accumulated errors and warnings. */
+ while ((errtext = ctf_errwarning_next (fp, &it, &is_warning, &err)) != NULL)
+ {
+ non_fatal (_("%s: %s"), is_warning ? _("warning"): _("error"),
+ errtext);
+ free (errtext);
+ }
+ if (err != ECTF_NEXT_END)
+ {
+ non_fatal (_("CTF error: cannot get CTF errors: `%s'"),
+ ctf_errmsg (err));
+ }
+}
+
/* Dump one CTF archive member. */
static int
if (ctf_errno (ctf))
{
- non_fatal (_("Iteration failed: %s, %s\n"), *thing,
+ non_fatal (_("Iteration failed: %s, %s"), *thing,
ctf_errmsg (ctf_errno (ctf)));
break;
}
}
+
+ dump_ctf_errs (ctf);
+
return 0;
}
ctfsect = make_ctfsect (sect_name, ctfdata, ctfsize);
if ((ctfa = ctf_bfdopen_ctfsect (abfd, &ctfsect, &err)) == NULL)
{
- non_fatal (_("CTF open failure: %s\n"), ctf_errmsg (err));
+ dump_ctf_errs (NULL);
+ non_fatal (_("CTF open failure: %s"), ctf_errmsg (err));
bfd_fatal (bfd_get_filename (abfd));
}
ctfsect = make_ctfsect (parent_name, parentdata, parentsize);
if ((parenta = ctf_bfdopen_ctfsect (abfd, &ctfsect, &err)) == NULL)
{
- non_fatal (_("CTF open failure: %s\n"), ctf_errmsg (err));
+ dump_ctf_errs (NULL);
+ non_fatal (_("CTF open failure: %s"), ctf_errmsg (err));
bfd_fatal (bfd_get_filename (abfd));
}
put CTFs and their parents in archives together.) */
if ((parent = ctf_arc_open_by_name (lookparent, NULL, &err)) == NULL)
{
- non_fatal (_("CTF open failure: %s\n"), ctf_errmsg (err));
+ dump_ctf_errs (NULL);
+ non_fatal (_("CTF open failure: %s"), ctf_errmsg (err));
bfd_fatal (bfd_get_filename (abfd));
}
free (parentdata);
free (ctfdata);
}
+#else
+static void
+dump_ctf (bfd *abfd ATTRIBUTE_UNUSED, const char *sect_name ATTRIBUTE_UNUSED,
+ const char *parent_name ATTRIBUTE_UNUSED) {}
+#endif
\f
static void
int count;
int width;
- if ((section->flags & SEC_HAS_CONTENTS) == 0)
+ if (! process_section_p (section))
return;
- if (! process_section_p (section))
+ if ((section->flags & SEC_HAS_CONTENTS) == 0)
return;
if ((datasize = bfd_section_size (section)) == 0)
case OPTION_DWARF_CHECK:
dwarf_check = TRUE;
break;
+#ifdef ENABLE_LIBCTF
case OPTION_CTF:
dump_ctf_section_info = TRUE;
dump_ctf_section_name = xstrdup (optarg);
case OPTION_CTF_PARENT:
dump_ctf_parent_name = xstrdup (optarg);
break;
+#endif
case 'G':
dump_stab_section_info = TRUE;
seenflag = TRUE;