+2013-03-01 Jiong Wang <jiwang@tilera.com>
+ Pedro Alves <palves@redhat.com>
+
+ * tilegx-tdep.c (tilegx_analyze_prologue): Limit bundle reading
+ to END_ADDR.
+ (tilegx_skip_prologue): Limit prologue analysis to section end.
+
2013-03-01 Jan Kratochvil <jan.kratochvil@redhat.com>
* dwarf2loc.c (call_site_find_chain_1): New variable save_callee_pc,
if (instbuf_size > size_on_same_page)
instbuf_size = size_on_same_page;
+
+ instbuf_size = min (instbuf_size, (end_addr - next_addr));
instbuf_start = next_addr;
status = safe_frame_unwind_memory (next_frame, instbuf_start,
static CORE_ADDR
tilegx_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR start_pc)
{
- CORE_ADDR func_start;
+ CORE_ADDR func_start, end_pc;
+ struct obj_section *s;
/* This is the preferred method, find the end of the prologue by
using the debugging information. */
return max (start_pc, post_prologue_pc);
}
+ /* Don't straddle a section boundary. */
+ s = find_pc_section (start_pc);
+ end_pc = start_pc + 8 * TILEGX_BUNDLE_SIZE_IN_BYTES;
+ if (s != NULL)
+ end_pc = min (end_pc, obj_section_endaddr (s));
+
/* Otherwise, try to skip prologue the hard way. */
return tilegx_analyze_prologue (gdbarch,
start_pc,
- start_pc + 8 * TILEGX_BUNDLE_SIZE_IN_BYTES,
+ end_pc,
NULL, NULL);
}