From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15098 invoked by alias); 26 Feb 2006 19:38:34 -0000 Received: (qmail 15090 invoked by uid 22791); 26 Feb 2006 19:38:33 -0000 X-Spam-Check-By: sourceware.org Received: from sibelius.xs4all.nl (HELO sibelius.xs4all.nl) (82.92.89.47) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sun, 26 Feb 2006 19:38:31 +0000 Received: from elgar.sibelius.xs4all.nl (root@elgar.sibelius.xs4all.nl [192.168.0.2]) by sibelius.xs4all.nl (8.13.4/8.13.4) with ESMTP id k1QJbuNq023839; Sun, 26 Feb 2006 20:37:56 +0100 (CET) Received: from elgar.sibelius.xs4all.nl (kettenis@localhost.sibelius.xs4all.nl [127.0.0.1]) by elgar.sibelius.xs4all.nl (8.13.4/8.13.3) with ESMTP id k1QJbtf3027185; Sun, 26 Feb 2006 20:37:55 +0100 (CET) Received: (from kettenis@localhost) by elgar.sibelius.xs4all.nl (8.13.4/8.13.4/Submit) id k1QJbtti031456; Sun, 26 Feb 2006 20:37:55 +0100 (CET) Date: Sun, 26 Feb 2006 20:23:00 -0000 Message-Id: <200602261937.k1QJbtti031456@elgar.sibelius.xs4all.nl> From: Mark Kettenis To: fnf@specifix.com CC: drow@false.org, gdb-patches@sourceware.org In-reply-to: <200602261411.48296.fnf@specifix.com> (message from Fred Fish on Sun, 26 Feb 2006 14:11:48 -0500) Subject: Re: [PATCH] Recognize and skip interpreter_p initialization in selftest.exp References: <200602261335.28612.fnf@specifix.com> <20060226184004.GA19823@nevyn.them.org> <200602261411.48296.fnf@specifix.com> Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-02/txt/msg00486.txt.bz2 > From: Fred Fish > Date: Sun, 26 Feb 2006 14:11:48 -0500 > > On Sunday 26 February 2006 13:40, Daniel Jacobowitz wrote: > > happen? Could you please verify a couple of things for me: that we are > > reasonably close to the beginning of the function, that the prologue > > skipper hasn't gone too far, and that the instruction being executed > > has actually got some relationship to line 241. > > I'm not very familiar with x86 assembly so I'm probably not the best one > to look closely at the code generated for captured_main. The mov $0x1,%edi is probably initializing a local variable to 1. It is very unlikely that this instruction is part of line 241; it's much more likely this is line 186 or 189. I'd say, that GCC is generating bogus line number information or GDB is interpreting that line number information uncorrectly. Either way, your "fix" is probably papering over a real bug. > Here is what I get when I run by hand and do a bunch of "next" commands: > > (gdb) br captured_main > Breakpoint 1 at 0x807c714: file /src/latest/trunk/src/gdb/gdb/main.c, line 241. > (gdb) run > Starting program: /links/build/latest/trunk/i686-pc-linux-gnu/gdb/gdb/gdb > Breakpoint 1, captured_main (data=0xbfbb4734) at /src/latest/trunk/src/gdb/gdb/main.c:241 > 241 interpreter_p = xstrdup (context->interpreter_p); > (gdb) next > 120 { > (gdb) > 241 interpreter_p = xstrdup (context->interpreter_p); > (gdb) > 120 { > (gdb) > 123 char **argv = context->argv; > (gdb) > 122 int argc = context->argc; > (gdb) > 123 char **argv = context->argv; > (gdb) > 122 int argc = context->argc; > (gdb) > 165 long time_at_startup = get_run_time (); > (gdb) > 168 setlocale (LC_MESSAGES, ""); > (gdb) > 165 long time_at_startup = get_run_time (); > (gdb) > 168 setlocale (LC_MESSAGES, ""); > (gdb) > 171 setlocale (LC_CTYPE, ""); > (gdb) > 173 bindtextdomain (PACKAGE, LOCALEDIR); > (gdb) > 174 textdomain (PACKAGE); > (gdb) > 177 lim_at_start = (char *) sbrk (0); > (gdb) > 187 cmdarg = (struct cmdarg *) xmalloc (cmdsize * sizeof (*cmdarg)); > (gdb) > 177 lim_at_start = (char *) sbrk (0); > (gdb) > > > I suppose it's possible though that the code at 0x807c714 doesn't have anything to > do with line 241: > > (gdb) x/40i captured_main > 0x807c710 : push %ebp > 0x807c711 : mov %esp,%ebp > 0x807c713 : push %edi > 0x807c714 : mov $0x1,%edi > 0x807c719 : push %esi > 0x807c71a : mov $0x1,%esi > 0x807c71f : push %ebx > 0x807c720 : sub $0x11c,%esp > 0x807c726 : mov 0x8(%ebp),%ebx > 0x807c729 : mov 0x4(%ebx),%edx > 0x807c72c : mov (%ebx),%eax > 0x807c72e : mov %edx,0xffffff08(%ebp) > 0x807c734 : mov %eax,0xffffff04(%ebp) > 0x807c73a : call 0x8230970 > 0x807c73f : movl $0x823b767,0x4(%esp) > 0x807c747 : movl $0x5,(%esp) > 0x807c74e : mov %eax,0xffffff30(%ebp) > 0x807c754 : call 0x807ba20 > 0x807c759 : movl $0x823b767,0x4(%esp) > 0x807c761 : movl $0x0,(%esp) > 0x807c768 : call 0x807ba20 > 0x807c76d : movl $0x8232b80,0x4(%esp) > 0x807c775 : movl $0x8232a90,(%esp) > 0x807c77c : call 0x807bd20 > 0x807c781 : movl $0x8232a90,(%esp) > 0x807c788 : call 0x807c030 > 0x807c78d : movl $0x0,(%esp) > 0x807c794 : call 0x807be10 > 0x807c799 : movl $0x8,(%esp) > 0x807c7a0 : mov %eax,0x82d36e0 > 0x807c7a5 : call 0x8084f20 > 0x807c7aa : movl $0x4,(%esp) > 0x807c7b1 : mov %eax,0xffffff20(%ebp) > 0x807c7b7 : call 0x8084f20 > 0x807c7bc : movl $0x0,0x82d3b90 > 0x807c7c6 : mov %eax,0xffffff28(%ebp) > 0x807c7cc : mov 0x82b0d68,%eax > 0x807c7d1 : mov %eax,(%esp) > 0x807c7d4 : call 0x8084f20 > 0x807c7d9 : mov %eax,0x82d36fc >