[DWARVES]: Check if any cu was found

Reported-by: Diego 'Flameeyes' Pettenò <flameeyes@gmail.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
Arnaldo Carvalho de Melo 2008-05-12 15:25:45 -03:00
parent f71ee6d306
commit 5488b1dbde
4 changed files with 9 additions and 9 deletions

View File

@ -696,7 +696,7 @@ failure:
dwfl_argv[2] = old_filename;
err = cus__loadfl(old_cus, NULL, 3, dwfl_argv);
if (err != 0) {
cus__print_error_msg("codiff", old_filename, err);
cus__print_error_msg("codiff", old_cus, old_filename, err);
return EXIT_FAILURE;
}
}
@ -711,7 +711,7 @@ failure:
dwfl_argv[2] = new_filename;
err = cus__loadfl(new_cus, NULL, 3, dwfl_argv);
if (err != 0) {
cus__print_error_msg("codiff", new_filename, err);
cus__print_error_msg("codiff", new_cus, new_filename, err);
return EXIT_FAILURE;
}
}

View File

@ -942,7 +942,7 @@ failure:
if (filename != NULL) {
err = cus__load(methods_cus, filename);
if (err != 0) {
cus__print_error_msg("ctracer", filename, err);
cus__print_error_msg("ctracer", methods_cus, filename, err);
return EXIT_FAILURE;
}
}

View File

@ -2582,11 +2582,11 @@ int cus__loadfl(struct cus *self, struct argp *argp, int argc, char *argv[])
return err;
}
void cus__print_error_msg(const char *progname, const char *filename,
const int err)
void cus__print_error_msg(const char *progname, const struct cus *cus,
const char *filename, const int err)
{
if (err == -EINVAL)
fprintf(stderr, "%s: couldn't load DWARF info from %s\n",
if (err == -EINVAL || (cus != NULL && list_empty(&cus->cus)))
fprintf(stderr, "%s: couldn't load debugging info from %s\n",
progname, filename);
else
fprintf(stderr, "%s: %s\n", progname, strerror(err));

View File

@ -509,8 +509,8 @@ extern int cus__load(struct cus *self, const char *filename);
extern int cus__load_dir(struct cus *self, const char *dirname,
const char *filename_mask, const int recursive);
void cus__add(struct cus *self, struct cu *cu);
extern void cus__print_error_msg(const char *progname, const char *filename,
const int err);
extern void cus__print_error_msg(const char *progname, const struct cus *cus,
const char *filename, const int err);
extern struct cu *cus__find_cu_by_name(const struct cus *self,
const char *name);
extern struct tag *cu__find_base_type_by_name(const struct cu *self,