On 03/01/2013 07:30 PM, Pedro Alves wrote > I do agree that trying to find the end of the prologue of a plt stub is futile. We know plt stubs > aren't "normal" functions, and don't have prologues. > > But, I do think the prologue analyzer still has a problem. You should see this > same issue with any small normal function (with no debug info) that happens to > end up close enough to the end of its section. I agree, but normally there will be crtn* files which will placed after the noraml function, so that the distance to the section with different alignment, for example .eh_frame_hdr, will be long enough to prevent this happen. > > I suggest limiting the end address of the analysis with something like > in tilegx_skip_prologue > > + /* 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)); > > return tilegx_analyze_prologue (gdbarch, > start_pc, > - start_pc + 8 * TILEGX_BUNDLE_SIZE_IN_BYTES, > + end_pc, > > and also, make tilegx_analyze_prologue never touch memory > over end_addr. It doesn't seem to take that care currently? I think this fix make sense, and tilegx_analyze_prologue has glitch, it will ignore "end_pc" to some extent. the prefetch buffer in tilegx_analyze_prologue should consider the end_pc. I have tested the new patch by rerun dejagnu, please review, thanks. gdb/ChangeLog: * tilegx-tdep.c (tilegx_analyze_prologue): Improve the evaluation of "instbuf_size". (tilegx_skip_prologue): Improve the evaluation of the end address for prologue analyze. -- Regards, Jiong. Wang Tilera Corporation.