Re: gdb 6.x 'next' does not work on mips-linux/mipsel-linux

Daniel Jacobowitz
2005-04-27T14:18:03Z

On Wed, Apr 27, 2005 at 09:43:06AM -0400, Daniel Jacobowitz wrote:
> Hmm, no step into the lazy resolution stub; it's already been resolved
> to strcpy. The system I'm doing all my testing on apparently does not
> do lazy binding :-( Looks like a binutils problem - I believe I
> remember fixing this bug some time after binutils 2.14 was released.
>
> I'll keep trying to reproduce this.

Got it. Could either of you please test this patch? Without it, I get
failures in call-strs.exp; with it, everything passes.

--
Daniel Jacobowitz
CodeSourcery, LLC

2005-04-27 Daniel Jacobowitz <dan@codesourcery.com>

* mips-tdep.c (mips_stub_frame_sniffer): Handle .MIPS.stubs
section like .plt.

Index: mips-tdep.c
===================================================================
RCS file: /big/fsf/rsync/src-cvs/src/gdb/mips-tdep.c,v
retrieving revision 1.379
diff -u -p -r1.379 mips-tdep.c
--- mips-tdep.c 17 Mar 2005 18:07:46 -0000 1.379
+++ mips-tdep.c 27 Apr 2005 14:12:21 -0000
@@ -2091,11 +2091,21 @@ static const struct frame_unwind mips_st
static const struct frame_unwind *
mips_stub_frame_sniffer (struct frame_info *next_frame)
{
+ struct obj_section *s;
CORE_ADDR pc = frame_pc_unwind (next_frame);
+
if (in_plt_section (pc, NULL))
return &mips_stub_frame_unwind;
- else
- return NULL;
+
+ /* Binutils for MIPS puts lazy resolution stubs into .MIPS.stubs. */
+ s = find_pc_section (pc);
+
+ if (s != NULL
+ && strcmp (bfd_get_section_name (s->objfile->obfd, s->the_bfd_section),
+ ".MIPS.stubs") == 0)
+ return &mips_stub_frame_unwind;
+
+ return NULL;
}

static CORE_ADDR