2 SPDX-License-Identifier: GPL-2.0-only
4 Copyright (C) 2006 Mandriva Conectiva S.A.
5 Copyright (C) 2006 Arnaldo Carvalho de Melo <acme@mandriva.com>
14 static struct conf_fprintf conf
;
16 static struct conf_load conf_load
= {
17 .conf_fprintf
= &conf
,
20 static int class__tag_name(struct tag
*tag
, struct cu
*cu __maybe_unused
,
21 void *cookie __maybe_unused
)
23 puts(dwarf_tag_name(tag
->tag
));
27 static int cu__dump_class_tag_names(struct cu
*cu
, void *cookie __maybe_unused
)
29 cu__for_all_tags(cu
, class__tag_name
, NULL
);
33 static void cus__dump_class_tag_names(struct cus
*cus
)
35 cus__for_each_cu(cus
, cu__dump_class_tag_names
, NULL
, NULL
);
38 int main(int argc __maybe_unused
, char *argv
[])
40 int err
, rc
= EXIT_FAILURE
;
41 struct cus
*cus
= cus__new();
43 if (dwarves__init() || cus
== NULL
) {
44 fputs("dtagnames: insufficient memory\n", stderr
);
47 dwarves__resolve_cacheline_size(NULL
, 0);
49 err
= cus__load_files(cus
, &conf_load
, argv
+ 1);
51 cus__fprintf_load_files_err(cus
, "dtagnames", argv
+ 1, err
, stderr
);
55 cus__dump_class_tag_names(cus
);