bug-gdb
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: note from Prof D E Knuth


From: Kevin Buettner
Subject: Re: note from Prof D E Knuth
Date: Tue, 21 Aug 2001 18:07:03 -0700

On Aug 21,  2:16pm, Maggie McLoughlin wrote:

> I just downloaded and installed version 5.0, configured as 
> "i686-pc-linux-gnu".
> My gcc is "egcs-2.91.66".
[...]
> Three small files that illustrate the problem are appended below.
> File "simple.c" was generated by "ctangle simple simple simple",
> from the CWEB source file "simple.w" and the CWEB change file "simple.ch".
> The #line directives in simple.c refer back to those source files.
> 
> When I invoke gdb and say "break main" and then "run", I usually can
> single step through my programs using "n" repeatedly.
> 
> But in this case, gdb gets lost. When I get to the source line that
> prints "The last line", the "n" instruction does not stop after that
> instruction; I mean, it executes the change-file line that prints "No, this
> one is actually last" WITHOUT GIVING ME A CHANCE TO SINGLE-STEP THROUGH
> THAT INSTRUCTION.

This bug was fixed in the GDB development sources earlier this year.
It is also fixed in the GDB 5.1 branch.

For information on downloading a development version, see:

    http://sources.redhat.com/gdb/download/

For information on downloading the latest from the GDB 5.1 branch,
see the July 29, 2001 entry of the GDB news:

    http://sources.redhat.com/gdb/news/

Unfortunately, it appears that a similar problem exists when GDB is
used to debug the output from GCC 3.0.  However, you will not run into
this problem so long as you continue to use a GCC version earlier than
3.0.  (I do not yet know if the problem is in GDB or GCC 3.0...)

When I build your program with egcs-2.91.66 and debug it with a GDB
built using the current development sources, I see the following
behavior:

    GNU gdb 2001-08-21-cvs (MI_OUT)
    Copyright 2001 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 "i686-pc-linux-gnu".
    (gdb) file simple
    Reading symbols from simple...done.
    (gdb) b main
    Breakpoint 1 at 0x80483cb: file simple.w, line 10.
    (gdb) r
    Starting program: /saguaro1/ctests/simple 

    Breakpoint 1, main () at simple.w:10
    10        printf("The first line.\n");
    (gdb) n
    The first line.
    4         printf("A good line.\n");
    (gdb) n
    A good line.
    16      printf("The last line.\n");
    (gdb) n
    The last line.
    10      printf("No, this one is actually last.\n");
    (gdb) n
    No, this one is actually last.
    13      }
    (gdb) 

Kevin



reply via email to

[Prev in Thread] Current Thread [Next in Thread]