Bug 19890 - gdb until command is broken for functions
Summary: gdb until command is broken for functions
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: gdb (Show other bugs)
(Show other bugs)
Version: 8.0
Hardware: i386 Linux
medium
medium
Target Milestone: ---
Assignee: Elena Zannoni
QA Contact: Aaron Brown
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2000-10-27 01:36 UTC by Jim Nance
Modified: 2007-04-18 16:29 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2003-01-27 16:50:06 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

Description Jim Nance 2000-10-27 01:36:35 UTC
The until command is broken in the gdb that ships with redhat 7.0.  It was
working in redhat 6.2.

You are supposed to be able to give gdb the command:

until function

and have it run until it either enters the function or leaves the current
function.  For example consider the program:

----------------------------------- bug.c -------------------------------
static int x;

int fun()
{
    x = 1;
}

int main(int ac, char **av)
{
    x = 3;
    fun();
    x = 3;
    return 0;
}
-------------------------------- end of bug.c ----------------------------

and the gdb script:

--------------------------------- script ---------------------------------
shell gcc -g bug.c
file a.out
b main
r
until fun
--------------------------------- end of script --------------------------

Now if you run the command:

gdb -x script

You will get the following output:

GNU gdb 5.0
Copyright 2000 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-redhat-linux".
Breakpoint 1 at 0x80483b3: file bug.c, line 10.

Breakpoint 1, main (ac=1, av=0xbffff964) at bug.c:10
10          x = 3;
0x400329cb in __libc_start_main (main=0x80483b0 <main>, argc=1,
    argv=0xbffff964, init=0x8048274 <_init>, fini=0x804840c <_fini>,
    rtld_fini=0x4000ae60 <_dl_fini>, stack_end=0xbffff95c)
    at ../sysdeps/generic/libc-start.c:92
92      ../sysdeps/generic/libc-start.c: No such file or directory.
(gdb)

instead of the correct result, which would have been for the debugger to
stop inside the fun() function.  Again, this works with the gdb from 6.2

Comment 1 Trond Eivind Glomsrxd 2000-10-30 03:45:58 UTC
Daniel, can you take a look at this?

Comment 2 Trond Eivind Glomsrxd 2000-11-28 19:08:28 UTC
This is still present in the gdb CVS... Daniel, have you had a chance to look at it?

Comment 3 Trond Eivind Glomsrxd 2001-07-30 20:11:32 UTC
Still a problem with current gdb CVS.

Comment 4 Trond Eivind Glomsrxd 2001-11-28 22:56:17 UTC
A problem with gdb 5.1 as well.

Comment 5 Trond Eivind Glomsrxd 2002-05-07 22:11:20 UTC
(and 5.2)

Comment 6 Alan Cox 2002-12-15 02:58:51 UTC
Still present


Comment 7 Elena Zannoni 2002-12-20 17:57:29 UTC
Bug report forwarded to FSF bug database. gdb/898.


See discussion at:
http://sources.redhat.com/ml/gdb/2002-11/msg00144.html

Fix coming in next release.

Comment 8 Elena Zannoni 2003-01-27 16:47:40 UTC
Thanks for the suggestion. I will definitely add the dependency to the rpms from
now on. 

Comment 9 Elena Zannoni 2003-01-27 16:50:06 UTC
Doh! I added a comment for the wrong bug.

Anyway, this bug is also fixed in the next release/beta. At last!






Comment 10 Elena Zannoni 2003-01-27 16:51:50 UTC
Note: A new command has been added to gdb to do what this bug report was
complaining about.

the new command is called "advance". Do "help advance" at the gdb prompt,
and compare with "help until". Also, look in the gdb user manual.




Note You need to log in before you can comment on or make changes to this bug.