24 #include <sys/types.h>
41 int main(
int argc,
char **argv) {
75 while ((ch = getopt(argc, argv,
"d::w::gDMl:F:TGSErI:i:RNq")) != -1) {
117 fprintf(stderr,
"ERROR: bad debug flag in '%s'!\n",
optarg);
132 opts_list = array_list_create(4);
134 array_list_append(opts_list,opts);
139 fprintf(stderr,
"ERROR: bad debugfile_load_opts '%s'!\n",optargc);
145 array_list_free(opts_list);
168 bfi =
calloc(1,
sizeof(*bfi));
170 bfi->
priv = bfelfi =
calloc(1,
sizeof(*bfelfi));
175 while ((mapi = strtok_r(!saveptr ?
optarg : NULL,
",",&saveptr))) {
176 if (sscanf(mapi,
"%u:%lx",&sec,&addr) == 2) {
180 (sec + 1)*
sizeof(
ADDR));
197 fprintf(stderr,
"ERROR: unknown option %c!\n",ch);
208 fprintf(stderr,
"ERROR: you must supply an ELF filename!\n");
223 fprintf(stderr,
"ERROR: could not create debugfile from %s!\n",
235 if (argc < 2 && !quiet)
236 debugfile_dump(debugfile,&ud,dotypes,doglobals,dosymtabs,doelfsymtab,
239 for (i = 1; i < argc; ++
i) {
240 ADDR addr = (
ADDR)strtoull(argv[i],&endptr,0);
243 if ((cptr = rindex(argv[i],
':'))) {
248 atoi(cptr),NULL,NULL);
249 else if (*cptr ==
'F' || *cptr ==
'f') {
255 "Could not create symbol rfilter from '%s'!\n",
266 "Did not find any symbols for rfilter '%s'!\n",
275 list2 = g_slist_next(list2);
278 rfilter_free(rfilter);
284 "Unknown suffix char '%c' in arg '%s', skipping!\n",
289 else if (endptr != argv[i]) {
298 fprintf(stderr,
"Could not lookup %s!\n",argv[i]);
301 fprintf(stdout,
"forward lookup %s: ",argv[i]);
303 fprintf(stdout,
"\n");
306 fprintf(stdout,
"first noninline parent %s: \n",argv[i]);
311 fprintf(stdout,
"\n");
314 fprintf(stdout,
"NO PARENT! (fake inline of itself?)\n");
324 fprintf(stdout,
"reverse lookup %s: ",argv[i]);
332 fprintf(stdout,
"\n");
350 array_list_free(opts_list);
struct debugfile * debugfile_from_file(char *filename, char *root_prefix, struct array_list *debugfile_load_opts_list)
struct binfile_instance * binfile_infer_instance(char *filename, char *root_prefix, ADDR base, GHashTable *config)
REFCNT lsymbol_release(struct lsymbol *lsymbol)
struct lsymbol * lsymbol_create_from_symbol(struct symbol *symbol)
struct symbol * lsymbol_get_noninline_parent_symbol(struct lsymbol *lsymbol)
static uint64_t unsigned int i
void vmi_inc_log_level(void)
int vmi_add_log_area_flaglist(char *flaglist, char *separator)
int symbol_is_inlineinstance(struct symbol *symbol)
#define verror(format,...)
struct lsymbol * debugfile_lookup_addr(struct debugfile *debugfile, ADDR addr)
void vmi_set_log_level(int level)
void lsymbol_dump(struct lsymbol *lsymbol, struct dump_info *ud)
#define array_list_foreach(alist, lpc, placeholder)
struct dt_argp_state opts
struct debugfile_load_opts * debugfile_load_opts_parse(char *optstr)
int main(int argc, char **argv)
void symbol_dump(struct symbol *symbol, struct dump_info *ud)
void vmi_set_warn_level(int level)
struct binfile_ops elf_binfile_ops
void vmi_inc_warn_level(void)
void * realloc(void *ptr, size_t size)
struct lsymbol * debugfile_lookup_sym(struct debugfile *debugfile, char *name, const char *delim, struct rfilter *srcfile_filter, symbol_type_flag_t flags)
struct debugfile * debugfile_from_instance(struct binfile_instance *bfinst, struct array_list *debugfile_load_opts_list)
void * calloc(size_t nmemb, size_t size)
GSList * debugfile_match_syms(struct debugfile *debugfile, struct rfilter *symbol_filter, symbol_type_flag_t flags, struct rfilter *srcfile_filter)
#define REF_DEBUG_REPORT_FINISH()
void debugfile_load_opts_free(struct debugfile_load_opts *opts)
void debugfile_dump(struct debugfile *debugfile, struct dump_info *ud, int types, int globals, int symtabs, int elfsymtab, int doranges)
struct lsymbol * debugfile_lookup_sym_line(struct debugfile *debugfile, char *filename, int line, SMOFFSET *offset, ADDR *addr)
unsigned int num_sections