From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13578 invoked by alias); 4 Jan 2005 20:30:27 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 13537 invoked from network); 4 Jan 2005 20:30:17 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org with SMTP; 4 Jan 2005 20:30:17 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11/8.12.11) with ESMTP id j04KUC9e030143 for ; Tue, 4 Jan 2005 15:30:12 -0500 Received: from localhost.redhat.com (vpn50-80.rdu.redhat.com [172.16.50.80]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id j04KUBr02833; Tue, 4 Jan 2005 15:30:11 -0500 Received: from [127.0.0.1] (localhost.localdomain [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id AA3D17D79; Tue, 4 Jan 2005 15:30:00 -0500 (EST) Message-ID: <41DAFCC7.5010306@gnu.org> Date: Tue, 04 Jan 2005 20:30:00 -0000 From: Andrew Cagney User-Agent: Mozilla Thunderbird 0.8 (X11/20041020) MIME-Version: 1.0 To: Atsushi Nemoto Cc: gdb@sources.redhat.com Subject: Re: gdb 6.x 'next' does not work on mips-linux/mipsel-linux References: <20041224.183224.32500163.nemoto@toshiba-tops.co.jp> In-Reply-To: <20041224.183224.32500163.nemoto@toshiba-tops.co.jp> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2005-01/txt/msg00030.txt.bz2 Atsushi Nemoto wrote: > Hi. I noticed gdb 6.3 'next' command does not work (even for the > "hello world" program) on mips-linux/mipsel-linux. It works well for > statically linked programs. > > I found PR#1716 (for gdb 6.1.1). Is this solved on gdb 6.3? Can you test/debug a mainline GDB? The MIPS code has been completely overhauled. Andrew > Also I found discussions in this ML (Subject: "Unable to step over (n > and ni) on mipsel-linux...") but can not see final solution. > > Here is my inspection: > > When 'next' failed, following call (infrun.c:1772) stores 0 in > ecs->stop_func_start. > > find_pc_partial_function (stop_pc, &ecs->stop_func_name, > &ecs->stop_func_start, &ecs->stop_func_end); > > More exactly, following call (blockframe.c:211) returned NULL. > > msymbol = lookup_minimal_symbol_by_pc_section (mapped_pc, section); > > 'mapped_pc' was an address of a STUB section to the libc function > (printf) and 'section' was ".MIPS.stubs". > > When I tried gdb 5.3, the 'section' variable was NULL in that point. > > So I suppose something wrong with ".MIPS.stubs" section handling. > > With this quick and dirty hack, 'next' command works well. > > --- gdb-6.3.org/gdb/blockframe.c 2004-09-01 23:13:31.000000000 +0900 > +++ gdb-6.3/gdb/blockframe.c 2004-12-24 17:50:27.747543472 +0900 > @@ -199,6 +199,10 @@ > section = NULL; > else > section = obj_section->the_bfd_section; > +#if 1 /* dirty hack... */ > + if (section && strcmp(section->name, ".MIPS.stubs") == 0) > + section = NULL; > +#endif > } > > mapped_pc = overlay_mapped_address (pc, section); > > > I do not think this hack is correct at all, but hope it helps fixing > the real problem. > > Thank you. > > > P.S. I'm not on this ML. Please CC to me. > --- > Atsushi Nemoto >