From 59fa3c239e3e21ee7bb465ad67494d2634d32456 Mon Sep 17 00:00:00 2001 From: pancake Date: Sun, 16 Aug 2015 18:49:17 +0200 Subject: [PATCH] Refix reverted patch to solve rbin info in debugger --- libr/core/file.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libr/core/file.c b/libr/core/file.c index ae244df4b2..f7d14fdcc1 100644 --- a/libr/core/file.c +++ b/libr/core/file.c @@ -305,7 +305,9 @@ static int r_core_file_do_load_for_debug (RCore *r, ut64 loadaddr, const char *f r_config_set_i (r->config, "bin.laddr", baseaddr); } #endif - if (!r_bin_load (r->bin, filenameuri, baseaddr, loadaddr, xtr_idx, desc->fd, treat_as_rawstr)) { + // HACK if its a relative path, load from disk instead of memory + int fd = (filenameuri[0] == '.')? -1: desc->fd; + if (!r_bin_load (r->bin, filenameuri, baseaddr, loadaddr, xtr_idx, fd, treat_as_rawstr)) { eprintf ("Cannot open %s\n", filenameuri); if (r_config_get_i (r->config, "bin.rawstr")) { treat_as_rawstr = R_TRUE;