/* One item to be dumped, in string form. */
typedef struct ctf_dump_item
/* One item to be dumped, in string form. */
typedef struct ctf_dump_item
ctf_dump_state_t *state = arg;
if (asprintf (&str, "%s -> ", name) < 0)
ctf_dump_state_t *state = arg;
if (asprintf (&str, "%s -> ", name) < 0)
}
else
{
if (asprintf (&str, "%s (%lx) -> ", sym_name, (unsigned long) i) < 0)
}
else
{
if (asprintf (&str, "%s (%lx) -> ", sym_name, (unsigned long) i) < 0)
if (asprintf (&bit, "%s (0x%lx) ", sym_name, (unsigned long) i) < 0)
goto oom;
}
if (asprintf (&bit, "%s (0x%lx) ", sym_name, (unsigned long) i) < 0)
goto oom;
}
- str = ctf_str_append (str, bit);
- str = ctf_str_append (str, " (");
+ str = str_append (str, bit);
+ str = str_append (str, " (");
free (bit);
/* Function arguments. */
if (ctf_func_args (state->cds_fp, i, fi.ctc_argc, args) < 0)
free (bit);
/* Function arguments. */
if (ctf_func_args (state->cds_fp, i, fi.ctc_argc, args) < 0)
for (j = 0; j < fi.ctc_argc; j++)
{
if ((bit = ctf_type_aname (state->cds_fp, args[j])) == NULL)
for (j = 0; j < fi.ctc_argc; j++)
{
if ((bit = ctf_type_aname (state->cds_fp, args[j])) == NULL)
- str = ctf_str_append (str, "...");
- str = ctf_str_append (str, ")");
+ str = str_append (str, "...");
+ str = str_append (str, ")");
+ ctf_dprintf ("Cannot %s dumping function type for symbol 0x%li: %s\n",
+ err, (unsigned long) i,
+ ctf_errmsg (ctf_errno (state->cds_fp)));
ctf_dump_state_t *state = arg;
if (asprintf (&str, "%s -> ", name) < 0)
ctf_dump_state_t *state = arg;
if (asprintf (&str, "%s -> ", name) < 0)
+ {
+ if (id == 0 || ctf_errno (state->cdm_fp) == ECTF_NONREPRESENTABLE)
+ {
+ if (asprintf (&bit, " [0x%lx] (type not represented in CTF)",
+ offset) < 0)
+ goto oom;
+
+ *state->cdm_str = str_append (*state->cdm_str, bit);
+ free (typestr);
+ free (bit);
+ return 0;
+ }
+
+ goto oom;
+ }
if (asprintf (&bit, " [0x%lx] (ID 0x%lx) (kind %i) %s %s (aligned at 0x%lx",
offset, id, ctf_type_kind (state->cdm_fp, id), typestr, name,
(unsigned long) ctf_type_align (state->cdm_fp, id)) < 0)
goto oom;
if (asprintf (&bit, " [0x%lx] (ID 0x%lx) (kind %i) %s %s (aligned at 0x%lx",
offset, id, ctf_type_kind (state->cdm_fp, id), typestr, name,
(unsigned long) ctf_type_align (state->cdm_fp, id)) < 0)
goto oom;
if (asprintf (&bit, ", format 0x%x, offset:bits 0x%x:0x%x", ep.cte_format,
ep.cte_offset, ep.cte_bits) < 0)
goto oom;
if (asprintf (&bit, ", format 0x%x, offset:bits 0x%x:0x%x", ep.cte_format,
ep.cte_offset, ep.cte_bits) < 0)
goto oom;
ctf_dump_state_t *state = arg;
ctf_dump_membstate_t membstate = { &str, state->cds_fp };
size_t len;
if ((str = ctf_dump_format_type (state->cds_fp, id, flag)) == NULL)
ctf_dump_state_t *state = arg;
ctf_dump_membstate_t membstate = { &str, state->cds_fp };
size_t len;
if ((str = ctf_dump_format_type (state->cds_fp, id, flag)) == NULL)
if ((ctf_type_visit (state->cds_fp, id, ctf_dump_member, &membstate)) < 0)
if ((ctf_type_visit (state->cds_fp, id, ctf_dump_member, &membstate)) < 0)
if (asprintf (&str, "%lx: %s",
(unsigned long) (s - fp->ctf_str[CTF_STRTAB_0].cts_strs),
s) < 0)
if (asprintf (&str, "%lx: %s",
(unsigned long) (s - fp->ctf_str[CTF_STRTAB_0].cts_strs),
s) < 0)
by bit. The first call will take (much) longer than otherwise, but the
amortized time needed is the same. */
by bit. The first call will take (much) longer than otherwise, but the
amortized time needed is the same. */
- str = ctf_str_append (str, ret);
- str = ctf_str_append (str, "\n");
+ str = str_append (str, ret);
+ str = str_append (str, "\n");