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
Daniel, can you take a look at this?
This is still present in the gdb CVS... Daniel, have you had a chance to look at it?
Still a problem with current gdb CVS.
A problem with gdb 5.1 as well.
(and 5.2)
Still present
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.
Thanks for the suggestion. I will definitely add the dependency to the rpms from now on.
Doh! I added a comment for the wrong bug. Anyway, this bug is also fixed in the next release/beta. At last!
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.