From des@des.no  Mon Aug 30 19:28:33 2004
Return-Path: <des@des.no>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id AA09916A4CE
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 30 Aug 2004 19:28:33 +0000 (GMT)
Received: from mail.broadpark.no (mail.broadpark.no [217.13.4.2])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 6100043D49
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 30 Aug 2004 19:28:33 +0000 (GMT)
	(envelope-from des@des.no)
Received: from dwp.des.no (37.80-203-228.nextgentel.com [80.203.228.37])
	by mail.broadpark.no (Postfix) with ESMTP id 9F0823E88
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 30 Aug 2004 21:29:10 +0200 (MEST)
Received: by dwp.des.no (Postfix, from userid 2602)
	id 52523B873; Mon, 30 Aug 2004 21:28:32 +0200 (CEST)
Message-Id: <20040830192832.52523B873@dwp.des.no>
Date: Mon, 30 Aug 2004 21:28:32 +0200 (CEST)
From: Dag-Erling Smrgrav <des@des.no>
Reply-To: Dag-Erling Smrgrav <des@des.no>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: gdb gets confused about active frame
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         71160
>Category:       gnu
>Synopsis:       gdb gets confused about active frame
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    marcel
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Aug 30 19:30:24 GMT 2004
>Closed-Date:    Thu Jul 31 08:25:22 UTC 2008
>Last-Modified:  Thu Jul 31 08:25:22 UTC 2008
>Originator:     Dag-Erling Smrgrav
>Release:        FreeBSD 6.0-CURRENT i386
>Organization:
>Environment:
System: FreeBSD dwp.des.no 6.0-CURRENT FreeBSD 6.0-CURRENT #12: Sun Aug 29 22:14:28 CEST 2004 des@dwp.des.no:/usr/obj/usr/src/sys/dwp_up i386

>Description:

After 'where', gdb 6.1.1 gets confused about which frame is currently
selected.  If asked for a source listing, it will show the source
corresponding to the outermost frame instead of that corresponding to
the currently selected frame.

>How-To-Repeat:

des@dwp ~/src/gdbtest% cat gdbtest.c
/*
 * $Id: gdbtest.c,v 1.1 2004-08-30 19:20:05 des Exp $
 */

#include <stdio.h>
#include <unistd.h>

static void
crash(int *arg)
{
        sleep(*arg);
}

int
main(void)
{
        crash(NULL);
        return (0);
}
des@dwp ~/src/gdbtest% gcc -g -o gdbtest gdbtest.c
des@dwp ~/src/gdbtest% gdb gdbtest
GNU gdb 6.1.1 [FreeBSD]
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-marcel-freebsd"...
(gdb) run
Starting program: /home/des/src/gdbtest/gdbtest

Program received signal SIGSEGV, Segmentation fault.
0x080484e8 in crash (arg=0x0) at gdbtest.c:11
11              sleep(*arg);
(gdb) where
#0  0x080484e8 in crash (arg=0x0) at gdbtest.c:11
#1  0x0804851a in main () at gdbtest.c:17
(gdb) l
17              crash(NULL);
18              return (0);
19      }
(gdb) down
Bottom (i.e., innermost) frame selected; you cannot go down.
(gdb) l
Line number 20 out of range; gdbtest.c has 19 lines.
(gdb) up 0
#0  0x080484e8 in crash (arg=0x0) at gdbtest.c:11
11              sleep(*arg);
(gdb) l
6       #include <unistd.h>
7
8       static void
9       crash(int *arg)
10      {
11              sleep(*arg);
12      }
13
14      int
15      main(void)
(gdb) quit

>Fix:
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->marcel 
Responsible-Changed-By: marcel 
Responsible-Changed-When: Fri Sep 9 00:54:45 GMT 2005 
Responsible-Changed-Why:  
I'll handle GDB. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=71160 
State-Changed-From-To: open->closed 
State-Changed-By: des 
State-Changed-When: Thu Jul 31 08:25:21 UTC 2008 
State-Changed-Why:  
Pilot error 

http://www.freebsd.org/cgi/query-pr.cgi?pr=71160 
>Unformatted:
