Bug 19890 - gdb until command is broken for functions
gdb until command is broken for functions
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: gdb (Show other bugs)
8.0
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Elena Zannoni
Aaron Brown
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2000-10-26 21:36 EDT by Jim Nance
Modified: 2007-04-18 12:29 EDT (History)
0 users

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


Attachments (Terms of Use)

  None (edit)
Description Jim Nance 2000-10-26 21:36:35 EDT
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-29 22:45:58 EST
Daniel, can you take a look at this?
Comment 2 Trond Eivind Glomsrxd 2000-11-28 14:08:28 EST
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 16:11:32 EDT
Still a problem with current gdb CVS.
Comment 4 Trond Eivind Glomsrxd 2001-11-28 17:56:17 EST
A problem with gdb 5.1 as well.
Comment 5 Trond Eivind Glomsrxd 2002-05-07 18:11:20 EDT
(and 5.2)
Comment 6 Alan Cox 2002-12-14 21:58:51 EST
Still present
Comment 7 Elena Zannoni 2002-12-20 12:57:29 EST
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 11:47:40 EST
Thanks for the suggestion. I will definitely add the dependency to the rpms from
now on. 
Comment 9 Elena Zannoni 2003-01-27 11:50:06 EST
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 11:51:50 EST
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.