From cafca288a28ce94c4b06e19ba4bf4ed9cda5dbba Mon Sep 17 00:00:00 2001 From: Pierre Pronchery Date: Sat, 4 Jun 2011 01:56:26 +0000 Subject: [PATCH] Print error when disassembly fails --- src/format.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/format.c b/src/format.c index 3b1fc85..19228a7 100644 --- a/src/format.c +++ b/src/format.c @@ -273,11 +273,16 @@ static int _format_helper_set_string(Format * format, int id, char const * name, static int _format_helper_decode(Format * format, char const * section, off_t offset, size_t size, off_t base) { + int ret; + #ifdef DEBUG fprintf(stderr, "DEBUG: %s(\"%s\", 0x%lx, 0x%lx, 0x%lx)\n", __func__, section, offset, size, base); #endif - return code_decode_at(format->code, section, offset, size, base); + if((ret = code_decode_at(format->code, section, offset, size, base)) + != 0) + error_print("deasm"); + return ret; }