diff options
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 7 | ||||
-rw-r--r-- | gdb/rs6000-tdep.c | 9 |
2 files changed, 14 insertions, 2 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 136bb1d..10ab673 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,10 @@ +2011-01-18 Joel Brobecker <brobecker@adacore.com> + + * rs6000-tdep.c (rs6000_skip_prologue): Make sure that the prologue + upper limit address is not greater than the function end address + when the upper limit could not be computed using the debugging + info. + 2011-01-17 Tom Tromey <tromey@redhat.com> * cli/cli-cmds.c (apropos_command): Free the compiled regex. Use diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c index c16e933..9832b5b 100644 --- a/gdb/rs6000-tdep.c +++ b/gdb/rs6000-tdep.c @@ -2090,12 +2090,12 @@ static CORE_ADDR rs6000_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc) { struct rs6000_framedata frame; - CORE_ADDR limit_pc, func_addr; + CORE_ADDR limit_pc, func_addr, func_end_addr = 0; /* See if we can determine the end of the prologue via the symbol table. If so, then return either PC, or the PC after the prologue, whichever is greater. */ - if (find_pc_partial_function (pc, NULL, &func_addr, NULL)) + if (find_pc_partial_function (pc, NULL, &func_addr, &func_end_addr)) { CORE_ADDR post_prologue_pc = skip_prologue_using_sal (gdbarch, func_addr); @@ -2113,6 +2113,11 @@ rs6000_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc) if (limit_pc == 0) limit_pc = pc + 100; /* Magic. */ + /* Do not allow limit_pc to be past the function end, if we know + where that end is... */ + if (func_end_addr && limit_pc > func_end_addr) + limit_pc = func_end_addr; + pc = skip_prologue (gdbarch, pc, limit_pc, &frame); return pc; } |