gnu/71160: gdb gets confused about active frame

Dag-Erling Smørgrav des at
Mon Aug 30 12:30:26 PDT 2004

>Number:         71160
>Category:       gnu
>Synopsis:       gdb gets confused about active frame
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Aug 30 19:30:24 GMT 2004
>Originator:     Dag-Erling Smørgrav
>Release:        FreeBSD 6.0-CURRENT i386
System: FreeBSD 6.0-CURRENT FreeBSD 6.0-CURRENT #12: Sun Aug 29 22:14:28 CEST 2004 des at i386


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.


des at 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)

        return (0);
des at dwp ~/src/gdbtest% gcc -g -o gdbtest gdbtest.c
des at 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>
8       static void
9       crash(int *arg)
10      {
11              sleep(*arg);
12      }
14      int
15      main(void)
(gdb) quit


More information about the freebsd-bugs mailing list