On 02/20/2013 10:48 AM, Jiong Wang wrote: > gdb/ChangeLog: > > * tilegx-tdep.c (tilegx_skip_prologue): when prefetching ^^^^ "When" > multiple instruction bundles, check section boundary > instead of page boundary. Is it possible that the section layouts on two pages? I mean, if is possible that NEXT_ADDR is within section FOO and page A, but the end of section FOO is within page A + 1. If this is true, we need to check to the min (page boundary, section boundary), otherwise, we don't have to worry about it. > --- > gdb/tilegx-tdep.c | 12 ++++++++---- > 1 files changed, 8 insertions(+), 4 deletions(-) > > diff --git a/gdb/tilegx-tdep.c b/gdb/tilegx-tdep.c > index 2c4e349..f8a6255 100644 > --- a/gdb/tilegx-tdep.c > +++ b/gdb/tilegx-tdep.c > @@ -424,15 +424,18 @@ tilegx_analyze_prologue (struct gdbarch* gdbarch, > /* Retrieve the next instruction. */ > if (next_addr - instbuf_start >= instbuf_size) > { > - /* Figure out how many bytes to fetch. Don't span a page > + /* Figure out how many bytes to fetch. Don't span a section > boundary since that might cause an unnecessary memory > error. */ > - unsigned int size_on_same_page = 4096 - (next_addr & 4095); > + unsigned int size_on_same_section; > + struct obj_section *s = find_pc_section(next_addr); A space is needed between find_pc_section and "(". A blank line is needed here as well. > + gdb_assert(s != NULL); A space is needed between gdb_assert and "(". I have no other comments on this patch. It looks good now, but it still needs a review and approval from maintainers. -- Yao (ÆëÒ¢)