Fix issue with 0 size symbols

This commit is contained in:
pancake 2014-01-12 01:20:40 +01:00
parent a648539513
commit 0e9cd2e36c
3 changed files with 14 additions and 5 deletions

View File

@ -714,9 +714,17 @@ static int bin_symbols (RCore *r, int mode, ut64 baddr, int va, ut64 at, const c
free (mn);
}
r_name_filter (symbol->name, sizeof (symbol->name));
if (!strncmp (symbol->type,"OBJECT", 6))
r_cons_printf ("Cd %"PFMT64d" @ 0x%08"PFMT64x"\n",
symbol->size, addr);
if (!strncmp (symbol->type,"OBJECT", 6)) {
if (symbol->size == 0) {
symbol->size = strlen (symbol->name);
r_cons_printf ("Cs %"PFMT64d" @ 0x%08"PFMT64x"\n",
symbol->size, addr);
} else
if (symbol->size>0) {
r_cons_printf ("Cd %"PFMT64d" @ 0x%08"PFMT64x"\n",
symbol->size, addr);
} else eprintf ("Wrong symbol '%s' have size %d\n", symbol->name, symbol->size);
}
r_cons_printf ("f sym.%s %"PFMT64d" 0x%08"PFMT64x"\n",
symbol->name, symbol->size, addr);
} else r_cons_printf ("addr=0x%08"PFMT64x" off=0x%08"PFMT64x" ord=%03"PFMT64d" "

View File

@ -1,4 +1,5 @@
/* radare - LGPL - Copyright 2009-2013 - pancake */
/* radare - LGPL - Copyright 2009-2014 - pancake */
static void r_core_file_info (RCore *core, int mode) {
const char *fn = NULL;
int dbg = r_config_get_i (core->config, "cfg.debug");

View File

@ -190,7 +190,7 @@ static int cmd_meta(void *data, const char *input) {
if (fi) strncpy (name, fi->name, sizeof (name)-1);
}
} else if (n<1) {
eprintf ("Invalid length\n");
eprintf ("Invalid length %d\n", n);
return R_FALSE;
}
}