61 for (s = p; *s !=
'\0'; ++s)
66 return last != NULL ? last : p;
72check (
const char *
name,
int index,
const struct info *all,
int want_lineno,
73 const char *want_function,
const char *want_file,
int *
failed)
77 if (all[index].filename == NULL || all[index].
function == NULL)
79 fprintf (stderr,
"%s: [%d]: missing file name or function name\n",
84 if (strcmp (
base (all[index].filename), want_file) != 0)
86 fprintf (stderr,
"%s: [%d]: got %s expected %s\n",
name, index,
87 all[index].filename, want_file);
90 if (all[index].lineno != want_lineno)
92 fprintf (stderr,
"%s: [%d]: got %d expected %d\n",
name, index,
93 all[index].lineno, want_lineno);
96 if (strcmp (all[index].
function, want_function) != 0)
98 fprintf (stderr,
"%s: [%d]: got %s expected %s\n",
name, index,
108 const char *filename,
int lineno,
const char *
function)
115 fprintf (stderr,
"callback_one: callback called too many times\n");
148 fprintf (stderr,
"%s",
msg);
150 fprintf (stderr,
": %s", strerror (errnum));
151 fprintf (stderr,
"\n");
164 fprintf (stderr,
"callback_two: callback called too many times\n");
182 fprintf (stderr,
"%s",
msg);
184 fprintf (stderr,
": %s", strerror (errnum));
185 fprintf (stderr,
"\n");
193 const char *symname, uintptr_t symval,
202 data->name = strdup (symname);
203 assert (
data->name != NULL);
206 data->size = symsize;
216 fprintf (stderr,
"%s",
msg);
218 fprintf (stderr,
": %s", strerror (errnum));
219 fprintf (stderr,
"\n");
229 fprintf (stderr,
"%s",
msg);
231 fprintf (stderr,
": %s", strerror (errnum));
232 fprintf (stderr,
"\n");
#define IS_DIR_SEPARATOR(c)
void callback_three(void *vdata, uintptr_t pc ATTRIBUTE_UNUSED, const char *symname, uintptr_t symval, uintptr_t symsize)
void check(const char *name, int index, const struct info *all, int want_lineno, const char *want_function, const char *want_file, int *failed)
void error_callback_three(void *vdata, const char *msg, int errnum)
int callback_two(void *vdata, uintptr_t pc)
void error_callback_create(void *data ATTRIBUTE_UNUSED, const char *msg, int errnum)
int callback_one(void *vdata, uintptr_t pc ATTRIBUTE_UNUSED, const char *filename, int lineno, const char *function)
void error_callback_one(void *vdata, const char *msg, int errnum)
const char * base(const char *p)
void error_callback_two(void *vdata, const char *msg, int errnum)
Functions to help with cleanup.