Get current section baddr if multiple files are open

This commit is contained in:
zlowram 2016-01-03 03:10:09 +01:00 committed by pancake
parent abc5575dfc
commit a494a59901

View File

@ -65,7 +65,7 @@ R_API int r_core_lines_initcache (RCore *core, ut64 start_addr, ut64 end_addr) {
int bsz = core->blocksize;
char *buf;
ut64 off = start_addr;
ut64 baddr = r_config_get_i (core->config, "bin.baddr");
ut64 baddr;
if (start_addr == UT64_MAX || end_addr == UT64_MAX) {
return -1;
}
@ -76,6 +76,11 @@ R_API int r_core_lines_initcache (RCore *core, ut64 start_addr, ut64 end_addr) {
return -1;
}
{
RIOSection *s = r_io_section_mget_in (core->io, core->offset);
baddr = s ? s->offset : r_config_get_i (core->config, "bin.baddr");
}
line_count = start_addr ? 0 : 1;
core->print->lines_cache[0] = start_addr ? 0 : baddr;
r_cons_break (NULL, NULL);