[PDWTAGS]: Use libdwfl

Signed-off-by: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
This commit is contained in:
Arnaldo Carvalho de Melo 2007-03-30 13:54:59 -03:00
parent df2a515d4f
commit 712c9f76d8
1 changed files with 5 additions and 20 deletions

View File

@ -49,36 +49,21 @@ static void cus__emit_tags(struct cus *self)
cus__for_each_cu(self, cu__emit_tags, NULL, NULL);
}
static void usage(void)
{
printf("usage: pdwtags <filename>\n");
}
int main(int argc, char *argv[])
{
int err;
struct cus *cus;
char *filename = argv[1];
int err, remaining;
struct cus *cus = cus__new(NULL, NULL);
if (argc != 2) {
usage();
return EXIT_FAILURE;
}
dwarves__init(0);
cus = cus__new(NULL, NULL);
if (cus == NULL) {
fputs("pwdtags: insufficient memory\n", stderr);
return EXIT_FAILURE;
}
err = cus__load(cus, filename);
if (err != 0) {
cus__print_error_msg("pdwtags", filename, err);
err = cus__loadfl(cus, NULL, argc, argv, &remaining);
if (err != 0)
return EXIT_FAILURE;
}
dwarves__init(0);
cus__emit_tags(cus);
return EXIT_SUCCESS;
}