From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20521 invoked by alias); 24 Dec 2004 09:32:52 -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 20408 invoked from network); 24 Dec 2004 09:32:26 -0000 Received: from unknown (HELO topsns.toshiba-tops.co.jp) (202.230.225.5) by sourceware.org with SMTP; 24 Dec 2004 09:32:26 -0000 Received: from newms.toshiba-tops.co.jp by topsns.toshiba-tops.co.jp via smtpd (for sourceware.org [12.107.209.250]) with SMTP; 24 Dec 2004 09:32:25 UT Received: from srd2sd.toshiba-tops.co.jp (gw-chiba7.toshiba-tops.co.jp [172.17.244.27]) by newms.toshiba-tops.co.jp (Postfix) with ESMTP id DCE45239E3C; Fri, 24 Dec 2004 18:32:24 +0900 (JST) Received: from localhost (fragile [172.17.28.65]) by srd2sd.toshiba-tops.co.jp (8.12.10/8.12.10) with ESMTP id iBO9WOMc029481; Fri, 24 Dec 2004 18:32:24 +0900 (JST) (envelope-from anemo@mba.ocn.ne.jp) Date: Fri, 24 Dec 2004 09:32:00 -0000 Message-Id: <20041224.183224.32500163.nemoto@toshiba-tops.co.jp> To: gdb@sources.redhat.com Subject: gdb 6.x 'next' does not work on mips-linux/mipsel-linux From: Atsushi Nemoto X-Fingerprint: 6ACA 1623 39BD 9A94 9B1A B746 CA77 FE94 2874 D52F X-Pgp-Public-Key: http://wwwkeys.pgp.net/pks/lookup?op=get&search=0x2874D52F Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-SW-Source: 2004-12/txt/msg00118.txt.bz2 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? 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